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

General Description

Functions

__STATIC_INLINE void Cy_TCPWM_Enable_Multiple (TCPWM_Type *base, uint32_t counters)
 Enables the counter(s) in the TCPWM block. More...
 
__STATIC_INLINE void Cy_TCPWM_Disable_Multiple (TCPWM_Type *base, uint32_t counters)
 Disables the counter(s) in the TCPWM block. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerStart (TCPWM_Type *base, uint32_t counters)
 Triggers a software start on the selected TCPWMs. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerReloadOrIndex (TCPWM_Type *base, uint32_t counters)
 Triggers a software reload event (or index in QuadDec mode). More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerStopOrKill (TCPWM_Type *base, uint32_t counters)
 Triggers a stop in the Timer Counter mode, or a kill in the PWM mode. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerCaptureOrSwap (TCPWM_Type *base, uint32_t counters)
 Triggers a Capture in the Timer Counter mode, and a Swap in the PWM mode. More...
 
__STATIC_INLINE void Cy_TCPWM_Enable_Single (TCPWM_Type *base, uint32_t cntNum)
 Enables specified counter. More...
 
__STATIC_INLINE void Cy_TCPWM_Disable_Single (TCPWM_Type *base, uint32_t cntNum)
 Disable specified counter. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_GetInterruptStatus (TCPWM_Type const *base, uint32_t cntNum)
 Returns which event triggered the interrupt. More...
 
__STATIC_INLINE void Cy_TCPWM_ClearInterrupt (TCPWM_Type *base, uint32_t cntNum, uint32_t source)
 Clears Active Interrupt Source. More...
 
__STATIC_INLINE void Cy_TCPWM_SetInterrupt (TCPWM_Type *base, uint32_t cntNum, uint32_t source)
 Triggers an interrupt via a software write. More...
 
__STATIC_INLINE void Cy_TCPWM_SetInterruptMask (TCPWM_Type *base, uint32_t cntNum, uint32_t mask)
 Sets an interrupt mask. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_GetInterruptMask (TCPWM_Type const *base, uint32_t cntNum)
 Returns the interrupt mask. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_GetInterruptStatusMasked (TCPWM_Type const *base, uint32_t cntNum)
 Returns which masked interrupt triggered the interrupt. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerStart_Single (TCPWM_Type *base, uint32_t cntNum)
 Triggers a software start on the selected TCPWM. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerReloadOrIndex_Single (TCPWM_Type *base, uint32_t cntNum)
 Triggers a software reload event (or index 0 in QuadDec mode) on selected TCPWM. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerStopOrKill_Single (TCPWM_Type *base, uint32_t cntNum)
 Triggers a stop in the Timer Counter mode, or a kill in the PWM mode on selected TCPWM. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerCaptureOrSwap_Single (TCPWM_Type *base, uint32_t cntNum)
 Triggers a Capture 0 in the Timer Counter mode, and a Swap in the PWM mode on selected TCPWM. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerCapture0 (TCPWM_Type *base, uint32_t cntNum)
 Triggers a Capture 0 on the selected counter. More...
 
__STATIC_INLINE void Cy_TCPWM_TriggerCapture1 (TCPWM_Type *base, uint32_t cntNum)
 Triggers a Capture 1 in Timer Counter and QuadDec Mode. More...
 
__STATIC_INLINE BOOL8 Cy_TCPWM_GetTrigPinLevel (TCPWM_Type const *base, uint32_t cntNum, cy_en_tcpwm_trigselect_t triggerSelect)
 Returns the current level of the selected input trigger. More...
 
__STATIC_INLINE void Cy_TCPWM_InputTriggerSetup (TCPWM_Type *base, uint32 cntNum, cy_en_tcpwm_trigselect_t triggerSelect, uint32_t edgeSelect, uint32_t triggerSignal)
 Sets up a trigger input signal for a specific TCPWM counter. More...
 
__STATIC_INLINE
cy_en_tcpwm_status_t 
Cy_TCPWM_SetDebugFreeze (TCPWM_Type *base, uint32 cntNum, BOOL8 enable)
 Enables/disables the Debug Freeze feature for the specified counter. More...
 

Function Documentation

__STATIC_INLINE void Cy_TCPWM_Enable_Multiple ( TCPWM_Type base,
uint32_t  counters 
)

Enables the counter(s) in the TCPWM block.

Multiple blocks can be started simultaneously.

Parameters
baseThe pointer to a TCPWM instance.
countersA bit field representing each counter in the TCPWM block.
Function Usage
Note
supported only in TCPWM_ver1
__STATIC_INLINE void Cy_TCPWM_Disable_Multiple ( TCPWM_Type base,
uint32_t  counters 
)

Disables the counter(s) in the TCPWM block.

Multiple TCPWM can be disabled simultaneously.

Parameters
baseThe pointer to a TCPWM instance.
countersA bit field representing each counter in the TCPWM block.
Function Usage
Note
supported only in TCPWM_ver1
__STATIC_INLINE void Cy_TCPWM_TriggerStart ( TCPWM_Type base,
uint32_t  counters 
)

Triggers a software start on the selected TCPWMs.

Parameters
baseThe pointer to a TCPWM instance.
countersA bit field representing each counter in the TCPWM block.
Function Usage
Note
supported only in TCPWM_ver1
__STATIC_INLINE void Cy_TCPWM_TriggerReloadOrIndex ( TCPWM_Type base,
uint32_t  counters 
)

Triggers a software reload event (or index in QuadDec mode).

