/* Starts the TIMER Input Capture measurement in interrupt mode.  */
void ald_timer_ic_start_by_it(ald_timer_handle_t *hperh, ald_timer_channel_t ch)
/* Starts the TIMER Input Capture measurement in interrupt mode.  */
void ald_timer_ic_start_by_it(ald_timer_handle_t *hperh, ald_timer_channel_t ch)
{
    assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
    switch (ch) {
    case ALD_TIMER_CHANNEL_1:
        ald_timer_interrupt_config(hperh, ALD_TIMER_IT_CC1, ENABLE);
        break;
    case ALD_TIMER_CHANNEL_2:
        ald_timer_interrupt_config(hperh, ALD_TIMER_IT_CC2, ENABLE);
        break;
    case ALD_TIMER_CHANNEL_3:
        ald_timer_interrupt_config(hperh, ALD_TIMER_IT_CC3, ENABLE);
        break;
    case ALD_TIMER_CHANNEL_4:
        ald_timer_interrupt_config(hperh, ALD_TIMER_IT_CC4, ENABLE);
        break;
    default:
        break;
    }
    timer_ccx_channel_cmd(hperh->perh, ch, ENABLE);
    ALD_TIMER_ENABLE(hperh);
    return;
}