RobotCode/Generated_Source/PSoC4/Timer_Echo.c
void Timer_Echo_WriteCompareBuf(uint32 compareBuf)
{
    #if (Timer_Echo_CY_TCPWM_4000)
        uint32 currentMode;
    #endif /* (Timer_Echo_CY_TCPWM_4000) */

    #if (Timer_Echo_CY_TCPWM_4000)
        currentMode = ((Timer_Echo_CONTROL_REG & Timer_Echo_UPDOWN_MASK) >> Timer_Echo_UPDOWN_SHIFT);

        if (((uint32)Timer_Echo__COUNT_DOWN == currentMode) && (0xFFFFu != compareBuf))
        {
            compareBuf++;
        }
        else if (((uint32)Timer_Echo__COUNT_UP == currentMode) && (0u != compareBuf))
        {
            compareBuf --;
        }
        else
        {
        }
    #endif /* (Timer_Echo_CY_TCPWM_4000) */
    
    Timer_Echo_COMP_CAP_BUF_REG = (compareBuf & Timer_Echo_16BIT_MASK);
}
/*******************************************************************************
* Function Name: Timer_Echo_WriteCompareBuf
********************************************************************************
*
* Summary:
*  Writes the 16 bit compare buffer register with the new compare value. Not
*  applicable for Timer/Counter with Capture or in Quadrature Decoder modes.
*
* Parameters:
*  compareBuf: Compare value
*
* Return:
*  None
*
* Note:
*  It is not recommended to use the value equal to "0" or equal to 
*  "period value" in Center or Asymmetric align PWM modes on the 
*  PSoC 4100/PSoC 4200 devices.
*  PSoC 4000 devices write the 16 bit compare register with the decremented 
*  compare value in the Up counting mode (except 0x0u), and the incremented 
*  compare value in the Down counting mode (except 0xFFFFu).
*
*******************************************************************************/
Function Name: Timer_Echo_WriteCompareBuf
Summary:
Writes the 16 bit compare buffer register with the new compare value. Not
applicable for Timer/Counter with Capture or in Quadrature Decoder modes.

Compare value

None

It is not recommended to use the value equal to "0" or equal to
"period value" in Center or Asymmetric align PWM modes on the
PSoC 4100/PSoC 4200 devices.
PSoC 4000 devices write the 16 bit compare register with the decremented
compare value in the Up counting mode (except 0x0u), and the incremented
compare value in the Down counting mode (except 0xFFFFu).
Function Name : Timer_Echo_WriteCompareBuf Summary : Writes the 16 bit compare buffer register with the new compare value . Not applicable for Timer / Counter with Capture or in Quadrature Decoder modes . Compare value None It is not recommended to use the value equal to " 0 " or equal to " period value " in Center or Asymmetric align PWM modes on the PSoC 4100 / PSoC 4200 devices . PSoC 4000 devices write the 16 bit compare register with the decremented compare value in the Up counting mode ( except 0x0u ) and the incremented compare value in the Down counting mode ( except 0xFFFFu ) .
void Timer_Echo_WriteCompareBuf(uint32 compareBuf)
{
    #if (Timer_Echo_CY_TCPWM_4000)
        uint32 currentMode;
    #endif 
    #if (Timer_Echo_CY_TCPWM_4000)
        currentMode = ((Timer_Echo_CONTROL_REG & Timer_Echo_UPDOWN_MASK) >> Timer_Echo_UPDOWN_SHIFT);
        if (((uint32)Timer_Echo__COUNT_DOWN == currentMode) && (0xFFFFu != compareBuf))
        {
            compareBuf++;
        }
        else if (((uint32)Timer_Echo__COUNT_UP == currentMode) && (0u != compareBuf))
        {
            compareBuf --;
        }
        else
        {
        }
    #endif 
    Timer_Echo_COMP_CAP_BUF_REG = (compareBuf & Timer_Echo_16BIT_MASK);
}
void Timer_Echo_WriteCompareBuf ( uint32 compareBuf ) { #if ( Timer_Echo_CY_TCPWM_4000 ) uint32 currentMode ; #endif #if ( Timer_Echo_CY_TCPWM_4000 ) currentMode = ( ( Timer_Echo_CONTROL_REG & Timer_Echo_UPDOWN_MASK ) >> Timer_Echo_UPDOWN_SHIFT ) ; if ( ( ( uint32 ) Timer_Echo__COUNT_DOWN == currentMode ) && ( 0xFFFFu != compareBuf ) ) { compareBuf ++ ; } else if ( ( ( uint32 ) Timer_Echo__COUNT_UP == currentMode ) && ( 0u != compareBuf ) ) { compareBuf -- ; } else { } #endif Timer_Echo_COMP_CAP_BUF_REG = ( compareBuf & Timer_Echo_16BIT_MASK ) ; }
Function Name: Timer_Echo_WriteCompareBuf
Summary:
Writes the 16 bit compare buffer register with the new compare value.
Function Name : Timer_Echo_WriteCompareBuf Summary : Writes the 16 bit compare buffer register with the new compare value .
/* (Timer_Echo_CY_TCPWM_4000) */ /* (Timer_Echo_CY_TCPWM_4000) */