/* Open EQEI in specified mode and enable input.  */
void EQEI_Open(EQEI_T *eqei, uint32_t u32Mode, uint32_t u32Value)
/* Open EQEI in specified mode and enable input.  */
void EQEI_Open(EQEI_T *eqei, uint32_t u32Mode, uint32_t u32Value)
{
    eqei->CTL = (eqei->CTL & (~EQEI_CTL_MODE_Msk)) | ((u32Mode) | EQEI_CTL_CHAEN_Msk | EQEI_CTL_CHBEN_Msk | EQEI_CTL_IDXEN_Msk);
    eqei->CNTMAX = u32Value;
}