/* Enables or disables the TIMER Capture Compare Channel x.  */
static void timer_ccx_channel_cmd(TIMER_TypeDef *TIMERx, ald_timer_channel_t ch, type_func_t state)
/* Enables or disables the TIMER Capture Compare Channel x.  */
static void timer_ccx_channel_cmd(TIMER_TypeDef *TIMERx, ald_timer_channel_t ch, type_func_t state)
{
    assert_param(IS_TIMER_CC2_INSTANCE(TIMERx));
    assert_param(IS_TIMER_CHANNELS(ch));
    switch (ch) {
    case ALD_TIMER_CHANNEL_1:
        MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1EN_MSK, state << TIMER_CCEP_CC1EN_POS);
        break;
    case ALD_TIMER_CHANNEL_2:
        MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2EN_MSK, state << TIMER_CCEP_CC2EN_POS);
        break;
    case ALD_TIMER_CHANNEL_3:
        MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC3EN_MSK, state << TIMER_CCEP_CC3EN_POS);
        break;
    case ALD_TIMER_CHANNEL_4:
        MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC4EN_MSK, state << TIMER_CCEP_CC4EN_POS);
        break;
    default:
        break;
    }
}