MTB CAT1 Peripheral driver library

General Description

Functions

cy_en_tcpwm_status_t Cy_TCPWM_ShiftReg_Init (TCPWM_Type const *base, uint32_t cntNum, cy_stc_tcpwm_shiftreg_config_t const *config)
 Initializes the counter in the TCPWM block for the Shift Register operation. More...
 
void Cy_TCPWM_ShiftReg_DeInit (TCPWM_Type const *base, uint32_t cntNum, cy_stc_tcpwm_shiftreg_config_t const *config)
 De-initializes the counter in the TCPWM block, returns register values to default. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_Enable (TCPWM_Type *base, uint32_t cntNum)
 Enables the counter in the TCPWM block for the Shift Register operation. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_Disable (TCPWM_Type *base, uint32_t cntNum)
 Disables the counter in the TCPWM block. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_GetStatus (TCPWM_Type const *base, uint32_t cntNum)
 Returns the status of the Shift Register whether it is running or not. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_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_ShiftReg_GetCompare0Val (TCPWM_Type const *base, uint32_t cntNum)
 Returns compare 0 value. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_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_ShiftReg_GetCompare0BufVal (TCPWM_Type const *base, uint32_t cntNum)
 Returns the buffered compare 0 value. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_EnableCompare0Swap (TCPWM_Type *base, uint32_t cntNum, bool enable)
 Enables the comparison swap of compare 0 and compareBuf 0 on corresponding command or external trigger. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_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_ShiftReg_GetCompare1Val (TCPWM_Type const *base, uint32_t cntNum)
 Returns compare 1 value. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_SetCompare1BufVal (TCPWM_Type *base, uint32_t cntNum, uint32_t compareBuf1)
 Sets the buffered compare value for Compare 1 when the compare mode enabled. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_GetCompare1BufVal (TCPWM_Type const *base, uint32_t cntNum)
 Returns the buffered compare 1 value. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_EnableCompare1Swap (TCPWM_Type *base, uint32_t cntNum, bool enable)
 Enables the comparison swap of compare 1 and compareBuf 1 on corresponding command or external trigger. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_SetCounter (TCPWM_Type *base, uint32_t cntNum, uint32_t count)
 Sets the value of the counter. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_GetCounter (TCPWM_Type const *base, uint32_t cntNum)
 Returns the value in the counter. More...
 
__STATIC_INLINE void Cy_TCPWM_ShiftReg_SetTaps (TCPWM_Type *base, uint32_t cntNum, uint32_t taps)
 Sets which taps are enabled. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_GetTaps (TCPWM_Type const *base, uint32_t cntNum)
 Returns which taps are enabled. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_LineOutStatus (TCPWM_Type const *base, uint32_t cntNum, uint32_t shiftRegOutSelect)
 Returns the current level of the selected Shift Register output line. More...
 
__STATIC_INLINE void Cy_TCPWM_Shiftreg_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...
 

Function Documentation

◆ Cy_TCPWM_ShiftReg_Init()

cy_en_tcpwm_status_t Cy_TCPWM_ShiftReg_Init ( TCPWM_Type const *  base,
uint32_t  cntNum,
cy_stc_tcpwm_shiftreg_config_t const *  config 
)

