MTB CAT5 Peripheral driver library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions

General Description

Functions

cy_en_tcpwm_status_t Cy_TCPWM_PWM_Init (TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_pwm_config_t const *config)
 
void Cy_TCPWM_PWM_DeInit (TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_pwm_config_t const *config)
 
__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, BOOL8 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, BOOL8 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_n. 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, BOOL8 enable)
 Enables the comparison swap of compare1 and compareBuf1 on OV and/or UN, depending on the PWM alignment. More...
 

Function Documentation

__STATIC_INLINE void Cy_TCPWM_PWM_Enable ( TCPWM_Type base,
uint32_t  cntNum 
)

Enables the counter in the TCPWM block for the PWM operation.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Function Usage
__STATIC_INLINE void Cy_TCPWM_PWM_Disable ( TCPWM_Type base,
uint32_t  cntNum 
)

Disables the counter in the TCPWM block.

Note
This function sets connected PWM output pins Drive modes to High-Z state. To disable PWM without changing pins drive modes, use the Cy_TCPWM_TriggerStopOrKill or Cy_TCPWM_TriggerStopOrKill_Single function.
Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Function Usage
__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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
The status. See PWM Status
Function Usage
__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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
compare0The Compare 0 value.
Function Usage
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCompare0Val ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns compare 0 value.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
Compare 0 value.
Function Usage
__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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
compareBuf0The buffered Compare 0 value.
Function Usage
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCompare0BufVal ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns the buffered compare 0 value.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
Buffered compare 0 value.
Function Usage
__STATIC_INLINE void Cy_TCPWM_PWM_EnableCompare0Swap ( TCPWM_Type base,
uint32_t  cntNum,
BOOL8  enable 
)

Enables the comparison swap of compare 0 and compareBuf 0 on OV and/or UN, depending on the PWM alignment.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
enableTRUE = swap enabled; FALSE = swap disabled
Function Usage
__STATIC_INLINE void Cy_TCPWM_PWM_SetCounter ( TCPWM_Type base,
uint32_t  cntNum,
uint32_t  count 
)

Sets the value of the counter.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
countThe value to write into the counter.
Function Usage
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCounter ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns the value in the counter.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
The current counter value.
Function Usage
__STATIC_INLINE void Cy_TCPWM_PWM_SetPeriod0 ( TCPWM_Type base,
uint32_t  cntNum,
uint32_t  period0 
)

Sets the value of the period register.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
period0The value to write into a period.
Function Usage
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetPeriod0 ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns the value in the period register.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
The current period value.
Function Usage
__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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
period1The value to write into a period 1.
Function Usage
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetPeriod1 ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns the value in the period register.

Parameters
baseThe pointer to a COUNTER PWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
The current period value.
Function Usage
__STATIC_INLINE void Cy_TCPWM_PWM_EnablePeriodSwap ( TCPWM_Type base,
uint32_t  cntNum,
BOOL8  enable 
)

Enables a period swap on OV and/or UN, depending on the PWM alignment.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
enableTRUE = swap enabled; FALSE = swap disabled
Function Usage
__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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
The dead time counter.
Function Usage
Note
supported only in TCPWM_ver2
__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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
pwmOutSelectDefines which pwm output line is being checked pwm or pwm_n.
Returns
The current pwm output line level.
Function Usage
Note
supported only in TCPWM_ver2
__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 between PWM_n (line_compl) going LOW and PWM (line) going HIGH.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
deadTimeThe dead time value.
Function Usage
__STATIC_INLINE void Cy_TCPWM_PWM_PWMDeadTimeN ( TCPWM_Type const *  base,
uint32_t  cntNum,
uint32_t  deadTime 
)

Writes the dead time value for PWM_n.

This is the number of clock cycles between PWM (line) going LOW and PWM_n (line_compl) going HIGH.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
deadTimeThe dead time value.
Function Usage
__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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
compare1The Compare1 value.
__STATIC_INLINE uint32_t Cy_TCPWM_PWM_GetCompare1Val ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns compare 1 value.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
Compare 1 value.
__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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
compareBuf1The 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.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
Buffered compare 1 value.
__STATIC_INLINE void Cy_TCPWM_PWM_EnableCompare1Swap ( TCPWM_Type base,
uint32_t  cntNum,
BOOL8  enable 
)

Enables the comparison swap of compare1 and compareBuf1 on OV and/or UN, depending on the PWM alignment.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
enableTRUE = swap enabled; FALSE = swap disabled