PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
Functions
PDL API Reference » TCPWM (Timer Counter PWM) » Quadrature Decoder (TCPWM)

## General Description

## Functions
cy_en_tcpwm_status_t | Cy_TCPWM_QuadDec_Init (TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_quaddec_config_t const *config)
| Initializes the counter in the TCPWM block for the QuadDec operation. More...
void | Cy_TCPWM_QuadDec_DeInit (TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_quaddec_config_t const *config)
| De-initializes the counter in the TCPWM block, returns register values to default. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_Enable (TCPWM_Type *base, uint32_t cntNum)
| Enables the counter in the TCPWM block for the QuadDec operation. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_Disable (TCPWM_Type *base, uint32_t cntNum)
| Disables the counter in the TCPWM block. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetStatus (TCPWM_Type const *base, uint32_t cntNum)
| Returns the status of the QuadDec whether it is running or not. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCapture0Val (TCPWM_Type const *base, uint32_t cntNum)
| Returns the capture value. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCapture0BufVal (TCPWM_Type const *base, uint32_t cntNum)
| Returns the buffered capture value. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_SetCompare0Val (TCPWM_Type *base, uint32_t cntNum, uint32_t compare0)
| Sets the compare value for Compare0 when the compare mode is enabled. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCompare0Val (TCPWM_Type const *base, uint32_t cntNum)
| Returns compare 0 value. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_SetCompare0BufVal (TCPWM_Type *base, uint32_t cntNum, uint32_t compareBuf0)
| Sets the Buffered Compare 0 value when the compare mode is enabled. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCompare0BufVal (TCPWM_Type const *base, uint32_t cntNum)
| Returns Buffered Compare 0 Value. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_EnableCompare0Swap (TCPWM_Type *base, uint32_t cntNum, bool enable)
| Enables the comparison swap of compare 0 and compareBuf 0 when the comparison value is true. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_SetCounter (TCPWM_Type *base, uint32_t cntNum, uint32_t count)
| Sets the value of the counter. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCounter (TCPWM_Type const *base, uint32_t cntNum)
| Returns the value in the counter. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCapture1Val (TCPWM_Type const *base, uint32_t cntNum)
| Returns capture 1 value when capture mode is enabled. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCapture1BufVal (TCPWM_Type const *base, uint32_t cntNum)
| Returns the buffered capture 1 value when capture mode is enabled. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCompare1Val (TCPWM_Type const *base, uint32_t cntNum)
| Returns compare 1 value. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetCompare1BufVal (TCPWM_Type const *base, uint32_t cntNum)
| Returns the buffered compare 1 value. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_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 void | Cy_TCPWM_QuadDec_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 void | Cy_TCPWM_QuadDec_EnableCompare1Swap (TCPWM_Type *base, uint32_t cntNum, bool enable)
| Enables the comparison swap of compare 1 and compareBuf 1 when the comparison value is true. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_SetPeriod0 (TCPWM_Type *base, uint32_t cntNum, uint32_t period0)
| Sets the value of the period register. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetPeriod0 (TCPWM_Type const *base, uint32_t cntNum)
| Returns the value in the period 0 register. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_SetPeriod1 (TCPWM_Type *base, uint32_t cntNum, uint32_t period1)
| Sets the value of the period register. More...
__STATIC_INLINE uint32_t | Cy_TCPWM_QuadDec_GetPeriod1 (TCPWM_Type const *base, uint32_t cntNum)
| Returns the value in the period 1 register. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_TriggerIndex1 (TCPWM_Type *base, uint32_t cntNum)
| Triggers a software index 1. More...
__STATIC_INLINE void | Cy_TCPWM_QuadDec_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_QuadDec_Init()

cy_en_tcpwm_status_t Cy_TCPWM_QuadDec_Init | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | cy_stc_tcpwm_quaddec_config_t const * | config
| ) |  |

Initializes the counter in the TCPWM block for the QuadDec operation.

Parameters

  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_quaddec_config_t.

Returns
  error / status code. See cy_en_tcpwm_status_t.

