/* This function is used to enable the Timer frequency counter function.  */
void TIMER_EnableFreqCounter(TIMER_T *timer, uint32_t u32DropCount, uint32_t u32Timeout, uint32_t u32EnableInt)
/* This function is used to enable the Timer frequency counter function.  */
void TIMER_EnableFreqCounter(TIMER_T *timer, uint32_t u32DropCount, uint32_t u32Timeout, uint32_t u32EnableInt)
{
    TIMER_T *t = NULL;
    if (timer == TIMER0)
        t = TIMER1;
    else if (timer == TIMER2)
        t = TIMER3;
    else if (timer == TIMER4)
        t = TIMER5;
    else if (timer == TIMER6)
        t = TIMER7;
    else if (timer == TIMER8)
        t = TIMER9;
    else if (timer == TIMER10)
        t = TIMER11;
    else
        return;
    t->CMP = 0xFFFFFFUL;
    t->EXTCTL = u32EnableInt ? TIMER_EXTCTL_CAPIEN_Msk : 0UL;
    timer->CTL = TIMER_CTL_INTRGEN_Msk | TIMER_CTL_CNTEN_Msk;
    return;
}