40 #ifndef __DRIVERLIB_QEI_H__
41 #define __DRIVERLIB_QEI_H__
59 #define QEI_CONFIG_CAPTURE_A 0x00000000 // Count on ChA edges only
60 #define QEI_CONFIG_CAPTURE_A_B 0x00000008 // Count on ChA and ChB edges
61 #define QEI_CONFIG_NO_RESET 0x00000000 // Do not reset on index pulse
62 #define QEI_CONFIG_RESET_IDX 0x00000010 // Reset position on index pulse
63 #define QEI_CONFIG_QUADRATURE 0x00000000 // ChA and ChB are quadrature
64 #define QEI_CONFIG_CLOCK_DIR 0x00000004 // ChA and ChB are clock and dir
65 #define QEI_CONFIG_NO_SWAP 0x00000000 // Do not swap ChA and ChB
66 #define QEI_CONFIG_SWAP 0x00000002 // Swap ChA and ChB
74 #define QEI_VELDIV_1 0x00000000 // Predivide by 1
75 #define QEI_VELDIV_2 0x00000040 // Predivide by 2
76 #define QEI_VELDIV_4 0x00000080 // Predivide by 4
77 #define QEI_VELDIV_8 0x000000C0 // Predivide by 8
78 #define QEI_VELDIV_16 0x00000100 // Predivide by 16
79 #define QEI_VELDIV_32 0x00000140 // Predivide by 32
80 #define QEI_VELDIV_64 0x00000180 // Predivide by 64
81 #define QEI_VELDIV_128 0x000001C0 // Predivide by 128
89 #define QEI_INTERROR 0x00000008 // Phase error detected
90 #define QEI_INTDIR 0x00000004 // Direction change
91 #define QEI_INTTIMER 0x00000002 // Velocity timer expired
92 #define QEI_INTINDEX 0x00000001 // Index pulse detected
101 extern void QEIConfigure(uint32_t ui32Base, uint32_t ui32Config,
102 uint32_t ui32MaxPosition);
104 extern void QEIPositionSet(uint32_t ui32Base, uint32_t ui32Position);
110 uint32_t ui32Period);
112 extern void QEIIntRegister(uint32_t ui32Base,
void (*pfnHandler)(
void));
114 extern void QEIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
115 extern void QEIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
116 extern uint32_t
QEIIntStatus(uint32_t ui32Base,
bool bMasked);
117 extern void QEIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags);
128 #endif // __DRIVERLIB_QEI_H__
int32_t QEIDirectionGet(uint32_t ui32Base)
Definition: qei.c:237
void QEIPositionSet(uint32_t ui32Base, uint32_t ui32Position)
Definition: qei.c:208
void QEIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: qei.c:556
void QEIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: qei.c:664
void QEIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: qei.c:586
void QEIIntUnregister(uint32_t ui32Base)
Definition: qei.c:512
uint32_t QEIIntStatus(uint32_t ui32Base, bool bMasked)
Definition: qei.c:616
void QEIIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: qei.c:468
uint32_t QEIPositionGet(uint32_t ui32Base)
Definition: qei.c:181
void QEIVelocityEnable(uint32_t ui32Base)
Definition: qei.c:293
void QEIVelocityDisable(uint32_t ui32Base)
Definition: qei.c:319
void QEIDisable(uint32_t ui32Base)
Definition: qei.c:98
void QEIVelocityConfigure(uint32_t ui32Base, uint32_t ui32PreDiv, uint32_t ui32Period)
Definition: qei.c:354
void QEIConfigure(uint32_t ui32Base, uint32_t ui32Config, uint32_t ui32MaxPosition)
Definition: qei.c:143
uint32_t QEIVelocityGet(uint32_t ui32Base)
Definition: qei.c:392
bool QEIErrorGet(uint32_t ui32Base)
Definition: qei.c:264
void QEIEnable(uint32_t ui32Base)
Definition: qei.c:73