Functions | |
cy_en_tcpwm_status_t | Cy_TCPWM_PWM_Init (TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_pwm_config_t const *config) |
Initializes the counter in the TCPWM block for the PWM operation. More... | |
void | Cy_TCPWM_PWM_DeInit (TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_pwm_config_t const *config) |
De-initializes the counter in the TCPWM block, returns register values to default. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_Enable (TCPWM_Type *base, uint32_t cntNum) |
Enables the counter in the TCPWM block for the PWM operation. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_Disable (TCPWM_Type *base, uint32_t cntNum) |
Disables the counter in the TCPWM block. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetStatus (TCPWM_Type const *base, uint32_t cntNum) |
Returns the status of the PWM whether it is running or not. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetCompare0Val (TCPWM_Type *base, uint32_t cntNum, uint32_t compare0) |
Sets the compare value for Compare 0 when the compare mode enabled. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetCompare0Val (TCPWM_Type const *base, uint32_t cntNum) |
Returns compare 0 value. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetCompare0BufVal (TCPWM_Type *base, uint32_t cntNum, uint32_t compareBuf0) |
Sets the buffered compare value for Compare 0 when the compare mode enabled. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetCompare0BufVal (TCPWM_Type const *base, uint32_t cntNum) |
Returns the buffered compare 0 value. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_EnableCompare0Swap (TCPWM_Type *base, uint32_t cntNum, bool enable) |
Enables the comparison swap of compare 0 and compareBuf 0 on OV and/or UN, depending on the PWM alignment. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetCounter (TCPWM_Type *base, uint32_t cntNum, uint32_t count) |
Sets the value of the counter. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetCounter (TCPWM_Type const *base, uint32_t cntNum) |
Returns the value in the counter. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetPeriod0 (TCPWM_Type *base, uint32_t cntNum, uint32_t period0) |
Sets the value of the period register. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetPeriod0 (TCPWM_Type const *base, uint32_t cntNum) |
Returns the value in the period register. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetPeriod1 (TCPWM_Type *base, uint32_t cntNum, uint32_t period1) |
Sets the value of the period register. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetPeriod1 (TCPWM_Type const *base, uint32_t cntNum) |
Returns the value in the period register. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_EnablePeriodSwap (TCPWM_Type *base, uint32_t cntNum, bool enable) |
Enables a period swap on OV and/or UN, depending on the PWM alignment. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetDtCounter (TCPWM_Type const *base, uint32_t cntNum) |
Returns the dead time count when the PWM is configured in dead time mode. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_LineOutStatus (TCPWM_Type const *base, uint32_t cntNum, uint32_t pwmOutSelect) |
Returns the current level of the selected pwm output line. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_PWMDeadTime (TCPWM_Type const *base, uint32_t cntNum, uint32_t deadTime) |
Writes the dead time value for PWM. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_PWMDeadTimeN (TCPWM_Type const *base, uint32_t cntNum, uint32_t deadTime) |
Writes the dead time value for PWM. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_Configure_LineSelect (TCPWM_Type *base, uint32_t cntNum, cy_en_line_select_config_t line_out_val, cy_en_line_select_config_t line_compl_value) |
Configures the source for the output signal "line_out" and "line_compl_out". More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_Configure_LineSelectBuff (TCPWM_Type *base, uint32_t cntNum, cy_en_line_select_config_t line_out_val, cy_en_line_select_config_t line_compl_value) |
Buffer for LINE SELCT. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_EnableLineSelectSwap (TCPWM_Type *base, uint32_t cntNum, bool enable) |
Enables a Line Select swap on OV and/or UN, depending on the PWM alignment. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetDT (TCPWM_Type const *base, uint32_t cntNum, uint32_t deadTime) |
Writes the dead time value for PWM. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_EnableSwap (TCPWM_Type *base, uint32_t cntNum, bool enable) |
Enables/disables swapping mechanism between CC0 and buffered CC0, CC1 and buffered CC1, PERIOD and buffered PERIOD, DT and buffered DT. More... | |
cy_en_tcpwm_status_t | Cy_TCPWM_PWM_Configure_Dithering (TCPWM_Type *base, uint32_t cntNum, cy_en_tcpwm_dithering_t mode, uint8_t period, uint8_t duty, cy_en_dithering_limiter_t limiter) |
configures dithering. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_PWMDeadTimeBuff (TCPWM_Type const *base, uint32_t cntNum, uint32_t deadTime) |
Writes the dead time buffered value for PWM. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_PWMDeadTimeBuffN (TCPWM_Type const *base, uint32_t cntNum, uint32_t deadTime) |
Writes the dead time buffered value for PWM. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetDTBuff (TCPWM_Type const *base, uint32_t cntNum, uint32_t deadTime) |
Writes the dead time buffered value for PWM. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetCompare1Val (TCPWM_Type *base, uint32_t cntNum, uint32_t compare1) |
Sets the compare value for Compare 1 when the compare mode enabled. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetCompare1Val (TCPWM_Type const *base, uint32_t cntNum) |
Returns compare 1 value. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetCompare1BufVal (TCPWM_Type *base, uint32_t cntNum, uint32_t compareBuf1) |
Sets the buffered compare value for Compare1 when the compare mode enabled. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetCompare1BufVal (TCPWM_Type const *base, uint32_t cntNum) |
Returns the buffered compare 1 value. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_EnableCompare1Swap (TCPWM_Type *base, uint32_t cntNum, bool enable) |
Enables the comparison swap of compare1 and compareBuf1 on OV and/or UN, depending on the PWM alignment. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_Set_KillLinePolarity (TCPWM_Type *base, uint32_t cntNum, cy_en_kill_line_polarity_t kill_line_polarity) |
Configures the source for the output signal "line_out" and "line_compl_out". More... | |
cy_en_tcpwm_status_t Cy_TCPWM_PWM_Init | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
cy_stc_tcpwm_pwm_config_t const * | config | ||
) |
Initializes the counter in the TCPWM block for the PWM operation.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
config | The pointer to a configuration structure. See cy_stc_tcpwm_pwm_config_t. |
void Cy_TCPWM_PWM_DeInit | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
cy_stc_tcpwm_pwm_config_t const * | config | ||
) |
De-initializes the counter in the TCPWM block, returns register values to default.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
config | The pointer to a configuration structure. See cy_stc_tcpwm_pwm_config_t. |
__STATIC_INLINE void Cy_TCPWM_PWM_Enable | ( | TCPWM_Type * | base, |
uint32_t | cntNum | ||
) |
Enables the counter in the TCPWM block for the PWM operation.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_Disable | ( | TCPWM_Type * | base, |
uint32_t | cntNum | ||
) |
Disables the counter in the TCPWM block.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetStatus | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns the status of the PWM whether it is running or not.
In case the PWM is running, status will also provide information on counting up/down. This is useful when the PWM Alignment mode set to Center/Asymmetric Alignments.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetCompare0Val | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | compare0 | ||
) |
Sets the compare value for Compare 0 when the compare mode enabled.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
compare0 | The Compare 0 value. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCompare0Val | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns compare 0 value.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetCompare0BufVal | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | compareBuf0 | ||
) |
Sets the buffered compare value for Compare 0 when the compare mode enabled.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
compareBuf0 | The buffered Compare 0 value. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCompare0BufVal | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns the buffered compare 0 value.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_EnableCompare0Swap | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
bool | enable | ||
) |
Enables the comparison swap of compare 0 and compareBuf 0 on OV and/or UN, depending on the PWM alignment.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
enable | true = swap enabled; false = swap disabled |
__STATIC_INLINE void Cy_TCPWM_PWM_SetCounter | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | count | ||
) |
Sets the value of the counter.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
count | The value to write into the counter. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCounter | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns the value in the counter.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetPeriod0 | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | period0 | ||
) |
Sets the value of the period register.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
period0 | The value to write into a period. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetPeriod0 | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns the value in the period register.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetPeriod1 | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | period1 | ||
) |
Sets the value of the period register.
In pseudo random mode period 1 sets which taps are enabled.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
period1 | The value to write into a period 1. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetPeriod1 | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns the value in the period register.
base | The pointer to a COUNTER PWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_EnablePeriodSwap | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
bool | enable | ||
) |
Enables a period swap on OV and/or UN, depending on the PWM alignment.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
enable | true = swap enabled; false = swap disabled |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetDtCounter | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns the dead time count when the PWM is configured in dead time mode.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_LineOutStatus | ( | TCPWM_Type const * | base, |
uint32_t | cntNum, | ||
uint32_t | pwmOutSelect | ||
) |
Returns the current level of the selected pwm output line.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
pwmOutSelect | Defines which pwm output line is being checked pwm or pwm_n. |
__STATIC_INLINE void Cy_TCPWM_PWM_PWMDeadTime | ( | TCPWM_Type const * | base, |
uint32_t | cntNum, | ||
uint32_t | deadTime | ||
) |
Writes the dead time value for PWM.
This is the number of clock cycles of dead time to activate Line Out
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
deadTime | The dead time value. |
__STATIC_INLINE void Cy_TCPWM_PWM_PWMDeadTimeN | ( | TCPWM_Type const * | base, |
uint32_t | cntNum, | ||
uint32_t | deadTime | ||
) |
Writes the dead time value for PWM.
This is the number of clock cycles of dead time to activate Line Compliment Out
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
deadTime | The dead time value. |
__STATIC_INLINE void Cy_TCPWM_PWM_Configure_LineSelect | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
cy_en_line_select_config_t | line_out_val, | ||
cy_en_line_select_config_t | line_compl_value | ||
) |
Configures the source for the output signal "line_out" and "line_compl_out".
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
line_out_val | Source for the lie out signal cy_en_line_select_config_t |
line_compl_value | Source for the lie compl out signal cy_en_line_select_config_t |
__STATIC_INLINE void Cy_TCPWM_PWM_Configure_LineSelectBuff | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
cy_en_line_select_config_t | line_out_val, | ||
cy_en_line_select_config_t | line_compl_value | ||
) |
Buffer for LINE SELCT.
Can be exchanged with Line Select values on a terminal count event with an actively pending switch event.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
line_out_val | Source for the lie out signal cy_en_line_select_config_t |
line_compl_value | Source for the lie compl out signal cy_en_line_select_config_t |
__STATIC_INLINE void Cy_TCPWM_PWM_EnableLineSelectSwap | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
bool | enable | ||
) |
Enables a Line Select swap on OV and/or UN, depending on the PWM alignment.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
enable | true = swap enabled; false = swap disabled |
__STATIC_INLINE void Cy_TCPWM_PWM_SetDT | ( | TCPWM_Type const * | base, |
uint32_t | cntNum, | ||
uint32_t | deadTime | ||
) |
Writes the dead time value for PWM.
This is the number of clock cycles of dead time to activate Line Out and Line Compliment Out
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
deadTime | The dead time value for both Line Out and Line Compliment Out. |
__STATIC_INLINE void Cy_TCPWM_PWM_EnableSwap | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
bool | enable | ||
) |
Enables/disables swapping mechanism between CC0 and buffered CC0, CC1 and buffered CC1, PERIOD and buffered PERIOD, DT and buffered DT.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
enable | true = swap enabled; false = swap disabled |
cy_en_tcpwm_status_t Cy_TCPWM_PWM_Configure_Dithering | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
cy_en_tcpwm_dithering_t | mode, | ||
uint8_t | period, | ||
uint8_t | duty, | ||
cy_en_dithering_limiter_t | limiter | ||
) |
configures dithering.
applicable only when GRP_DITHERING_PRESENT and in PWM and PWM_DT mode
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
mode | Dithering mode See cy_en_tcpwm_dithering_t . |
period | initial value for period LFSR. Should be non zero value. |
duty | Initial value for duty LFSR. Should be non zero value. |
limiter | Dithering limiter values. It defines the magnitude of the pseudo-random value to be added to period/CC0/CC1 cy_en_dithering_limiter_t |
__STATIC_INLINE void Cy_TCPWM_PWM_PWMDeadTimeBuff | ( | TCPWM_Type const * | base, |
uint32_t | cntNum, | ||
uint32_t | deadTime | ||
) |
Writes the dead time buffered value for PWM.
This is the number of clock cycles of dead time to activate Line Out Data from DT_BUFF will be shallow transferred to DT (when swap enable is disabled) on a terminal count event with an actively pending switch event.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
deadTime | The dead time value. |
__STATIC_INLINE void Cy_TCPWM_PWM_PWMDeadTimeBuffN | ( | TCPWM_Type const * | base, |
uint32_t | cntNum, | ||
uint32_t | deadTime | ||
) |
Writes the dead time buffered value for PWM.
This is the number of clock cycles of dead time to activate Line Compliment Out Data from DT_BUFF will be shallow transferred to DT (when swap enable is disabled) on a terminal count event with an actively pending switch event.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
deadTime | The dead time value. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetDTBuff | ( | TCPWM_Type const * | base, |
uint32_t | cntNum, | ||
uint32_t | deadTime | ||
) |
Writes the dead time buffered value for PWM.
This is the number of clock cycles of dead time to activate Line Out and Line Compliment Out Data from DT_BUFF will be shallow transferred to DT (when swap enable is disabled) on a terminal count event with an actively pending switch event.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
deadTime | The dead time value for both Line Out and Line Compliment Out. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetCompare1Val | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | compare1 | ||
) |
Sets the compare value for Compare 1 when the compare mode enabled.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
compare1 | The Compare1 value. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCompare1Val | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns compare 1 value.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetCompare1BufVal | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | compareBuf1 | ||
) |
Sets the buffered compare value for Compare1 when the compare mode enabled.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
compareBuf1 | The buffered Compare 1 value. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCompare1BufVal | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns the buffered compare 1 value.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_EnableCompare1Swap | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
bool | enable | ||
) |
Enables the comparison swap of compare1 and compareBuf1 on OV and/or UN, depending on the PWM alignment.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
enable | true = swap enabled; false = swap disabled |
__STATIC_INLINE void Cy_TCPWM_PWM_Set_KillLinePolarity | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
cy_en_kill_line_polarity_t | kill_line_polarity | ||
) |
Configures the source for the output signal "line_out" and "line_compl_out".
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
kill_line_polarity | Kill Line polarity value cy_en_kill_line_polarity_t |