38 #ifndef __DRIVERLIB_QEI_H__ 39 #define __DRIVERLIB_QEI_H__ 60 #define QEI_CONFIG_CAPTURE_A 0x00000000 // Count on ChA edges only 61 #define QEI_CONFIG_CAPTURE_A_B 0x00000008 // Count on ChA and ChB edges 62 #define QEI_CONFIG_NO_RESET 0x00000000 // Do not reset on index pulse 63 #define QEI_CONFIG_RESET_IDX 0x00000010 // Reset position on index pulse 64 #define QEI_CONFIG_QUADRATURE 0x00000000 // ChA and ChB are quadrature 65 #define QEI_CONFIG_CLOCK_DIR 0x00000004 // ChA and ChB are clock and dir 66 #define QEI_CONFIG_NO_SWAP 0x00000000 // Do not swap ChA and ChB 67 #define QEI_CONFIG_SWAP 0x00000002 // Swap ChA and ChB 75 #define QEI_FILTCNT_2 0x00000000 // Filter Count of 2 System Clocks 76 #define QEI_FILTCNT_3 0x00010000 // Filter Count of 3 System Clocks 77 #define QEI_FILTCNT_4 0x00020000 // Filter Count of 4 System Clocks 78 #define QEI_FILTCNT_5 0x00030000 // Filter Count of 5 System Clocks 79 #define QEI_FILTCNT_6 0x00040000 // Filter Count of 6 System Clocks 80 #define QEI_FILTCNT_7 0x00050000 // Filter Count of 7 System Clocks 81 #define QEI_FILTCNT_8 0x00060000 // Filter Count of 8 System Clocks 82 #define QEI_FILTCNT_9 0x00070000 // Filter Count of 9 System Clocks 83 #define QEI_FILTCNT_10 0x00080000 // Filter Count of 10 System Clocks 84 #define QEI_FILTCNT_11 0x00090000 // Filter Count of 11 System Clocks 85 #define QEI_FILTCNT_12 0x000A0000 // Filter Count of 12 System Clocks 86 #define QEI_FILTCNT_13 0x000B0000 // Filter Count of 13 System Clocks 87 #define QEI_FILTCNT_14 0x000C0000 // Filter Count of 14 System Clocks 88 #define QEI_FILTCNT_15 0x000D0000 // Filter Count of 15 System Clocks 89 #define QEI_FILTCNT_16 0x000E0000 // Filter Count of 16 System Clocks 90 #define QEI_FILTCNT_17 0x000F0000 // Filter Count of 17 System Clocks 98 #define QEI_VELDIV_1 0x00000000 // Predivide by 1 99 #define QEI_VELDIV_2 0x00000040 // Predivide by 2 100 #define QEI_VELDIV_4 0x00000080 // Predivide by 4 101 #define QEI_VELDIV_8 0x000000C0 // Predivide by 8 102 #define QEI_VELDIV_16 0x00000100 // Predivide by 16 103 #define QEI_VELDIV_32 0x00000140 // Predivide by 32 104 #define QEI_VELDIV_64 0x00000180 // Predivide by 64 105 #define QEI_VELDIV_128 0x000001C0 // Predivide by 128 113 #define QEI_INTERROR 0x00000008 // Phase error detected 114 #define QEI_INTDIR 0x00000004 // Direction change 115 #define QEI_INTTIMER 0x00000002 // Velocity timer expired 116 #define QEI_INTINDEX 0x00000001 // Index pulse detected 123 extern void QEIEnable(uint32_t ui32Base);
125 extern void QEIConfigure(uint32_t ui32Base, uint32_t ui32Config,
126 uint32_t ui32MaxPosition);
128 extern void QEIPositionSet(uint32_t ui32Base, uint32_t ui32Position);
137 uint32_t ui32Period);
139 extern void QEIIntRegister(uint32_t ui32Base,
void (*pfnHandler)(
void));
141 extern void QEIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
142 extern void QEIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
143 extern uint32_t
QEIIntStatus(uint32_t ui32Base,
bool bMasked);
144 extern void QEIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags);
155 #endif // __DRIVERLIB_QEI_H__ int32_t QEIDirectionGet(uint32_t ui32Base)
Definition: qei.c:234
void QEIPositionSet(uint32_t ui32Base, uint32_t ui32Position)
Definition: qei.c:205
void QEIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: qei.c:636
void QEIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: qei.c:744
void QEIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: qei.c:666
void QEIIntUnregister(uint32_t ui32Base)
Definition: qei.c:592
uint32_t QEIIntStatus(uint32_t ui32Base, bool bMasked)
Definition: qei.c:696
void QEIIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: qei.c:548
uint32_t QEIPositionGet(uint32_t ui32Base)
Definition: qei.c:178
void QEIVelocityEnable(uint32_t ui32Base)
Definition: qei.c:380
void QEIVelocityDisable(uint32_t ui32Base)
Definition: qei.c:406
void QEIDisable(uint32_t ui32Base)
Definition: qei.c:95
void QEIFilterConfigure(uint32_t ui32Base, uint32_t ui32FiltCnt)
Definition: qei.c:349
void QEIVelocityConfigure(uint32_t ui32Base, uint32_t ui32PreDiv, uint32_t ui32Period)
Definition: qei.c:441
void QEIConfigure(uint32_t ui32Base, uint32_t ui32Config, uint32_t ui32MaxPosition)
Definition: qei.c:140
void QEIFilterDisable(uint32_t ui32Base)
Definition: qei.c:316
uint32_t QEIVelocityGet(uint32_t ui32Base)
Definition: qei.c:479
void QEIFilterEnable(uint32_t ui32Base)
Definition: qei.c:290
bool QEIErrorGet(uint32_t ui32Base)
Definition: qei.c:261
void QEIEnable(uint32_t ui32Base)
Definition: qei.c:70