#ifndef __QEI_H
#define __QEI_H

void     QEI_Open(OB_QEI_Type *pQEI, uint32_t nADCMode);
void     QEI_Close(OB_QEI_Type *pAQEI);

void     QEI_EnableINT(OB_QEI_Type *pQEI, uint32_t nINTSel);
void     QEI_DisableINT(OB_QEI_Type *pQEI, uint32_t nINTSel);
uint32_t QEI_GetPos(OB_QEI_Type *pQEI);
void     QEI_SetMaxPos(OB_QEI_Type *pQEI, uint32_t Number);

#define QEI_CON_DIR_INV      (1 << 0)
#define QEI_CON_MODE_SIGNAL  (1 << 1)
#define QEI_CON_CAP_4X       (1 << 2)
#define QEI_CON_INX_INV      (1 << 3)



#define QEI_INT_INX     (1 << 0)
#define QEI_INT_TIM     (1 << 1)
#define QEI_INT_VELC    (1 << 2)
#define QEI_INT_DIR     (1 << 3)
#define QEI_INT_ERR     (1 << 4)
#define QEI_INT_ENCLK   (1 << 5)
#define QEI_INT_POS0    (1 << 6)
#define QEI_INT_POS1    (1 << 7)
#define QEI_INT_POS2    (1 << 8)
#define QEI_INT_POS0REV (1 << 10)
#define QEI_INT_POS1REV (1 << 11)
#define QEI_INT_POS2REV (1 << 12)

struct QEI_DeadBand_1
{
    __IO uint32_t Enable;
    __IO uint32_t Mode;
    __IO uint32_t Delay;
} ;

#endif
