/* Enable or disable PWM output of the specified TMR2 channel.  */
void TMR2_PWM_OutputCmd(CM_TMR2_TypeDef *TMR2x, uint32_t u32Ch, en_functional_state_t enNewState)
/* Enable or disable PWM output of the specified TMR2 channel.  */
void TMR2_PWM_OutputCmd(CM_TMR2_TypeDef *TMR2x, uint32_t u32Ch, en_functional_state_t enNewState)
{
    uint32_t u32PCONRAddr;
    uint8_t au8EnPos[] = {TMR2_PCONR_OUTENA_POS, TMR2_PCONR_OUTENB_POS};
    DDL_ASSERT(IS_TMR2_UNIT(TMR2x));
    DDL_ASSERT(IS_TMR2_CH(u32Ch));
    DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState));
    u32PCONRAddr = (uint32_t)&TMR2x->PCONR;
    WRITE_REG32(PERIPH_BIT_BAND(u32PCONRAddr, au8EnPos[u32Ch]), enNewState);
}