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. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetCompare0 (TCPWM_Type *base, uint32_t cntNum, uint32_t compare0) |
Sets the compare value for Compare0 when the compare mode enabled. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetCompare0 (TCPWM_Type const *base, uint32_t cntNum) |
Returns compare value 0. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_SetCompare1 (TCPWM_Type *base, uint32_t cntNum, uint32_t compare1) |
Sets the compare value for Compare1 when the compare mode is enabled. More... | |
__STATIC_INLINE uint32_t | Cy_TCPWM_PWM_GetCompare1 (TCPWM_Type const *base, uint32_t cntNum) |
Returns compare value 1. More... | |
__STATIC_INLINE void | Cy_TCPWM_PWM_EnableCompareSwap (TCPWM_Type *base, uint32_t cntNum, bool enable) |
Enables the comparison swap 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... | |
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.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetCompare0 | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | compare0 | ||
) |
Sets the compare value for Compare0 when the compare mode enabled.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
compare0 | The Compare0 value. |
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCompare0 | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns compare value 0.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_SetCompare1 | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
uint32_t | compare1 | ||
) |
Sets the compare value for Compare1 when the compare mode is 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_GetCompare1 | ( | TCPWM_Type const * | base, |
uint32_t | cntNum | ||
) |
Returns compare value 1.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
__STATIC_INLINE void Cy_TCPWM_PWM_EnableCompareSwap | ( | TCPWM_Type * | base, |
uint32_t | cntNum, | ||
bool | enable | ||
) |
Enables the comparison 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_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.
base | The pointer to a TCPWM instance. |
cntNum | The Counter instance number in the selected TCPWM. |
period1 | The value to write into a period1. |
__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 |