Data Structures

group group_tcpwm_data_structures_pwm
struct cy_stc_tcpwm_pwm_config_t
#include <cy_tcpwm_pwm.h>

PWM configuration structure.

Public Members

uint32_t pwmMode

Sets the PWM mode.

See PWM modes

uint32_t clockPrescaler

Sets the clock prescaler inside the TCWPM block.

See PWM CLK Prescaler values

uint32_t pwmAlignment

Sets the PWM alignment.

See PWM Alignment

uint32_t deadTimeClocks

The number of dead time-clocks if PWM with dead time is chosen.

uint32_t runMode

Sets the PWM run mode.

See PWM run modes

uint32_t period0

Sets the period0 of the pwm.

uint32_t period1

Sets the period1 of the pwm.

bool enablePeriodSwap

Enables swapping of period 0 and period 1 on terminal count.

uint32_t compare0

Sets the value for Compare 0.

uint32_t compare1

Sets the value for the buffered Compare 0.

bool enableCompareSwap

If enabled, the compare values are swapped on the terminal count.

uint32_t interruptSources

Enables an interrupt on the terminal count, capture or compare.

See Interrupt Sources

uint32_t invertPWMOut

Inverts the PWM output.

uint32_t invertPWMOutN

Inverts the PWM_n output.

uint32_t killMode

Configures the PWM kill modes.

See PWM kill modes

uint32_t swapInputMode

Configures how the swap input behaves.

See Input Modes

uint32_t swapInput

Selects which input the swap uses.

Inputs are device-specific. See TCPWM Input Selection

uint32_t reloadInputMode

Configures how the reload input behaves.

See Input Modes

uint32_t reloadInput

Selects which input the reload uses.

The inputs are device-specific. See TCPWM Input Selection

uint32_t startInputMode

Configures how the start input behaves.

See Input Modes

uint32_t startInput

Selects which input the start uses.

The inputs are device-specific. See TCPWM Input Selection

uint32_t killInputMode

Configures how the kill input behaves.

See Input Modes

uint32_t killInput

Selects which input the kill uses.

The inputs are device-specific. See TCPWM Input Selection

uint32_t countInputMode

Configures how the count input behaves.

See Input Modes

uint32_t countInput

Selects which input the count uses.

The inputs are device-specific. See TCPWM Input Selection

bool swapOverflowUnderflow

If enabled, line output is set on underflow and cleared on overflow.

This configuration is available only in center and asymmetric alignment modes.