Initializes the counter in the TCPWM block for the Shift Register operation.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
configThe pointer to a configuration structure. See cy_stc_tcpwm_shiftreg_config_t.
Returns
error / status code. See cy_en_tcpwm_status_t.
/* Scenario: Initialize the first (index = 0) of TCPWM 0 block
* as Shift Register with configuration settings
*/
{
/* .clockPrescaler = */CY_TCPWM_SHIFTREG_PRESCALER_DIVBY_1,
/* .tapsEnabled = */0x80000000UL,
/* .compare0 = */16384UL,
/* .compareBuf0 = */16384UL,
/* .enableCompare0Swap = */false,
/* .compare1 = */16384UL,
/* .compareBuf1 = */16384UL,
/* .enableCompare1Swap = */false,
/* .interruptSources = */CY_TCPWM_INT_ON_CC0, /* Interrupt will rise on CC0 Match*/
/* .invertShiftRegOut = */CY_TCPWM_SHIFTREG_INVERT_DISABLE, /* Not inverted */
/* .invertShiftRegOutN = */CY_TCPWM_SHIFTREG_INVERT_DISABLE, /* Not inverted */
/* .reloadInputMode = */CY_TCPWM_INPUT_LEVEL, /* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_LEVEL) */
/* .reloadInput = */CY_TCPWM_INPUT_0,
/* .startInputMode = */CY_TCPWM_INPUT_LEVEL, /* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_LEVEL) */
/* .startInput = */CY_TCPWM_INPUT_0,
/* .killInputMode = */CY_TCPWM_INPUT_LEVEL, /* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_LEVEL) */
/* .killInput = */CY_TCPWM_INPUT_0,
/* .shiftInputMode = */CY_TCPWM_INPUT_LEVEL, /* Set this input to LEVEL and 1 (high logic level) */
/* .shiftInput = */CY_TCPWM_INPUT_1, /* Shift Register will run forever */
/* .serialInputMode = */CY_TCPWM_INPUT_LEVEL, /* This input is NOT used, leave it in default state (CY_TCPWM_INPUT_LEVEL) */
/* .serialInput = */CY_TCPWM_INPUT_0,
/* .shiftRegOnDisable = */CY_TCPWM_SHIFTREG_OUTPUT_HIGHZ, /* Default High impedance mode*/
/* .trigger0Event = */CY_TCPWM_CNT_TRIGGER_ON_DISABLED, /* Disable output trigger0 event generation*/
/* .trigger1Event = */CY_TCPWM_CNT_TRIGGER_ON_DISABLED, /* Disable output trigger1 event generation*/
};
#define MY_TCPWM_SHIFTREG_NUM (0UL)
if (CY_TCPWM_SUCCESS != Cy_TCPWM_ShiftReg_Init(TCPWM0, MY_TCPWM_SHIFTREG_NUM, &shiftreg_config))
{
/* Handle possible errors */
}

◆ Cy_TCPWM_ShiftReg_DeInit()

void Cy_TCPWM_ShiftReg_DeInit ( TCPWM_Type const *  base,
uint32_t  cntNum,
cy_stc_tcpwm_shiftreg_config_t const *  config 
)

De-initializes the counter in the TCPWM block, returns register values to default.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
configThe pointer to a configuration structure. See cy_stc_tcpwm_shiftreg_config_t.
/* Scenario: there is need to deinitialize the previously initialized shift register */
#define MY_TCPWM_SHIFTREG_NUM (0UL)
/* Disable the shift register prior to deinitializing */
Cy_TCPWM_ShiftReg_Disable(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
Cy_TCPWM_ShiftReg_DeInit(TCPWM0, MY_TCPWM_SHIFTREG_NUM, &config);

◆ Cy_TCPWM_ShiftReg_Enable()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_Enable ( TCPWM_Type base,
uint32_t  cntNum 
)

Enables the counter in the TCPWM block for the Shift Register operation.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
/* Scenario: Enable Shift Register */
#define MY_TCPWM_SHIFTREG_NUM (0UL)
Cy_TCPWM_ShiftReg_Enable(TCPWM0, MY_TCPWM_SHIFTREG_NUM);

◆ Cy_TCPWM_ShiftReg_Disable()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_Disable ( TCPWM_Type base,
uint32_t  cntNum 
)

Disables the counter in the TCPWM block.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
/* Scenario: Disable Shift Register */
#define MY_TCPWM_SHIFTREG_NUM (0UL)
Cy_TCPWM_ShiftReg_Disable(TCPWM0, MY_TCPWM_SHIFTREG_NUM);

◆ Cy_TCPWM_ShiftReg_GetStatus()

__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_GetStatus ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns the status of the Shift Register whether it is running or not.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
The status. See Shift Register Status
/* Scenario: there is a need to check if
* the first (index = 0) Shift Register of the TCPWM0 block is running or not.
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
Cy_TCPWM_ShiftReg_GetStatus(TCPWM0, MY_TCPWM_SHIFTREG_NUM)))
{
/* Shift Register is running */
}