Parameters
baseThe pointer to a TCPWM instance
countersA bit field representing each counter in the TCPWM block.
Function Usage
Note
supported only in TCPWM_ver1
__STATIC_INLINE void Cy_TCPWM_TriggerStopOrKill ( TCPWM_Type base,
uint32_t  counters 
)

Triggers a stop in the Timer Counter mode, or a kill in the PWM mode.

Note
The kill trigger behavior for PWM is defined by the cy_stc_tcpwm_pwm_config_t::killMode field. The pins states after a kill trigger are defined by cy_stc_tcpwm_pwm_config_t::invertPWMOut and cy_stc_tcpwm_pwm_config_t::invertPWMOutN fields.
Parameters
baseThe pointer to a TCPWM instance.
countersA bit field representing each counter in the TCPWM block.
Function Usage
Note
supported only in TCPWM_ver1
__STATIC_INLINE void Cy_TCPWM_TriggerCaptureOrSwap ( TCPWM_Type base,
uint32_t  counters 
)

Triggers a Capture in the Timer Counter mode, and a Swap in the PWM mode.

Parameters
baseThe pointer to a TCPWM instance.
countersA bit field representing each counter in the TCPWM block.
Function Usage
Note
supported only in TCPWM_ver1
__STATIC_INLINE void Cy_TCPWM_Enable_Single ( TCPWM_Type base,
uint32_t  cntNum 
)

Enables specified counter.

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

Disable specified counter.

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

Returns which event triggered the interrupt.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
See Interrupt Sources
Function Usage
__STATIC_INLINE void Cy_TCPWM_ClearInterrupt ( TCPWM_Type base,
uint32_t  cntNum,
uint32_t  source 
)

Clears Active Interrupt Source.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
sourcesource to clear. See Interrupt Sources
Function Usage
__STATIC_INLINE void Cy_TCPWM_SetInterrupt ( TCPWM_Type base,
uint32_t  cntNum,
uint32_t  source 
)

Triggers an interrupt via a software write.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
sourceThe source to set an interrupt. See Interrupt Sources.
Function Usage
__STATIC_INLINE void Cy_TCPWM_SetInterruptMask ( TCPWM_Type base,
uint32_t  cntNum,
uint32_t  mask 
)

Sets an interrupt mask.

A 1 means that when the event occurs, it will cause an interrupt; a 0 means no interrupt will be triggered.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
mask. See Interrupt Sources
Function Usage
__STATIC_INLINE uint32_t Cy_TCPWM_GetInterruptMask ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns the interrupt mask.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
Interrupt Mask. See Interrupt Sources
Function Usage
__STATIC_INLINE uint32_t Cy_TCPWM_GetInterruptStatusMasked ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns which masked interrupt triggered the interrupt.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
Interrupt Mask. See Interrupt Sources
Function Usage
__STATIC_INLINE void Cy_TCPWM_TriggerStart_Single ( TCPWM_Type base,
uint32_t  cntNum 
)

Triggers a software start on the selected TCPWM.

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

Triggers a software reload event (or index 0 in QuadDec mode) on selected TCPWM.

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

Triggers a stop in the Timer Counter mode, or a kill in the PWM mode on selected TCPWM.

Note
The kill trigger behavior for PWM is defined by the cy_stc_tcpwm_pwm_config_t::killMode field. The pins states after a kill trigger are defined by cy_stc_tcpwm_pwm_config_t::invertPWMOut and cy_stc_tcpwm_pwm_config_t::invertPWMOutN fields.
Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
__STATIC_INLINE void Cy_TCPWM_TriggerCaptureOrSwap_Single ( TCPWM_Type base,
uint32_t  cntNum 
)

Triggers a Capture 0 in the Timer Counter mode, and a Swap in the PWM mode on selected TCPWM.

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

Triggers a Capture 0 on the selected counter.

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

Triggers a Capture 1 in Timer Counter and QuadDec Mode.

In PWM mode this acts as a second kill input.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
__STATIC_INLINE BOOL8 Cy_TCPWM_GetTrigPinLevel ( TCPWM_Type const *  base,
uint32_t  cntNum,
cy_en_tcpwm_trigselect_t  triggerSelect 
)

Returns the current level of the selected input trigger.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
triggerSelectDefines which trigger status is being checked, Start, Reload, Stop/Kill, Count, Capture 0 or Capture 1
Returns
The trigger level
Function Usage
__STATIC_INLINE void Cy_TCPWM_InputTriggerSetup ( TCPWM_Type base,
uint32  cntNum,
cy_en_tcpwm_trigselect_t  triggerSelect,
uint32_t  edgeSelect,
uint32_t  triggerSignal 
)

Sets up a trigger input signal for a specific TCPWM counter.

This API is used to handle software triggering of multiple counters synchronously.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
triggerSelectDefines which trigger is being setup, Start, Reload, Stop/Kill, Count, Capture 0 or Capture 1 see cy_en_tcpwm_trigselect_t
edgeSelectSets the trigger edge detection, Rising, Falling, Both, No edge detect. see Input Modes
triggerSignalSelects what trigger signal is connected to the selected input trigger.
Function Usage
__STATIC_INLINE cy_en_tcpwm_status_t Cy_TCPWM_SetDebugFreeze ( TCPWM_Type base,
uint32  cntNum,
BOOL8  enable 
)

Enables/disables the Debug Freeze feature for the specified counter.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
enableTRUE: The Debug Free feature is enabled FALSE: The Debug Freeze feature is disabled
Returns
Error / Status code. See cy_en_tcpwm_status_t.
Function Usage