Function Usage
  /* Scenario: there is need to initialize
  * the first (index = 0) quadrature decoder of the TCPWM0 block
  * with the below configuration settings
  */
  cy_stc_tcpwm_quaddec_config_t tcpwm_v1_qd_config =
  {
  /* .resolution = */ CY_TCPWM_QUADDEC_X1, /* One count during one encoder cycle */
  /* .interruptSources = */ CY_TCPWM_INT_ON_TC, /* Simple example without index input */
  /* .indexInputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* The default value (0UL) */
  /* .indexInput = */ CY_TCPWM_INPUT_0, /* The index input is not used */
  /* .stopInputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* The default value (0UL) */
  /* .stopInput = */ CY_TCPWM_INPUT_0, /* The stop input is not used, the block will be stopped by SW */
  /* .phiAInput = */ CY_TCPWM_INPUT_TRIG_0, /* The phiA input is connected to the trigger multiplexer #0 of the Trigger Group #3 */
  /* .phiBInput = */ CY_TCPWM_INPUT_TRIG_1, /* The phiB input is connected to the trigger multiplexer #1 of the Trigger Group #3 */
  };
  #define MY_TCPWM_CNT_NUM (0UL)
  if (CY_TCPWM_SUCCESS != Cy_TCPWM_QuadDec_Init(TCPWM0, MY_TCPWM_CNT_NUM, &tcpwm_v1_qd_config))
  {
  /* Handle possible errors */
  }
  /* Enabled the initialized quadrature decoder */
  Cy_TCPWM_QuadDec_Enable(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Then start the decoder */
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  cy_stc_tcpwm_quaddec_config_t
  Quadrature Decoder configuration structure.
  Definition: cy_tcpwm_quaddec.h:124
  CY_TCPWM_SUCCESS
  @ CY_TCPWM_SUCCESS
  Successful.
  Definition: cy_tcpwm.h:402
  Cy_TCPWM_TriggerReloadOrIndex_Single
  __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.
  Definition: cy_tcpwm.h:916
  Cy_TCPWM_QuadDec_Enable
  __STATIC_INLINE void Cy_TCPWM_QuadDec_Enable(TCPWM_Type *base, uint32_t cntNum)
  Enables the counter in the TCPWM block for the QuadDec operation.
  Definition: cy_tcpwm_quaddec.h:309
  Cy_TCPWM_QuadDec_Init
  cy_en_tcpwm_status_t Cy_TCPWM_QuadDec_Init(TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_quaddec_config_t const *config)
  Initializes the counter in the TCPWM block for the QuadDec operation.
  Definition: cy_tcpwm_quaddec.c:58
  CY_TCPWM_INPUT_RISINGEDGE
  #define CY_TCPWM_INPUT_RISINGEDGE
  A rising edge triggers the event (Capture, Start, Reload, etc..)
  Definition: cy_tcpwm.h:266
  CY_TCPWM_INPUT_0
  #define CY_TCPWM_INPUT_0
  Input is tied to logic 0.
  Definition: cy_tcpwm.h:228
  CY_TCPWM_INPUT_TRIG_1
  #define CY_TCPWM_INPUT_TRIG_1
  Input is connected to the trigger input 1.
  Definition: cy_tcpwm.h:231
  CY_TCPWM_INPUT_TRIG_0
  #define CY_TCPWM_INPUT_TRIG_0
  Input is connected to the trigger input 0.
  Definition: cy_tcpwm.h:230
  CY_TCPWM_INT_ON_TC
  #define CY_TCPWM_INT_ON_TC
  Interrupt on Terminal count(TC)
  Definition: cy_tcpwm.h:306
  CY_TCPWM_QUADDEC_X1
  #define CY_TCPWM_QUADDEC_X1
  X1 mode.
  Definition: cy_tcpwm_quaddec.h:205
  /* Scenario: there is need to initialize
  * the first (index = 0) quadrature decoder of the TCPWM0 block
  * with the below configuration settings
  */
  cy_stc_tcpwm_quaddec_config_t tcpwm_v2_qd_config =
  {
  /* .resolution = */ CY_TCPWM_QUADDEC_X1, /* One count during one encoder cycle */
  /* .interruptSources = */ CY_TCPWM_INT_ON_TC, /* Simple example without index input */
  /* .indexInputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* The default value (0UL) */
  /* .indexInput = */ CY_TCPWM_INPUT_0, /* The index input is not used */
  /* .stopInputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* The default value (0UL) */
  /* .stopInput = */ CY_TCPWM_INPUT_0, /* The stop input is not used, the block will be stopped by SW */
  /* .phiAInput = */ CY_TCPWM_INPUT_TRIG(0), /* The phiA input is connected to the trigger multiplexer #0 of the Trigger Group #3 */
  /* .phiBInput = */ CY_TCPWM_INPUT_TRIG(1), /* The phiB input is connected to the trigger multiplexer #1 of the Trigger Group #3 */
  /* .phiAInputMode = */ CY_TCPWM_INPUT_LEVEL, /* Pass through (no edge detection) */
  /* .phiBInputMode = */ CY_TCPWM_INPUT_LEVEL, /* Pass through (no edge detection) */
  /* .quadmode = */ CY_TCPWM_QUADDEC_MODE_RANGE0, /* Quad mode */
  /* .period0 = */ 0UL, /* Period 0 Value */
  /* .captureOnIndex = */ CY_TCPWM_QUADDEC_CAPTURE_ON_INDEX, /* Capture On Index event */
  /* .compare0 = */ 0Ul, /* Sets the value for Compare 0 */
  /* .compareBuf0 = */ 0UL, /* Sets the value for the buffered Compare 0 */
  /* .enableCompare0Swap = */ false, /* If enabled, the compare 0 values are swapped on the terminal count */
  /* .compare1 = */ 0UL, /* Sets the value for Compare 1 */
  /* .compareBuf1 = */ 0UL, /* Sets the value for the buffered Compare 0 */
  /* .enableCompare1Swap = */ false, /* If enabled, the compare 0 values are swapped on the terminal count */
  /* .capture0OrIndex1InputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* Configures how the capture0/index1 input behaves.*/
  /* .capture0OrIndex1Input = */ CY_TCPWM_INPUT_0, /* Selects which input the capture0/index1 uses. The inputs are device-specific. */
  /* .capture1InputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* Configures how the capture1 input behaves. */
  /* .capture1Input = */ CY_TCPWM_INPUT_0, /* Selects which input the capture1 uses. The inputs are device-specific. */
  /* .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_CNT_NUM (0UL)
  if (CY_TCPWM_SUCCESS != Cy_TCPWM_QuadDec_Init(TCPWM0, MY_TCPWM_CNT_NUM, &tcpwm_v2_qd_config))
  {
  /* Handle possible errors */
  }
  /* Enabled the initialized quadrature decoder */
  Cy_TCPWM_QuadDec_Enable(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Then start the decoder */
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  CY_TCPWM_INPUT_LEVEL
  #define CY_TCPWM_INPUT_LEVEL
  The event is triggered on each edge of the TCPWM clock if the input is high.
  Definition: cy_tcpwm.h:272
  CY_TCPWM_CNT_TRIGGER_ON_DISABLED
  #define CY_TCPWM_CNT_TRIGGER_ON_DISABLED
  Output trigger disabled.
  Definition: cy_tcpwm.h:297
  CY_TCPWM_QUADDEC_CAPTURE_ON_INDEX
  #define CY_TCPWM_QUADDEC_CAPTURE_ON_INDEX
  Capture on Index.
  Definition: cy_tcpwm_quaddec.h:216
  CY_TCPWM_QUADDEC_MODE_RANGE0
  #define CY_TCPWM_QUADDEC_MODE_RANGE0
  Counter Range between 0x0000 and 0xFFFF / 0xFFFFFFFF (for GRP_CNT_WIDTH = 16 / 32)
  Definition: cy_tcpwm_quaddec.h:191

## ◆ Cy_TCPWM_QuadDec_DeInit()

void Cy_TCPWM_QuadDec_DeInit | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | cy_stc_tcpwm_quaddec_config_t const * | config
| ) |  |

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

Parameters

  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_quaddec_config_t.

Function Usage
  /* Scenario: there is need to deinitialize the previously initialized block */
  #define MY_TCPWM_CNT_NUM (0UL)
  /* Disable the counter prior to deinitializing */
  Cy_TCPWM_QuadDec_Disable(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_DeInit(TCPWM0, MY_TCPWM_CNT_NUM, &config);
  Cy_TCPWM_QuadDec_DeInit
  void Cy_TCPWM_QuadDec_DeInit(TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_quaddec_config_t const *config)
  De-initializes the counter in the TCPWM block, returns register values to default.
  Definition: cy_tcpwm_quaddec.c:179
  Cy_TCPWM_QuadDec_Disable
  __STATIC_INLINE void Cy_TCPWM_QuadDec_Disable(TCPWM_Type *base, uint32_t cntNum)
  Disables the counter in the TCPWM block.
  Definition: cy_tcpwm_quaddec.h:330

## ◆ Cy_TCPWM_QuadDec_Enable()

__STATIC_INLINE void Cy_TCPWM_QuadDec_Enable | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum
| ) |  |

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

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Function Usage
  /* Scenario: there is need to initialize
  * the first (index = 0) quadrature decoder of the TCPWM0 block
  * with the below configuration settings
  */
  cy_stc_tcpwm_quaddec_config_t tcpwm_v1_qd_config =
  {
  /* .resolution = */ CY_TCPWM_QUADDEC_X1, /* One count during one encoder cycle */
  /* .interruptSources = */ CY_TCPWM_INT_ON_TC, /* Simple example without index input */
  /* .indexInputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* The default value (0UL) */
  /* .indexInput = */ CY_TCPWM_INPUT_0, /* The index input is not used */
  /* .stopInputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* The default value (0UL) */
  /* .stopInput = */ CY_TCPWM_INPUT_0, /* The stop input is not used, the block will be stopped by SW */
  /* .phiAInput = */ CY_TCPWM_INPUT_TRIG_0, /* The phiA input is connected to the trigger multiplexer #0 of the Trigger Group #3 */
  /* .phiBInput = */ CY_TCPWM_INPUT_TRIG_1, /* The phiB input is connected to the trigger multiplexer #1 of the Trigger Group #3 */
  };
  #define MY_TCPWM_CNT_NUM (0UL)
  if (CY_TCPWM_SUCCESS != Cy_TCPWM_QuadDec_Init(TCPWM0, MY_TCPWM_CNT_NUM, &tcpwm_v1_qd_config))
  {
  /* Handle possible errors */
  }
  /* Enabled the initialized quadrature decoder */
  Cy_TCPWM_QuadDec_Enable(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Then start the decoder */
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Scenario: there is need to initialize
  * the first (index = 0) quadrature decoder of the TCPWM0 block
  * with the below configuration settings
  */
  cy_stc_tcpwm_quaddec_config_t tcpwm_v2_qd_config =
  {
  /* .resolution = */ CY_TCPWM_QUADDEC_X1, /* One count during one encoder cycle */
  /* .interruptSources = */ CY_TCPWM_INT_ON_TC, /* Simple example without index input */
  /* .indexInputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* The default value (0UL) */
  /* .indexInput = */ CY_TCPWM_INPUT_0, /* The index input is not used */
  /* .stopInputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* The default value (0UL) */
  /* .stopInput = */ CY_TCPWM_INPUT_0, /* The stop input is not used, the block will be stopped by SW */
  /* .phiAInput = */ CY_TCPWM_INPUT_TRIG(0), /* The phiA input is connected to the trigger multiplexer #0 of the Trigger Group #3 */
  /* .phiBInput = */ CY_TCPWM_INPUT_TRIG(1), /* The phiB input is connected to the trigger multiplexer #1 of the Trigger Group #3 */
  /* .phiAInputMode = */ CY_TCPWM_INPUT_LEVEL, /* Pass through (no edge detection) */
  /* .phiBInputMode = */ CY_TCPWM_INPUT_LEVEL, /* Pass through (no edge detection) */
  /* .quadmode = */ CY_TCPWM_QUADDEC_MODE_RANGE0, /* Quad mode */
  /* .period0 = */ 0UL, /* Period 0 Value */
  /* .captureOnIndex = */ CY_TCPWM_QUADDEC_CAPTURE_ON_INDEX, /* Capture On Index event */
  /* .compare0 = */ 0Ul, /* Sets the value for Compare 0 */
  /* .compareBuf0 = */ 0UL, /* Sets the value for the buffered Compare 0 */
  /* .enableCompare0Swap = */ false, /* If enabled, the compare 0 values are swapped on the terminal count */
  /* .compare1 = */ 0UL, /* Sets the value for Compare 1 */
  /* .compareBuf1 = */ 0UL, /* Sets the value for the buffered Compare 0 */
  /* .enableCompare1Swap = */ false, /* If enabled, the compare 0 values are swapped on the terminal count */
  /* .capture0OrIndex1InputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* Configures how the capture0/index1 input behaves.*/
  /* .capture0OrIndex1Input = */ CY_TCPWM_INPUT_0, /* Selects which input the capture0/index1 uses. The inputs are device-specific. */
  /* .capture1InputMode = */ CY_TCPWM_INPUT_RISINGEDGE, /* Configures how the capture1 input behaves. */
  /* .capture1Input = */ CY_TCPWM_INPUT_0, /* Selects which input the capture1 uses. The inputs are device-specific. */
  /* .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_CNT_NUM (0UL)
  if (CY_TCPWM_SUCCESS != Cy_TCPWM_QuadDec_Init(TCPWM0, MY_TCPWM_CNT_NUM, &tcpwm_v2_qd_config))
  {
  /* Handle possible errors */
  }
  /* Enabled the initialized quadrature decoder */
  Cy_TCPWM_QuadDec_Enable(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Then start the decoder */
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);

## ◆ Cy_TCPWM_QuadDec_Disable()

__STATIC_INLINE void Cy_TCPWM_QuadDec_Disable | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum
| ) |  |

Disables the counter in the TCPWM block.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Function Usage
  /* Scenario: there is need to deinitialize the previously initialized block */
  #define MY_TCPWM_CNT_NUM (0UL)
  /* Disable the counter prior to deinitializing */
  Cy_TCPWM_QuadDec_Disable(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_DeInit(TCPWM0, MY_TCPWM_CNT_NUM, &config);

## ◆ Cy_TCPWM_QuadDec_GetStatus()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetStatus | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns the status of the QuadDec whether it is running or not.

In case the QuadDec is running, status will also provide information on counting up/down.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  The status. See QuadDec Status

Note
  The status value is not the same as in TCPWM status register.

Function Usage
  /* Scenario: there is a need to check if
  * the first (index = 0) quadrature decoder of the TCPWM0 block is running or not.
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t status = Cy_TCPWM_QuadDec_GetStatus(TCPWM0, MY_TCPWM_CNT_NUM);
  if ((CY_TCPWM_QUADDEC_STATUS_COUNTER_RUNNING & status) && (CY_TCPWM_QUADDEC_STATUS_UP_COUNTING & status))
  {
  /* Up Counting */
  }
  else if ((CY_TCPWM_QUADDEC_STATUS_COUNTER_RUNNING & status) && (CY_TCPWM_QUADDEC_STATUS_DOWN_COUNTING & status))
  {
  /* Down Counting */
  }
  else
  {
  /* QuadDec is not running */
  }
  Cy_TCPWM_QuadDec_GetStatus
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetStatus(TCPWM_Type const *base, uint32_t cntNum)
  Returns the status of the QuadDec whether it is running or not.
  Definition: cy_tcpwm_quaddec.h:358
  CY_TCPWM_QUADDEC_STATUS_COUNTER_RUNNING
  #define CY_TCPWM_QUADDEC_STATUS_COUNTER_RUNNING
  QuadDec the counter is running.
  Definition: cy_tcpwm_quaddec.h:231
  CY_TCPWM_QUADDEC_STATUS_DOWN_COUNTING
  #define CY_TCPWM_QUADDEC_STATUS_DOWN_COUNTING
  QuadDec is down counting.
  Definition: cy_tcpwm_quaddec.h:224
  CY_TCPWM_QUADDEC_STATUS_UP_COUNTING
  #define CY_TCPWM_QUADDEC_STATUS_UP_COUNTING
  QuadDec is up counting.
  Definition: cy_tcpwm_quaddec.h:225

## ◆ Cy_TCPWM_QuadDec_GetCapture0Val()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCapture0Val | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns the capture value.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  The capture value.

Function Usage
  /* Scenario: there is a need to get the capture values of
  * the first (index = 0) quadrature decoder of the TCPWM0 block.
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  /* The capture event can be triggered either by the Index HW input
  * or by software:
  */
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  /* after some time or encoder moving */
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Now we can get the latest captured value
  * (captured during the second call of Cy_TCPWM_TriggerReloadOrIndex_Single)
  */
  uint32_t capture = Cy_TCPWM_QuadDec_GetCapture0Val(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Also the previous captured value
  * (captured during the first call of Cy_TCPWM_TriggerReloadOrIndex_Single)
  * is available by the next way
  */
  uint32_t captureBuf = Cy_TCPWM_QuadDec_GetCapture0BufVal(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_GetCapture0BufVal
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCapture0BufVal(TCPWM_Type const *base, uint32_t cntNum)
  Returns the buffered capture value.
  Definition: cy_tcpwm_quaddec.h:443
  Cy_TCPWM_QuadDec_GetCapture0Val
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCapture0Val(TCPWM_Type const *base, uint32_t cntNum)
  Returns the capture value.
  Definition: cy_tcpwm_quaddec.h:418

## ◆ Cy_TCPWM_QuadDec_GetCapture0BufVal()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCapture0BufVal | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns the buffered capture value.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  The buffered capture value.

Function Usage
  /* Scenario: there is a need to get the capture values of
  * the first (index = 0) quadrature decoder of the TCPWM0 block.
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  /* The capture event can be triggered either by the Index HW input
  * or by software:
  */
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  /* after some time or encoder moving */
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Now we can get the latest captured value
  * (captured during the second call of Cy_TCPWM_TriggerReloadOrIndex_Single)
  */
  uint32_t capture = Cy_TCPWM_QuadDec_GetCapture0Val(TCPWM0, MY_TCPWM_CNT_NUM);
  /* Also the previous captured value
  * (captured during the first call of Cy_TCPWM_TriggerReloadOrIndex_Single)
  * is available by the next way
  */
  uint32_t captureBuf = Cy_TCPWM_QuadDec_GetCapture0BufVal(TCPWM0, MY_TCPWM_CNT_NUM);

## ◆ Cy_TCPWM_QuadDec_SetCompare0Val()

__STATIC_INLINE void Cy_TCPWM_QuadDec_SetCompare0Val | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | uint32_t | compare0
| ) |  |

Sets the compare value for Compare0 when the compare mode is enabled.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  compare0 | The Compare 0 value.

Function Usage
  /* Scenario: there is a need to set compare 0 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t compare0 = 0uL;
  Cy_TCPWM_QuadDec_SetCompare0Val(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  compare0 = Cy_TCPWM_QuadDec_GetCompare0Val(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_SetCompare0Val
  __STATIC_INLINE void Cy_TCPWM_QuadDec_SetCompare0Val(TCPWM_Type *base, uint32_t cntNum, uint32_t compare0)
  Sets the compare value for Compare0 when the compare mode is enabled.
  Definition: cy_tcpwm_quaddec.h:468
  Cy_TCPWM_QuadDec_GetCompare0Val
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCompare0Val(TCPWM_Type const *base, uint32_t cntNum)
  Returns compare 0 value.
  Definition: cy_tcpwm_quaddec.h:493

## ◆ Cy_TCPWM_QuadDec_GetCompare0Val()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCompare0Val | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns compare 0 value.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  Compare 0 value.

Function Usage
  /* Scenario: there is a need to set compare 0 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t compare0 = 0uL;
  Cy_TCPWM_QuadDec_SetCompare0Val(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  compare0 = Cy_TCPWM_QuadDec_GetCompare0Val(TCPWM0, MY_TCPWM_CNT_NUM);

## ◆ Cy_TCPWM_QuadDec_SetCompare0BufVal()

__STATIC_INLINE void Cy_TCPWM_QuadDec_SetCompare0BufVal | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | uint32_t | compareBuf0
| ) |  |

Sets the Buffered Compare 0 value when the compare mode is enabled.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  compareBuf0 | The Buffered Compare 0 value.

Function Usage
  /* Scenario: there is a need to set buffered compare 0 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t compare0buff = 0uL;
  Cy_TCPWM_QuadDec_SetCompare0BufVal(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  compare0buff = Cy_TCPWM_QuadDec_GetCompare0BufVal(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_SetCompare0BufVal
  __STATIC_INLINE void Cy_TCPWM_QuadDec_SetCompare0BufVal(TCPWM_Type *base, uint32_t cntNum, uint32_t compareBuf0)
  Sets the Buffered Compare 0 value when the compare mode is enabled.
  Definition: cy_tcpwm_quaddec.h:518
  Cy_TCPWM_QuadDec_GetCompare0BufVal
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCompare0BufVal(TCPWM_Type const *base, uint32_t cntNum)
  Returns Buffered Compare 0 Value.
  Definition: cy_tcpwm_quaddec.h:543

## ◆ Cy_TCPWM_QuadDec_GetCompare0BufVal()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCompare0BufVal | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns Buffered Compare 0 Value.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  Buffered Compare 0 Value.

Function Usage
  /* Scenario: there is a need to set buffered compare 0 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t compare0buff = 0uL;
  Cy_TCPWM_QuadDec_SetCompare0BufVal(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  compare0buff = Cy_TCPWM_QuadDec_GetCompare0BufVal(TCPWM0, MY_TCPWM_CNT_NUM);

## ◆ Cy_TCPWM_QuadDec_EnableCompare0Swap()

__STATIC_INLINE void Cy_TCPWM_QuadDec_EnableCompare0Swap | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | bool | enable
| ) |  |

Enables the comparison swap of compare 0 and compareBuf 0 when the comparison value is true.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  enable | true = swap enabled, false = swap disabled

Function Usage
  /* Scenario: there is a need to swap compare 0 and compare 0 buffer values
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  Cy_TCPWM_QuadDec_EnableCompare0Swap(TCPWM0, MY_TCPWM_CNT_NUM, true);
  Cy_TCPWM_QuadDec_EnableCompare0Swap
  __STATIC_INLINE void Cy_TCPWM_QuadDec_EnableCompare0Swap(TCPWM_Type *base, uint32_t cntNum, bool enable)
  Enables the comparison swap of compare 0 and compareBuf 0 when the comparison value is true.
  Definition: cy_tcpwm_quaddec.h:569

## ◆ Cy_TCPWM_QuadDec_SetCounter()

__STATIC_INLINE void Cy_TCPWM_QuadDec_SetCounter | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | uint32_t | count
| ) |  |

Sets the value of the counter.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  count | The value to write into the counter.

Function Usage
  /* Scenario: there is a need to set the counter value for
  * the first (index = 0) counter of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  #define MY_TCPWM_CNT_VAL (0x8000UL) /* The "neutral" position for 16-bit decoder */
  Cy_TCPWM_TriggerStopOrKill_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_SetCounter(TCPWM0, MY_TCPWM_CNT_NUM, MY_TCPWM_CNT_VAL);
  Cy_TCPWM_TriggerReloadOrIndex_Single(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_TriggerStopOrKill_Single
  __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.
  Definition: cy_tcpwm.h:947
  Cy_TCPWM_QuadDec_SetCounter
  __STATIC_INLINE void Cy_TCPWM_QuadDec_SetCounter(TCPWM_Type *base, uint32_t cntNum, uint32_t count)
  Sets the value of the counter.
  Definition: cy_tcpwm_quaddec.h:594

## ◆ Cy_TCPWM_QuadDec_GetCounter()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCounter | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns the value in the counter.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  The current counter value.

Function Usage
  /* Scenario: there is a need to get the current counter value
  * (i.e. essentially the current position of the quadrature encoder)
  * of the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t count = Cy_TCPWM_QuadDec_GetCounter(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_GetCounter
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCounter(TCPWM_Type const *base, uint32_t cntNum)
  Returns the value in the counter.
  Definition: cy_tcpwm_quaddec.h:619

## ◆ Cy_TCPWM_QuadDec_GetCapture1Val()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCapture1Val | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns capture 1 value when capture mode is enabled.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  Capture 1 value.

## ◆ Cy_TCPWM_QuadDec_GetCapture1BufVal()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCapture1BufVal | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns the buffered capture 1 value when capture mode is enabled.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  Buffered capture 1 value.

## ◆ Cy_TCPWM_QuadDec_GetCompare1Val()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCompare1Val | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns compare 1 value.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  Compare 1 value.

Function Usage
  /* Scenario: there is a need to set compare 1 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t compare1 = 0uL;
  Cy_TCPWM_QuadDec_SetCompare1Val(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  compare1 = Cy_TCPWM_QuadDec_GetCompare1Val(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_GetCompare1Val
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCompare1Val(TCPWM_Type const *base, uint32_t cntNum)
  Returns compare 1 value.
  Definition: cy_tcpwm_quaddec.h:668
  Cy_TCPWM_QuadDec_SetCompare1Val
  __STATIC_INLINE void Cy_TCPWM_QuadDec_SetCompare1Val(TCPWM_Type *base, uint32_t cntNum, uint32_t compare1)
  Sets the compare value for Compare 1 when the compare mode enabled.
  Definition: cy_tcpwm_quaddec.h:643

## ◆ Cy_TCPWM_QuadDec_GetCompare1BufVal()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCompare1BufVal | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns the buffered compare 1 value.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  Buffered compare 1 value.

Function Usage
  /* Scenario: there is a need to set compare 1 buffer value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t compare1buff = 0uL;
  Cy_TCPWM_QuadDec_SetCompare1BufVal(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  compare1buff = Cy_TCPWM_QuadDec_GetCompare1BufVal(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_SetCompare1BufVal
  __STATIC_INLINE void Cy_TCPWM_QuadDec_SetCompare1BufVal(TCPWM_Type *base, uint32_t cntNum, uint32_t compareBuf1)
  Sets the buffered compare value for Compare 1 when the compare mode enabled.
  Definition: cy_tcpwm_quaddec.h:693
  Cy_TCPWM_QuadDec_GetCompare1BufVal
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetCompare1BufVal(TCPWM_Type const *base, uint32_t cntNum)
  Returns the buffered compare 1 value.
  Definition: cy_tcpwm_quaddec.h:718

## ◆ Cy_TCPWM_QuadDec_SetCompare1Val()

__STATIC_INLINE void Cy_TCPWM_QuadDec_SetCompare1Val | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | uint32_t | compare1
| ) |  |

Sets the compare value for Compare 1 when the compare mode enabled.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  compare1 | The Compare 1 value.

Function Usage
  /* Scenario: there is a need to set compare 1 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t compare1 = 0uL;
  Cy_TCPWM_QuadDec_SetCompare1Val(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  compare1 = Cy_TCPWM_QuadDec_GetCompare1Val(TCPWM0, MY_TCPWM_CNT_NUM);

## ◆ Cy_TCPWM_QuadDec_SetCompare1BufVal()

__STATIC_INLINE void Cy_TCPWM_QuadDec_SetCompare1BufVal | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | uint32_t | compareBuf1
| ) |  |

Sets the buffered compare value for Compare 1 when the compare mode enabled.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  compareBuf1 | The buffered Compare 1 value.

Function Usage
  /* Scenario: there is a need to set compare 1 buffer value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t compare1buff = 0uL;
  Cy_TCPWM_QuadDec_SetCompare1BufVal(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  compare1buff = Cy_TCPWM_QuadDec_GetCompare1BufVal(TCPWM0, MY_TCPWM_CNT_NUM);

## ◆ Cy_TCPWM_QuadDec_EnableCompare1Swap()

__STATIC_INLINE void Cy_TCPWM_QuadDec_EnableCompare1Swap | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | bool | enable
| ) |  |

Enables the comparison swap of compare 1 and compareBuf 1 when the comparison value is true.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  enable | true = swap enabled; false = swap disabled

Function Usage
  /* Scenario: there is a need to swap compare 1 and compare 1 buffer values
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  Cy_TCPWM_QuadDec_EnableCompare1Swap(TCPWM0, MY_TCPWM_CNT_NUM, true);
  Cy_TCPWM_QuadDec_EnableCompare1Swap
  __STATIC_INLINE void Cy_TCPWM_QuadDec_EnableCompare1Swap(TCPWM_Type *base, uint32_t cntNum, bool enable)
  Enables the comparison swap of compare 1 and compareBuf 1 when the comparison value is true.
  Definition: cy_tcpwm_quaddec.h:785

## ◆ Cy_TCPWM_QuadDec_SetPeriod0()

__STATIC_INLINE void Cy_TCPWM_QuadDec_SetPeriod0 | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | uint32_t | period0
| ) |  |

Sets the value of the period register.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  period0 | The value to write into a period.

Function Usage
  /* Scenario: there is a need to set period 0 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t period0 = 0uL;
  Cy_TCPWM_QuadDec_SetPeriod0(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  period0 = Cy_TCPWM_QuadDec_GetPeriod0(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_SetPeriod0
  __STATIC_INLINE void Cy_TCPWM_QuadDec_SetPeriod0(TCPWM_Type *base, uint32_t cntNum, uint32_t period0)
  Sets the value of the period register.
  Definition: cy_tcpwm_quaddec.h:808
  Cy_TCPWM_QuadDec_GetPeriod0
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetPeriod0(TCPWM_Type const *base, uint32_t cntNum)
  Returns the value in the period 0 register.
  Definition: cy_tcpwm_quaddec.h:833

## ◆ Cy_TCPWM_QuadDec_GetPeriod0()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetPeriod0 | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns the value in the period 0 register.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  The current period value.

Function Usage
  /* Scenario: there is a need to set period 0 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t period0 = 0uL;
  Cy_TCPWM_QuadDec_SetPeriod0(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  period0 = Cy_TCPWM_QuadDec_GetPeriod0(TCPWM0, MY_TCPWM_CNT_NUM);

## ◆ Cy_TCPWM_QuadDec_SetPeriod1()

__STATIC_INLINE void Cy_TCPWM_QuadDec_SetPeriod1 | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum,
|  | uint32_t | period1
| ) |  |

Sets the value of the period register.

Parameters

  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.

Function Usage
  /* Scenario: there is a need to set period 1 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t period1 = 0uL;
  Cy_TCPWM_QuadDec_SetPeriod1(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  period1 = Cy_TCPWM_QuadDec_GetPeriod1(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_GetPeriod1
  __STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetPeriod1(TCPWM_Type const *base, uint32_t cntNum)
  Returns the value in the period 1 register.
  Definition: cy_tcpwm_quaddec.h:887
  Cy_TCPWM_QuadDec_SetPeriod1
  __STATIC_INLINE void Cy_TCPWM_QuadDec_SetPeriod1(TCPWM_Type *base, uint32_t cntNum, uint32_t period1)
  Sets the value of the period register.
  Definition: cy_tcpwm_quaddec.h:860

- Note
    supported only in TCPWM_ver2

## ◆ Cy_TCPWM_QuadDec_GetPeriod1()

__STATIC_INLINE uint32_t Cy_TCPWM_QuadDec_GetPeriod1 | ( | TCPWM_Type const * | base,
|  | uint32_t | cntNum
| ) |  |

Returns the value in the period 1 register.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Returns
  The current period 1 value.

Function Usage
  /* Scenario: there is a need to set period 1 value
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  uint32_t period1 = 0uL;
  Cy_TCPWM_QuadDec_SetPeriod1(TCPWM0, MY_TCPWM_CNT_NUM, 255U);
  period1 = Cy_TCPWM_QuadDec_GetPeriod1(TCPWM0, MY_TCPWM_CNT_NUM);

Note
  supported only in TCPWM_ver2

## ◆ Cy_TCPWM_QuadDec_TriggerIndex1()

__STATIC_INLINE void Cy_TCPWM_QuadDec_TriggerIndex1 | ( | TCPWM_Type * | base,
|  | uint32_t | cntNum
| ) |  |

Triggers a software index 1.

Parameters

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.

Function Usage
  /* Scenario: there is a need to trigger Index1 event
  * for the first (index = 0) quadrature decoder of the TCPWM0 block
  */
  #define MY_TCPWM_CNT_NUM (0UL)
  Cy_TCPWM_QuadDec_TriggerIndex1(TCPWM0, MY_TCPWM_CNT_NUM);
  Cy_TCPWM_QuadDec_TriggerIndex1
  __STATIC_INLINE void Cy_TCPWM_QuadDec_TriggerIndex1(TCPWM_Type *base, uint32_t cntNum)
  Triggers a software index 1.
  Definition: cy_tcpwm_quaddec.h:911

## ◆ Cy_TCPWM_QuadDec_EnableSwap()

__STATIC_INLINE void Cy_TCPWM_QuadDec_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

  base | The pointer to a TCPWM instance.
  cntNum | The Counter instance number in the selected TCPWM.
  enable | true = swap enabled; false = swap disabled