◆ Cy_TCPWM_ShiftReg_SetCompare0Val()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_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.
/* Scenario: there is a need to set the Compare 0 value of
* the first (index = 0) Shift Register of the TCPWM0 block.
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
/* Get the currently existing compare value */
uint32_t compare = Cy_TCPWM_ShiftReg_GetCompare0Val(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
/* Modify the compare value here */
Cy_TCPWM_ShiftReg_SetCompare0Val(TCPWM0, MY_TCPWM_SHIFTREG_NUM, compare);

◆ Cy_TCPWM_ShiftReg_GetCompare0Val()

__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_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.
/* Scenario: there is a need to set the Compare 0 value of
* the first (index = 0) Shift Register of the TCPWM0 block.
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
/* Get the currently existing compare value */
uint32_t compare = Cy_TCPWM_ShiftReg_GetCompare0Val(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
/* Modify the compare value here */
Cy_TCPWM_ShiftReg_SetCompare0Val(TCPWM0, MY_TCPWM_SHIFTREG_NUM, compare);

◆ Cy_TCPWM_ShiftReg_SetCompare0BufVal()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_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.
/* Scenario: there is a need to modify buffered compare 0 value
* for the first (index = 0) Shift Register of the TCPWM0 block.
* Note: the compare swapping feature should be enabled.
* This can be used to change the compare value on the fly without a
* modification of the compare value itself.
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
/* Get the currently existing compare value */
uint32_t compare = Cy_TCPWM_ShiftReg_GetCompare0BufVal(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
/* Modify the compare value here */
Cy_TCPWM_ShiftReg_SetCompare0BufVal(TCPWM0, MY_TCPWM_SHIFTREG_NUM, compare);
/* Now the compare 0 and buffered compare 0 values can be swapped using either HW input or Cy_TCPWM_TriggerCaptureOrSwap_Single */

◆ Cy_TCPWM_ShiftReg_GetCompare0BufVal()

__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_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.
/* Scenario: there is a need to modify buffered compare 0 value
* for the first (index = 0) Shift Register of the TCPWM0 block.
* Note: the compare swapping feature should be enabled.
* This can be used to change the compare value on the fly without a
* modification of the compare value itself.
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
/* Get the currently existing compare value */
uint32_t compare = Cy_TCPWM_ShiftReg_GetCompare0BufVal(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
/* Modify the compare value here */
Cy_TCPWM_ShiftReg_SetCompare0BufVal(TCPWM0, MY_TCPWM_SHIFTREG_NUM, compare);
/* Now the compare 0 and buffered compare 0 values can be swapped using either HW input or Cy_TCPWM_TriggerCaptureOrSwap_Single */

◆ Cy_TCPWM_ShiftReg_EnableCompare0Swap()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_EnableCompare0Swap ( TCPWM_Type base,
uint32_t  cntNum,
bool  enable 
)

Enables the comparison swap of compare 0 and compareBuf 0 on corresponding command or external trigger.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
enabletrue = swap enabled; false = swap disabled
/* Scenario: There is a need to enable the compare swapping feature for
* the first (index = 0) Shift Register of the TCPWM0 block
* This can be used to change the compare value on the fly without a
* modification of the compare value itself.
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
Cy_TCPWM_ShiftReg_EnableCompare0Swap(TCPWM0, MY_TCPWM_SHIFTREG_NUM, true);
/* Now the compare 0 and 1 values can be swapped using either HW input or Cy_TCPWM_TriggerCaptureOrSwap_Single */

◆ Cy_TCPWM_ShiftReg_SetCompare1Val()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_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 Compare 1 value.

◆ Cy_TCPWM_ShiftReg_GetCompare1Val()

__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_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.

◆ Cy_TCPWM_ShiftReg_SetCompare1BufVal()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_SetCompare1BufVal ( TCPWM_Type base,
uint32_t  cntNum,
uint32_t  compareBuf1 
)

Sets the buffered 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.
compareBuf1The buffered Compare 1 value.

◆ Cy_TCPWM_ShiftReg_GetCompare1BufVal()

__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_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.

◆ Cy_TCPWM_ShiftReg_EnableCompare1Swap()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_EnableCompare1Swap ( TCPWM_Type base,
uint32_t  cntNum,
bool  enable 
)

Enables the comparison swap of compare 1 and compareBuf 1 on corresponding command or external trigger.

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

◆ Cy_TCPWM_ShiftReg_SetCounter()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_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.
/* Scenario: there is a need to set the counter value for
* the first (index = 0) counter of the TCPWM0 block
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
#define MY_TCPWM_SHIFTREG_MASK (1UL << MY_TCPWM_SHIFTREG_NUM)
#define MY_TCPWM_SHIFTREG_VAL (100UL)
uint32_t count;
Cy_TCPWM_TriggerStopOrKill_Single(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
Cy_TCPWM_ShiftReg_SetCounter(TCPWM0, MY_TCPWM_SHIFTREG_NUM, MY_TCPWM_SHIFTREG_VAL);
count = Cy_TCPWM_ShiftReg_GetCounter(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
if( count == MY_TCPWM_SHIFTREG_VAL)
{
/* Counter value is set correctly */
}
Cy_TCPWM_TriggerStart_Single(TCPWM0, MY_TCPWM_SHIFTREG_NUM);

◆ Cy_TCPWM_ShiftReg_GetCounter()

__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_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.
/* Scenario: there is a need to set the counter value for
* the first (index = 0) counter of the TCPWM0 block
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
#define MY_TCPWM_SHIFTREG_MASK (1UL << MY_TCPWM_SHIFTREG_NUM)
#define MY_TCPWM_SHIFTREG_VAL (100UL)
uint32_t count;
Cy_TCPWM_TriggerStopOrKill_Single(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
Cy_TCPWM_ShiftReg_SetCounter(TCPWM0, MY_TCPWM_SHIFTREG_NUM, MY_TCPWM_SHIFTREG_VAL);
count = Cy_TCPWM_ShiftReg_GetCounter(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
if( count == MY_TCPWM_SHIFTREG_VAL)
{
/* Counter value is set correctly */
}
Cy_TCPWM_TriggerStart_Single(TCPWM0, MY_TCPWM_SHIFTREG_NUM);

◆ Cy_TCPWM_ShiftReg_SetTaps()

__STATIC_INLINE void Cy_TCPWM_ShiftReg_SetTaps ( TCPWM_Type base,
uint32_t  cntNum,
uint32_t  taps 
)

Sets which taps are enabled.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
tapsThe taps that will be enabled.
/* Scenario: there is a need to set the taps value for
* the first (index = 0) counter of the TCPWM0 block
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
#define MY_TCPWM_SHIFTREG_MASK (1UL << MY_TCPWM_SHIFTREG_NUM)
#define MY_TCPWM_SHIFTREG_TAPS (1UL)
uint32_t tapsEnabled;
Cy_TCPWM_TriggerStopOrKill_Single(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
Cy_TCPWM_ShiftReg_SetTaps(TCPWM0, MY_TCPWM_SHIFTREG_NUM, MY_TCPWM_SHIFTREG_VAL);
tapsEnabled = Cy_TCPWM_ShiftReg_GetTaps(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
if( tapsEnabled == MY_TCPWM_SHIFTREG_TAPS)
{
/* taps value is set correctly */
}
Cy_TCPWM_TriggerStart_Single(TCPWM0, MY_TCPWM_SHIFTREG_NUM);

◆ Cy_TCPWM_ShiftReg_GetTaps()

__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_GetTaps ( TCPWM_Type const *  base,
uint32_t  cntNum 
)

Returns which taps are enabled.

Parameters
baseThe pointer to a COUNTER PWM instance.
cntNumThe Counter instance number in the selected TCPWM.
Returns
Returns which taps are enabled.
/* Scenario: there is a need to set the taps value for
* the first (index = 0) counter of the TCPWM0 block
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
#define MY_TCPWM_SHIFTREG_MASK (1UL << MY_TCPWM_SHIFTREG_NUM)
#define MY_TCPWM_SHIFTREG_TAPS (1UL)
uint32_t tapsEnabled;
Cy_TCPWM_TriggerStopOrKill_Single(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
Cy_TCPWM_ShiftReg_SetTaps(TCPWM0, MY_TCPWM_SHIFTREG_NUM, MY_TCPWM_SHIFTREG_VAL);
tapsEnabled = Cy_TCPWM_ShiftReg_GetTaps(TCPWM0, MY_TCPWM_SHIFTREG_NUM);
if( tapsEnabled == MY_TCPWM_SHIFTREG_TAPS)
{
/* taps value is set correctly */
}
Cy_TCPWM_TriggerStart_Single(TCPWM0, MY_TCPWM_SHIFTREG_NUM);

◆ Cy_TCPWM_ShiftReg_LineOutStatus()

__STATIC_INLINE uint32_t Cy_TCPWM_ShiftReg_LineOutStatus ( TCPWM_Type const *  base,
uint32_t  cntNum,
uint32_t  shiftRegOutSelect 
)

Returns the current level of the selected Shift Register output line.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
shiftRegOutSelectDefines which Shift Register output line is being checked: line_out or line_out_inv.
Returns
The current Shift Register output line level.
/* Scenario: there is a need to check current level of
* Shift Register Line output for the first (index = 0) counter of the TCPWM0 block
*/
#define MY_TCPWM_SHIFTREG_NUM (0UL)
if (Cy_TCPWM_ShiftReg_LineOutStatus(TCPWM0, MY_TCPWM_SHIFTREG_NUM, CY_TCPWM_SHIFTREG_LINE_OUT))
{
/* Shift Register Line is High */
}
else
{
/* Shift Register Line is Low */
}

◆ Cy_TCPWM_Shiftreg_EnableSwap()

__STATIC_INLINE void Cy_TCPWM_Shiftreg_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.

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