AM263x MCU+ SDK  08.03.00
eqep/v1/eqep.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
42 #ifndef EQEP_V1_H_
43 #define EQEP_V1_H_
44 
45 //*****************************************************************************
46 //
47 // If building with a C++ compiler, make all of the definitions in this header
48 // have a C binding.
49 //
50 //*****************************************************************************
51 #ifdef __cplusplus
52 extern "C"
53 {
54 #endif
55 
56 //*****************************************************************************
57 //
59 //
60 //*****************************************************************************
61 
62 #include <stdbool.h>
63 #include <stdint.h>
64 #include <drivers/hw_include/hw_types.h>
65 #include <drivers/hw_include/cslr_soc.h>
66 #include <kernel/dpl/DebugP.h>
67 #include <drivers/hw_include/cslr_eqep.h>
68 
69 //*****************************************************************************
70 //
71 // Values that can be passed to EQEP_setDecoderConfig() as the config
72 // parameter.
73 //
74 //*****************************************************************************
75 
76 //
77 // Operation Mode
78 //
80 #define EQEP_CONFIG_QUADRATURE (0x0000U)
81 #define EQEP_CONFIG_CLOCK_DIR (0x4000U)
83 #define EQEP_CONFIG_UP_COUNT (0x8000U)
85 #define EQEP_CONFIG_DOWN_COUNT (0xC000U)
87 
88 //
89 // Resolution
90 //
92 #define EQEP_CONFIG_2X_RESOLUTION (0x0000U)
93 #define EQEP_CONFIG_1X_RESOLUTION (0x0800U)
95 
96 //
97 // Swap QEPA and QEPB
98 //
100 #define EQEP_CONFIG_NO_SWAP (0x0000U)
101 #define EQEP_CONFIG_SWAP (0x0400U)
103 
104 //*****************************************************************************
105 
106 //
107 // Values that can be passed to EQEP_setCompareConfig() as the config
108 // parameter.
109 //
110 //*****************************************************************************
111 
112 //
113 // Sync pulse pin
114 //
116 #define EQEP_COMPARE_NO_SYNC_OUT (0x0000U)
117 #define EQEP_COMPARE_IDX_SYNC_OUT (0x2000U)
119 #define EQEP_COMPARE_STROBE_SYNC_OUT (0x3000U)
121 
122 //
123 // Shadow register use
124 //
126 #define EQEP_COMPARE_NO_SHADOW (0x0000U)
127 #define EQEP_COMPARE_LOAD_ON_ZERO (0x8000U)
129 #define EQEP_COMPARE_LOAD_ON_MATCH (0xC000U)
131 
132 //*****************************************************************************
133 //
134 // Values that can be passed to EQEP_enableInterrupt(),
135 // EQEP_disableInterrupt(), and EQEP_clearInterruptStatus() as the
136 // intFlags parameter and returned by EQEP_clearInterruptStatus().
137 //
138 //*****************************************************************************
139 #define EQEP_INT_GLOBAL (0x0001U)
140 #define EQEP_INT_POS_CNT_ERROR (0x0002U)
141 #define EQEP_INT_PHASE_ERROR (0x0004U)
142 #define EQEP_INT_DIR_CHANGE (0x0008U)
143 #define EQEP_INT_WATCHDOG (0x0010U)
144 #define EQEP_INT_UNDERFLOW (0x0020U)
145 #define EQEP_INT_OVERFLOW (0x0040U)
146 #define EQEP_INT_POS_COMP_READY (0x0080U)
147 #define EQEP_INT_POS_COMP_MATCH (0x0100U)
148 #define EQEP_INT_STROBE_EVNT_LATCH (0x0200U)
149 #define EQEP_INT_INDEX_EVNT_LATCH (0x0400U)
150 #define EQEP_INT_UNIT_TIME_OUT (0x0800U)
151 #define EQEP_INT_QMA_ERROR (0x1000U)
152 
153 //*****************************************************************************
154 //
155 // Values that can be returned by EQEP_getStatus().
156 //
157 //*****************************************************************************
159 #define EQEP_STS_UNIT_POS_EVNT (0x0080U)
160 #define EQEP_STS_DIR_ON_1ST_IDX (0x0040U)
162 #define EQEP_STS_DIR_FLAG (0x0020U)
164 #define EQEP_STS_DIR_LATCH (0x0010U)
166 #define EQEP_STS_CAP_OVRFLW_ERROR (0x0008U)
168 #define EQEP_STS_CAP_DIR_ERROR (0x0004U)
170 #define EQEP_STS_1ST_IDX_FLAG (0x0002U)
172 #define EQEP_STS_POS_CNT_ERROR (0x0001U)
174 
175 //*****************************************************************************
176 //
177 // Values that can be passed to EQEP_setLatchMode() as the latchMode parameter.
178 //
179 //*****************************************************************************
180 
181 //
182 // Position counter latch event
183 //
184 #define EQEP_LATCH_CNT_READ_BY_CPU (0x0000U)
185 #define EQEP_LATCH_UNIT_TIME_OUT (0x0004U)
186 
187 //
188 // Strobe position counter latch event
189 //
191 #define EQEP_LATCH_RISING_STROBE (0x0000U)
192 #define EQEP_LATCH_EDGE_DIR_STROBE (0x0040U)
194 
195 //
196 // Index position counter latch event
197 //
198 #define EQEP_LATCH_RISING_INDEX (0x0010U)
199 #define EQEP_LATCH_FALLING_INDEX (0x0020U)
200 #define EQEP_LATCH_SW_INDEX_MARKER (0x0030U)
201 
202 //*****************************************************************************
203 //
204 // Values that can be passed to EQEP_setPositionInitMode() as the initMode
205 // parameter.
206 //
207 //*****************************************************************************
208 #define EQEP_INIT_DO_NOTHING (0x0000U)
209 
210 //
211 // Strobe events
212 //
214 #define EQEP_INIT_RISING_STROBE (0x0800U)
215 #define EQEP_INIT_EDGE_DIR_STROBE (0x0C00U)
217 
218 //
219 // Index events
220 //
221 #define EQEP_INIT_RISING_INDEX (0x0200U)
222 #define EQEP_INIT_FALLING_INDEX (0x0300U)
223 
224 //*****************************************************************************
225 //
228 //
229 //*****************************************************************************
230 typedef enum
231 {
241 
242 //*****************************************************************************
243 //
246 //
247 //*****************************************************************************
248 typedef enum
249 {
259 
260 //*****************************************************************************
261 //
264 //
265 //*****************************************************************************
266 typedef enum
267 {
281 
282 //*****************************************************************************
283 //
286 //
287 //*****************************************************************************
288 typedef enum
289 {
294 
295 //*****************************************************************************
296 //
299 //
300 //*****************************************************************************
301 typedef enum
302 {
305  EQEP_QMA_MODE_2 = 2
307 
308 //*****************************************************************************
309 //
312 //
313 //*****************************************************************************
314 typedef enum
315 {
316  EQEP_SOURCE_ZERO = 0x0000U,
347  EQEP_SOURCE_PWMXBAROUT29 = 0x001FU
349 
350 //*****************************************************************************
351 //
355 //
356 //*****************************************************************************
357 typedef struct {
362 
363 //*****************************************************************************
364 //
367 //
368 //*****************************************************************************
369 typedef enum
370 {
375 
376 //*****************************************************************************
377 //
388 //
389 //*****************************************************************************
390 static inline void
391 EQEP_enableModule(uint32_t base)
392 {
393  //
394  // Enable the eQEP module.
395  //
396  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
397  (HW_RD_REG16(base + CSL_EQEP_QEPCTL) | CSL_EQEP_QEPCTL_QPEN_MASK));
398 }
399 
400 //*****************************************************************************
401 //
410 //
411 //*****************************************************************************
412 static inline void
413 EQEP_disableModule(uint32_t base)
414 {
415  //
416  // Disable the eQEP module.
417  //
418  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
419  (HW_RD_REG16(base + CSL_EQEP_QEPCTL) & ~CSL_EQEP_QEPCTL_QPEN_MASK));
420 }
421 
422 //*****************************************************************************
423 //
445 //
446 //*****************************************************************************
447 static inline void
448 EQEP_setDecoderConfig(uint32_t base, uint16_t config)
449 {
450  //
451  // Write the new decoder configuration to the hardware.
452  //
453  HW_WR_REG16(base + CSL_EQEP_QDECCTL,
454  ((HW_RD_REG16(base + CSL_EQEP_QDECCTL) & ~(CSL_EQEP_QDECCTL_SWAP_MASK |
455  CSL_EQEP_QDECCTL_XCR_MASK | CSL_EQEP_QDECCTL_QSRC_MASK)) | config));
456 }
457 
458 //*****************************************************************************
459 //
477 //
478 //*****************************************************************************
479 static inline void
481  uint32_t maxPosition)
482 {
483  //
484  // Write the position counter reset configuration to the hardware.
485  //
486  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
487  ((HW_RD_REG16(base + CSL_EQEP_QEPCTL) & ~CSL_EQEP_QEPCTL_PCRM_MASK) |
488  (uint16_t)mode));
489 
490  //
491  // Set the maximum position.
492  //
493  HW_WR_REG32(base + CSL_EQEP_QPOSMAX, maxPosition);
494 }
495 
496 //*****************************************************************************
497 //
509 //
510 //*****************************************************************************
511 static inline uint32_t
512 EQEP_getPosition(uint32_t base)
513 {
514  //
515  // Return the current position counter.
516  //
517  return(HW_RD_REG32(base + CSL_EQEP_QPOSCNT));
518 }
519 
520 //*****************************************************************************
521 //
531 //
532 //*****************************************************************************
533 static inline void
534 EQEP_setPosition(uint32_t base, uint32_t position)
535 {
536  //
537  // Set the position counter.
538  //
539  HW_WR_REG32(base + CSL_EQEP_QPOSCNT, position);
540 }
541 
542 //*****************************************************************************
543 //
555 //
556 //*****************************************************************************
557 static inline int16_t
558 EQEP_getDirection(uint32_t base)
559 {
560  int16_t direction;
561 
562  //
563  // Return the direction of rotation.
564  //
565  if((HW_RD_REG16(base + CSL_EQEP_QEPSTS) & CSL_EQEP_QEPSTS_QDF_MASK) != 0U)
566  {
567  direction = 1;
568  }
569  else
570  {
571  direction = -1;
572  }
573 
574  return(direction);
575 }
576 
577 //*****************************************************************************
578 //
599 //
600 //*****************************************************************************
601 static inline void
602 EQEP_enableInterrupt(uint32_t base, uint16_t intFlags)
603 {
604  //
605  // Enable the specified interrupts.
606  //.
607  HW_WR_REG16(base + CSL_EQEP_QEINT,
608  (HW_RD_REG16(base + CSL_EQEP_QEINT) | intFlags));
609 }
610 
611 //*****************************************************************************
612 //
633 //
634 //*****************************************************************************
635 static inline void
636 EQEP_disableInterrupt(uint32_t base, uint16_t intFlags)
637 {
638  //
639  // Disable the specified interrupts.
640  //
641  HW_WR_REG16(base + CSL_EQEP_QEINT,
642  (HW_RD_REG16(base + CSL_EQEP_QEINT) & ~intFlags));
643 }
644 
645 //*****************************************************************************
646 //
668 //
669 //*****************************************************************************
670 static inline uint16_t
672 {
673  //
674  // Return Interrupt Status
675  //
676  return(HW_RD_REG16(base + CSL_EQEP_QFLG));
677 }
678 
679 //*****************************************************************************
680 //
705 //
706 //*****************************************************************************
707 static inline void
708 EQEP_clearInterruptStatus(uint32_t base, uint16_t intFlags)
709 {
710  //
711  // Clear the requested interrupt sources.
712  //
713  HW_WR_REG16(base + CSL_EQEP_QCLR, intFlags);
714 }
715 
716 //*****************************************************************************
717 //
738 //
739 //*****************************************************************************
740 static inline void
741 EQEP_forceInterrupt(uint32_t base, uint16_t intFlags)
742 {
743  //
744  // Force the specified interrupts.
745  //
746  HW_WR_REG16(base + CSL_EQEP_QFRC,
747  (HW_RD_REG16(base + CSL_EQEP_QFRC) | intFlags));
748 }
749 
750 //*****************************************************************************
751 //
761 //
762 //*****************************************************************************
763 static inline bool
764 EQEP_getError(uint32_t base)
765 {
766  //
767  // Return the error indicator.
768  //
769  return((HW_RD_REG16(base + CSL_EQEP_QFLG) & CSL_EQEP_QFLG_PHE_MASK) != 0U);
770 }
771 
772 //*****************************************************************************
773 //
795 //
796 //*****************************************************************************
797 static inline uint16_t
798 EQEP_getStatus(uint32_t base)
799 {
800  //
801  // Return the status register.
802  //
803  return(HW_RD_REG16(base + CSL_EQEP_QEPSTS) & 0x00FFU);
804 }
805 
806 //*****************************************************************************
807 //
828 //
829 //*****************************************************************************
830 static inline void
831 EQEP_clearStatus(uint32_t base, uint16_t statusFlags)
832 {
833  //
834  // Clear the requested interrupt sources.
835  //
836  HW_WR_REG16(base + CSL_EQEP_QEPSTS, statusFlags);
837 }
838 
839 //*****************************************************************************
840 //
864 //
865 //*****************************************************************************
866 static inline void
867 EQEP_setCaptureConfig(uint32_t base, EQEP_CAPCLKPrescale capPrescale,
868  EQEP_UPEVNTPrescale evntPrescale)
869 {
870  //
871  // Write new prescaler configurations to the appropriate registers.
872  //
873  HW_WR_REG16(base + CSL_EQEP_QCAPCTL,
874  ((HW_RD_REG16(base + CSL_EQEP_QCAPCTL) & ~(CSL_EQEP_QCAPCTL_UPPS_MASK |
875  CSL_EQEP_QCAPCTL_CCPS_MASK)) | ((uint16_t)evntPrescale |
876  (uint16_t)capPrescale)));
877 }
878 
879 //*****************************************************************************
880 //
888 //
889 //*****************************************************************************
890 static inline void
891 EQEP_enableCapture(uint32_t base)
892 {
893  //
894  // Enable edge capture.
895  //
896  HW_WR_REG16(base + CSL_EQEP_QCAPCTL,
897  (HW_RD_REG16(base + CSL_EQEP_QCAPCTL) | CSL_EQEP_QCAPCTL_CEN_MASK));
898 }
899 
900 //*****************************************************************************
901 //
909 //
910 //*****************************************************************************
911 static inline void
912 EQEP_disableCapture(uint32_t base)
913 {
914  //
915  // Disable edge capture.
916  //
917  HW_WR_REG16(base + CSL_EQEP_QCAPCTL,
918  (HW_RD_REG16(base + CSL_EQEP_QCAPCTL) & ~CSL_EQEP_QCAPCTL_CEN_MASK));
919 }
920 
921 //*****************************************************************************
922 //
931 //
932 //*****************************************************************************
933 static inline uint16_t
934 EQEP_getCapturePeriod(uint32_t base)
935 {
936  //
937  // Return the capture period.
938  //
939  return(HW_RD_REG16(base + CSL_EQEP_QCPRD));
940 }
941 
942 //*****************************************************************************
943 //
951 //
952 //*****************************************************************************
953 static inline uint16_t
954 EQEP_getCaptureTimer(uint32_t base)
955 {
956  //
957  // Return the capture timer value.
958  //
959  return(HW_RD_REG16(base + CSL_EQEP_QCTMR));
960 }
961 
962 //*****************************************************************************
963 //
971 //
972 //*****************************************************************************
973 static inline void
974 EQEP_enableCompare(uint32_t base)
975 {
976  //
977  // Enable position compare.
978  //
979  HW_WR_REG16(base + CSL_EQEP_QPOSCTL,
980  (HW_RD_REG16(base + CSL_EQEP_QPOSCTL) | CSL_EQEP_QPOSCTL_PCE_MASK));
981 }
982 
983 //*****************************************************************************
984 //
993 //
994 //*****************************************************************************
995 static inline void
996 EQEP_disableCompare(uint32_t base)
997 {
998  //
999  // Disable position compare.
1000  //
1001  HW_WR_REG16(base + CSL_EQEP_QPOSCTL,
1002  (HW_RD_REG16(base + CSL_EQEP_QPOSCTL) & ~CSL_EQEP_QPOSCTL_PCE_MASK));
1003 }
1004 
1005 //*****************************************************************************
1006 //
1018 //
1019 //*****************************************************************************
1020 static inline void
1021 EQEP_setComparePulseWidth(uint32_t base, uint16_t cycles)
1022 {
1023  //
1024  // Check the arguments.
1025  //
1026  DebugP_assert(cycles <= (CSL_EQEP_QPOSCTL_PCSPW_MASK + 1U));
1027 
1028  //
1029  // Set the pulse width.
1030  //
1031  HW_WR_REG16(base + CSL_EQEP_QPOSCTL,
1032  ((HW_RD_REG16(base + CSL_EQEP_QPOSCTL) &
1033  ~(uint16_t)CSL_EQEP_QPOSCTL_PCSPW_MASK) | (cycles - 1U)));
1034 }
1035 
1036 //*****************************************************************************
1037 //
1048 //
1049 //*****************************************************************************
1050 static inline void
1051 EQEP_loadUnitTimer(uint32_t base, uint32_t period)
1052 {
1053  //
1054  // Set the period of the unit timer.
1055  //
1056  HW_WR_REG32(base + CSL_EQEP_QUPRD, period);
1057 }
1058 
1059 //*****************************************************************************
1060 //
1071 //
1072 //*****************************************************************************
1073 static inline void
1074 EQEP_enableUnitTimer(uint32_t base, uint32_t period)
1075 {
1076  //
1077  // Set the period of the unit timer.
1078  //
1079  HW_WR_REG32(base + CSL_EQEP_QUPRD, period);
1080 
1081  //
1082  // Enable peripheral unit timer.
1083  //
1084  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1085  (HW_RD_REG16(base + CSL_EQEP_QEPCTL) | CSL_EQEP_QEPCTL_UTE_MASK));
1086 }
1087 
1088 //*****************************************************************************
1089 //
1098 //
1099 //*****************************************************************************
1100 static inline void
1102 {
1103  //
1104  // Disable peripheral unit timer.
1105  //
1106  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1107  (HW_RD_REG16(base + CSL_EQEP_QEPCTL) & ~CSL_EQEP_QEPCTL_UTE_MASK));
1108 }
1109 
1110 //*****************************************************************************
1111 //
1125 //
1126 //*****************************************************************************
1127 static inline void
1128 EQEP_enableWatchdog(uint32_t base, uint16_t period)
1129 {
1130  //
1131  // Set the timeout count for the eQEP peripheral watchdog timer.
1132  //
1133  HW_WR_REG16(base + CSL_EQEP_QWDPRD, period);
1134 
1135  //
1136  // Enable peripheral watchdog.
1137  //
1138  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1139  (HW_RD_REG16(base + CSL_EQEP_QEPCTL) | CSL_EQEP_QEPCTL_WDE_MASK));
1140 }
1141 
1142 //*****************************************************************************
1143 //
1152 //
1153 //*****************************************************************************
1154 static inline void
1155 EQEP_disableWatchdog(uint32_t base)
1156 {
1157  //
1158  // Disable peripheral watchdog.
1159  //
1160  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1161  (HW_RD_REG16(base + CSL_EQEP_QEPCTL) & ~CSL_EQEP_QEPCTL_WDE_MASK));
1162 }
1163 
1164 //*****************************************************************************
1165 //
1174 //
1175 //*****************************************************************************
1176 static inline void
1177 EQEP_setWatchdogTimerValue(uint32_t base, uint16_t value)
1178 {
1179  //
1180  // Write the value to the watchdog timer register.
1181  //
1182  HW_WR_REG16(base + CSL_EQEP_QWDTMR, value);
1183 }
1184 
1185 //*****************************************************************************
1186 //
1192 //
1193 //*****************************************************************************
1194 static inline uint16_t
1196 {
1197  //
1198  // Read the value from the watchdog timer register.
1199  //
1200  return(HW_RD_REG16(base + CSL_EQEP_QWDTMR));
1201 }
1202 
1203 //*****************************************************************************
1204 //
1227 //
1228 //*****************************************************************************
1229 static inline void
1230 EQEP_setPositionInitMode(uint32_t base, uint16_t initMode)
1231 {
1232  //
1233  // Set the init mode in the QEP Control register.
1234  //
1235  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1236  ((HW_RD_REG16(base + CSL_EQEP_QEPCTL) & ~(CSL_EQEP_QEPCTL_IEI_MASK |
1237  CSL_EQEP_QEPCTL_SEI_MASK)) | initMode));
1238 }
1239 
1240 //*****************************************************************************
1241 //
1257 //
1258 //*****************************************************************************
1259 static inline void
1260 EQEP_setSWPositionInit(uint32_t base, bool initialize)
1261 {
1262  //
1263  // Set or clear the software initialization bit.
1264  //
1265  if(initialize)
1266  {
1267  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1268  (HW_RD_REG16(base + CSL_EQEP_QEPCTL) | CSL_EQEP_QEPCTL_SWI_MASK));
1269  }
1270  else
1271  {
1272  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1273  (HW_RD_REG16(base + CSL_EQEP_QEPCTL) & ~CSL_EQEP_QEPCTL_SWI_MASK));
1274  }
1275 }
1276 
1277 //*****************************************************************************
1278 //
1290 //
1291 //*****************************************************************************
1292 static inline void
1293 EQEP_setInitialPosition(uint32_t base, uint32_t position)
1294 {
1295  //
1296  // Write position to position counter init register
1297  //
1298  HW_WR_REG32(base + CSL_EQEP_QPOSINIT, position);
1299 }
1300 
1301 //*****************************************************************************
1302 //
1329 //
1330 //*****************************************************************************
1331 static inline void
1332 EQEP_setLatchMode(uint32_t base, uint32_t latchMode)
1333 {
1334  //
1335  // Set the latch mode in the QEP Control register.
1336  //
1337  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1338  ((HW_RD_REG16(base + CSL_EQEP_QEPCTL) & ~(CSL_EQEP_QEPCTL_QCLM_MASK |
1339  CSL_EQEP_QEPCTL_IEL_MASK | CSL_EQEP_QEPCTL_SEL_MASK)) | latchMode));
1340 }
1341 
1342 //*****************************************************************************
1343 //
1354 //
1355 //*****************************************************************************
1356 static inline uint32_t
1358 {
1359  //
1360  // Return the current position counter.
1361  //
1362  return(HW_RD_REG32(base + CSL_EQEP_QPOSILAT));
1363 }
1364 
1365 //*****************************************************************************
1366 //
1378 //
1379 //*****************************************************************************
1380 static inline uint32_t
1382 {
1383  //
1384  // Return the current position counter.
1385  //
1386  return(HW_RD_REG32(base + CSL_EQEP_QPOSSLAT));
1387 }
1388 
1389 //*****************************************************************************
1390 //
1400 //
1401 //*****************************************************************************
1402 static inline uint32_t
1404 {
1405  //
1406  // Return the current position counter.
1407  //
1408  return(HW_RD_REG32(base + CSL_EQEP_QPOSLAT));
1409 }
1410 
1411 //*****************************************************************************
1412 //
1423 //
1424 //*****************************************************************************
1425 static inline uint16_t
1427 {
1428  //
1429  // Return the current position counter.
1430  //
1431  return(HW_RD_REG16(base + CSL_EQEP_QCTMRLAT));
1432 }
1433 
1434 //*****************************************************************************
1435 //
1446 //
1447 //*****************************************************************************
1448 static inline uint16_t
1450 {
1451  //
1452  // Return the current position counter.
1453  //
1454  return(HW_RD_REG16(base + CSL_EQEP_QCPRDLAT));
1455 }
1456 
1457 //*****************************************************************************
1458 //
1473 //
1474 //*****************************************************************************
1475 static inline void
1476 EQEP_setQMAModuleMode(uint32_t base, EQEP_QMAMode qmaMode)
1477 {
1478  //
1479  // Write the QMA module mode into the appropriate register.
1480  //
1481  HW_WR_REG16(base + CSL_EQEP_QMACTRL,
1482  ((HW_RD_REG16(base + CSL_EQEP_QMACTRL) & ~CSL_EQEP_QMACTRL_MODE_MASK) |
1483  (uint16_t)qmaMode));
1484 }
1485 
1486 //*****************************************************************************
1487 //
1503 //
1504 //*****************************************************************************
1505 static inline void
1506 EQEP_setStrobeSource(uint32_t base, EQEP_StrobeSource strobeSrc)
1507 {
1508  //
1509  // Write the strobe source selection into the appropriate register.
1510  //
1511  HW_WR_REG16(base + CSL_EQEP_QEPSTROBESEL,
1512  ((HW_RD_REG16(base + CSL_EQEP_QEPSTROBESEL) &
1513  ~CSL_EQEP_QEPSTROBESEL_STROBESEL_MASK) | (uint16_t)strobeSrc));
1514 }
1515 
1516 //*****************************************************************************
1517 //
1526 //
1527 //*****************************************************************************
1528 static inline void
1530 {
1531  //
1532  //Sets the index direction enhancement bit
1533  //
1534  HW_WR_REG16(base + CSL_EQEP_QDECCTL,
1535  (HW_RD_REG16(base + CSL_EQEP_QDECCTL) | CSL_EQEP_QDECCTL_QIDIRE_MASK));
1536 }
1537 
1538 //*****************************************************************************
1539 //
1548 //
1549 //*****************************************************************************
1550 static inline void
1552 {
1553  //
1554  //Clears the index direction enhancement bit
1555  //
1556  HW_WR_REG16(base + CSL_EQEP_QDECCTL,
1557  (HW_RD_REG16(base + CSL_EQEP_QDECCTL) & ~CSL_EQEP_QDECCTL_QIDIRE_MASK));
1558 }
1559 
1560 //*****************************************************************************
1561 //
1571 //
1572 //*****************************************************************************
1573 static inline void
1574 EQEP_selectSource(uint32_t base, EQEP_SourceSelect sourceConfig )
1575 {
1576  //
1577  // Selecting sources for eQEP signals
1578  //
1579  HW_WR_REG32(base + CSL_EQEP_QEPSRCSEL,
1580  ((HW_RD_REG32(base + CSL_EQEP_QEPSRCSEL) &
1581  ~(CSL_EQEP_QEPSRCSEL_QEPASEL_MASK | CSL_EQEP_QEPSRCSEL_QEPBSEL_MASK |
1582  CSL_EQEP_QEPSRCSEL_QEPISEL_MASK)) |
1583  ((uint32_t)((uint32_t)(sourceConfig.sourceA) <<
1584  CSL_EQEP_QEPSRCSEL_QEPASEL_SHIFT) |
1585  (uint32_t)((uint32_t)(sourceConfig.sourceB) <<
1586  CSL_EQEP_QEPSRCSEL_QEPBSEL_SHIFT) |
1587  (uint32_t)((uint32_t)(sourceConfig.sourceIndex) <<
1588  CSL_EQEP_QEPSRCSEL_QEPISEL_SHIFT))));
1589 }
1590 
1591 //*****************************************************************************
1592 //
1611 //
1612 //*****************************************************************************
1613 static inline void
1615 {
1616  //
1617  // Write the emulation mode to the FREE_SOFT bits.
1618  //
1619  HW_WR_REG16(base + CSL_EQEP_QEPCTL,
1620  ((HW_RD_REG16(base + CSL_EQEP_QEPCTL) &
1621  ~CSL_EQEP_QEPSRCSEL_QEPISEL_SHIFT) |
1622  ((uint16_t)emuMode << CSL_EQEP_QEPCTL_FREE_SOFT_SHIFT)));
1623 }
1624 
1625 //*****************************************************************************
1626 //
1656 //
1657 //*****************************************************************************
1658 extern void
1659 EQEP_setCompareConfig(uint32_t base, uint16_t config, uint32_t compareValue,
1660  uint16_t cycles);
1661 
1662 //*****************************************************************************
1663 //
1677 //
1678 //*****************************************************************************
1679 extern void
1680 EQEP_setInputPolarity(uint32_t base, bool invertQEPA, bool invertQEPB,
1681  bool invertIndex, bool invertStrobe);
1682 
1683 //*****************************************************************************
1684 //
1685 // Close the Doxygen group.
1687 //
1688 //*****************************************************************************
1689 
1690 //*****************************************************************************
1691 //
1692 // Mark the end of the C bindings section for C++ compilers.
1693 //
1694 //*****************************************************************************
1695 #ifdef __cplusplus
1696 }
1697 #endif
1698 
1699 #endif // EQEP_V1_H_
EQEP_enableDirectionChangeDuringIndex
static void EQEP_enableDirectionChangeDuringIndex(uint32_t base)
Definition: eqep/v1/eqep.h:1529
EQEP_SOURCE_PWMXBAROUT11
@ EQEP_SOURCE_PWMXBAROUT11
Signal comes from PWM Xbar out 11.
Definition: eqep/v1/eqep.h:329
EQEP_getCapturePeriodLatch
static uint16_t EQEP_getCapturePeriodLatch(uint32_t base)
Definition: eqep/v1/eqep.h:1449
EQEP_CAPTURE_CLK_DIV_32
@ EQEP_CAPTURE_CLK_DIV_32
CAPCLK = SYSCLKOUT/32.
Definition: eqep/v1/eqep.h:255
EQEP_SOURCE_PWMXBAROUT23
@ EQEP_SOURCE_PWMXBAROUT23
Signal comes from PWM Xbar out 23.
Definition: eqep/v1/eqep.h:341
EQEP_UNIT_POS_EVNT_DIV_2
@ EQEP_UNIT_POS_EVNT_DIV_2
UPEVNT = QCLK/2.
Definition: eqep/v1/eqep.h:269
EQEP_POSITION_RESET_MAX_POS
@ EQEP_POSITION_RESET_MAX_POS
Reset position on maximum position.
Definition: eqep/v1/eqep.h:235
EQEP_setInputPolarity
void EQEP_setInputPolarity(uint32_t base, bool invertQEPA, bool invertQEPB, bool invertIndex, bool invertStrobe)
EQEP_UNIT_POS_EVNT_DIV_2048
@ EQEP_UNIT_POS_EVNT_DIV_2048
UPEVNT = QCLK/2048.
Definition: eqep/v1/eqep.h:279
EQEP_enableModule
static void EQEP_enableModule(uint32_t base)
Definition: eqep/v1/eqep.h:391
EQEP_getPosition
static uint32_t EQEP_getPosition(uint32_t base)
Definition: eqep/v1/eqep.h:512
EQEP_SOURCE_PWMXBAROUT29
@ EQEP_SOURCE_PWMXBAROUT29
Signal comes from PWM Xbar out 29.
Definition: eqep/v1/eqep.h:347
EQEP_SOURCE_PWMXBAROUT8
@ EQEP_SOURCE_PWMXBAROUT8
Signal comes from PWM Xbar out 8.
Definition: eqep/v1/eqep.h:326
EQEP_disableCapture
static void EQEP_disableCapture(uint32_t base)
Definition: eqep/v1/eqep.h:912
EQEP_POSITION_RESET_1ST_IDX
@ EQEP_POSITION_RESET_1ST_IDX
Reset position on the first index pulse.
Definition: eqep/v1/eqep.h:237
EQEP_setDecoderConfig
static void EQEP_setDecoderConfig(uint32_t base, uint16_t config)
Definition: eqep/v1/eqep.h:448
EQEP_setCaptureConfig
static void EQEP_setCaptureConfig(uint32_t base, EQEP_CAPCLKPrescale capPrescale, EQEP_UPEVNTPrescale evntPrescale)
Definition: eqep/v1/eqep.h:867
EQEP_SOURCE_PWMXBAROUT21
@ EQEP_SOURCE_PWMXBAROUT21
Signal comes from PWM Xbar out 21.
Definition: eqep/v1/eqep.h:339
EQEP_setLatchMode
static void EQEP_setLatchMode(uint32_t base, uint32_t latchMode)
Definition: eqep/v1/eqep.h:1332
EQEP_disableCompare
static void EQEP_disableCompare(uint32_t base)
Definition: eqep/v1/eqep.h:996
EQEP_StrobeSource
EQEP_StrobeSource
Definition: eqep/v1/eqep.h:289
EQEP_CAPTURE_CLK_DIV_2
@ EQEP_CAPTURE_CLK_DIV_2
CAPCLK = SYSCLKOUT/2.
Definition: eqep/v1/eqep.h:251
EQEP_SOURCE_PWMXBAROUT9
@ EQEP_SOURCE_PWMXBAROUT9
Signal comes from PWM Xbar out 9.
Definition: eqep/v1/eqep.h:327
EQEP_disableInterrupt
static void EQEP_disableInterrupt(uint32_t base, uint16_t intFlags)
Definition: eqep/v1/eqep.h:636
EQEP_CAPTURE_CLK_DIV_8
@ EQEP_CAPTURE_CLK_DIV_8
CAPCLK = SYSCLKOUT/8.
Definition: eqep/v1/eqep.h:253
EQEP_SOURCE_PWMXBAROUT2
@ EQEP_SOURCE_PWMXBAROUT2
Signal comes from PWM Xbar out 2.
Definition: eqep/v1/eqep.h:320
EQEP_setInitialPosition
static void EQEP_setInitialPosition(uint32_t base, uint32_t position)
Definition: eqep/v1/eqep.h:1293
EQEP_getWatchdogTimerValue
static uint16_t EQEP_getWatchdogTimerValue(uint32_t base)
Definition: eqep/v1/eqep.h:1195
EQEP_selectSource
static void EQEP_selectSource(uint32_t base, EQEP_SourceSelect sourceConfig)
Definition: eqep/v1/eqep.h:1574
EQEP_STROBE_OR_ADCSOCB
@ EQEP_STROBE_OR_ADCSOCB
Strobe signal is OR'd with ADCSOCB.
Definition: eqep/v1/eqep.h:292
EQEP_disableDirectionChangeDuringIndex
static void EQEP_disableDirectionChangeDuringIndex(uint32_t base)
Definition: eqep/v1/eqep.h:1551
EQEP_loadUnitTimer
static void EQEP_loadUnitTimer(uint32_t base, uint32_t period)
Definition: eqep/v1/eqep.h:1051
EQEP_SOURCE_PWMXBAROUT16
@ EQEP_SOURCE_PWMXBAROUT16
Signal comes from PWM Xbar out 16.
Definition: eqep/v1/eqep.h:334
EQEP_getCaptureTimerLatch
static uint16_t EQEP_getCaptureTimerLatch(uint32_t base)
Definition: eqep/v1/eqep.h:1426
EQEP_QMA_MODE_BYPASS
@ EQEP_QMA_MODE_BYPASS
QMA module is bypassed.
Definition: eqep/v1/eqep.h:303
EQEP_UPEVNTPrescale
EQEP_UPEVNTPrescale
Definition: eqep/v1/eqep.h:267
EQEP_setPosition
static void EQEP_setPosition(uint32_t base, uint32_t position)
Definition: eqep/v1/eqep.h:534
EQEP_PositionResetMode
EQEP_PositionResetMode
Definition: eqep/v1/eqep.h:231
EQEP_enableUnitTimer
static void EQEP_enableUnitTimer(uint32_t base, uint32_t period)
Definition: eqep/v1/eqep.h:1074
EQEP_enableInterrupt
static void EQEP_enableInterrupt(uint32_t base, uint16_t intFlags)
Definition: eqep/v1/eqep.h:602
EQEP_disableUnitTimer
static void EQEP_disableUnitTimer(uint32_t base)
Definition: eqep/v1/eqep.h:1101
EQEP_disableModule
static void EQEP_disableModule(uint32_t base)
Definition: eqep/v1/eqep.h:413
EQEP_SOURCE_PWMXBAROUT4
@ EQEP_SOURCE_PWMXBAROUT4
Signal comes from PWM Xbar out 4.
Definition: eqep/v1/eqep.h:322
EQEP_SourceSelect::sourceA
EQEP_Source sourceA
Definition: eqep/v1/eqep.h:358
EQEP_getPositionLatch
static uint32_t EQEP_getPositionLatch(uint32_t base)
Definition: eqep/v1/eqep.h:1403
EQEP_CAPCLKPrescale
EQEP_CAPCLKPrescale
Definition: eqep/v1/eqep.h:249
EQEP_STROBE_FROM_GPIO
@ EQEP_STROBE_FROM_GPIO
Strobe signal comes from GPIO.
Definition: eqep/v1/eqep.h:290
EQEP_CAPTURE_CLK_DIV_16
@ EQEP_CAPTURE_CLK_DIV_16
CAPCLK = SYSCLKOUT/16.
Definition: eqep/v1/eqep.h:254
EQEP_SOURCE_PWMXBAROUT26
@ EQEP_SOURCE_PWMXBAROUT26
Signal comes from PWM Xbar out 26.
Definition: eqep/v1/eqep.h:344
EQEP_SOURCE_PWMXBAROUT18
@ EQEP_SOURCE_PWMXBAROUT18
Signal comes from PWM Xbar out 18.
Definition: eqep/v1/eqep.h:336
EQEP_getCapturePeriod
static uint16_t EQEP_getCapturePeriod(uint32_t base)
Definition: eqep/v1/eqep.h:934
EQEP_getStrobePositionLatch
static uint32_t EQEP_getStrobePositionLatch(uint32_t base)
Definition: eqep/v1/eqep.h:1381
EQEP_POSITION_RESET_IDX
@ EQEP_POSITION_RESET_IDX
Reset position on index pulse.
Definition: eqep/v1/eqep.h:233
EQEP_UNIT_POS_EVNT_DIV_32
@ EQEP_UNIT_POS_EVNT_DIV_32
UPEVNT = QCLK/32.
Definition: eqep/v1/eqep.h:273
EQEP_CAPTURE_CLK_DIV_128
@ EQEP_CAPTURE_CLK_DIV_128
CAPCLK = SYSCLKOUT/128.
Definition: eqep/v1/eqep.h:257
EQEP_forceInterrupt
static void EQEP_forceInterrupt(uint32_t base, uint16_t intFlags)
Definition: eqep/v1/eqep.h:741
EQEP_SOURCE_PWMXBAROUT24
@ EQEP_SOURCE_PWMXBAROUT24
Signal comes from PWM Xbar out 24.
Definition: eqep/v1/eqep.h:342
EQEP_SOURCE_PWMXBAROUT0
@ EQEP_SOURCE_PWMXBAROUT0
Signal comes from PWM Xbar out 0.
Definition: eqep/v1/eqep.h:318
EQEP_SourceSelect::sourceB
EQEP_Source sourceB
Definition: eqep/v1/eqep.h:359
EQEP_enableCompare
static void EQEP_enableCompare(uint32_t base)
Definition: eqep/v1/eqep.h:974
EQEP_SourceSelect::sourceIndex
EQEP_Source sourceIndex
Definition: eqep/v1/eqep.h:360
EQEP_getInterruptStatus
static uint16_t EQEP_getInterruptStatus(uint32_t base)
Definition: eqep/v1/eqep.h:671
EQEP_SOURCE_PWMXBAROUT3
@ EQEP_SOURCE_PWMXBAROUT3
Signal comes from PWM Xbar out 3.
Definition: eqep/v1/eqep.h:321
EQEP_SOURCE_PWMXBAROUT5
@ EQEP_SOURCE_PWMXBAROUT5
Signal comes from PWM Xbar out 5.
Definition: eqep/v1/eqep.h:323
EQEP_SOURCE_PWMXBAROUT15
@ EQEP_SOURCE_PWMXBAROUT15
Signal comes from PWM Xbar out 15.
Definition: eqep/v1/eqep.h:333
EQEP_getCaptureTimer
static uint16_t EQEP_getCaptureTimer(uint32_t base)
Definition: eqep/v1/eqep.h:954
EQEP_CAPTURE_CLK_DIV_1
@ EQEP_CAPTURE_CLK_DIV_1
CAPCLK = SYSCLKOUT/1.
Definition: eqep/v1/eqep.h:250
EQEP_clearInterruptStatus
static void EQEP_clearInterruptStatus(uint32_t base, uint16_t intFlags)
Definition: eqep/v1/eqep.h:708
EQEP_Source
EQEP_Source
Definition: eqep/v1/eqep.h:315
EQEP_STROBE_OR_ADCSOCA
@ EQEP_STROBE_OR_ADCSOCA
Strobe signal is OR'd with ADCSOCA.
Definition: eqep/v1/eqep.h:291
EQEP_disableWatchdog
static void EQEP_disableWatchdog(uint32_t base)
Definition: eqep/v1/eqep.h:1155
EQEP_SOURCE_PWMXBAROUT6
@ EQEP_SOURCE_PWMXBAROUT6
Signal comes from PWM Xbar out 6.
Definition: eqep/v1/eqep.h:324
EQEP_setStrobeSource
static void EQEP_setStrobeSource(uint32_t base, EQEP_StrobeSource strobeSrc)
Definition: eqep/v1/eqep.h:1506
EQEP_setPositionCounterConfig
static void EQEP_setPositionCounterConfig(uint32_t base, EQEP_PositionResetMode mode, uint32_t maxPosition)
Definition: eqep/v1/eqep.h:480
EQEP_UNIT_POS_EVNT_DIV_8
@ EQEP_UNIT_POS_EVNT_DIV_8
UPEVNT = QCLK/8.
Definition: eqep/v1/eqep.h:271
EQEP_SOURCE_PWMXBAROUT12
@ EQEP_SOURCE_PWMXBAROUT12
Signal comes from PWM Xbar out 12.
Definition: eqep/v1/eqep.h:330
EQEP_SOURCE_ZERO
@ EQEP_SOURCE_ZERO
Signal is 0.
Definition: eqep/v1/eqep.h:316
EQEP_UNIT_POS_EVNT_DIV_4
@ EQEP_UNIT_POS_EVNT_DIV_4
UPEVNT = QCLK/4.
Definition: eqep/v1/eqep.h:270
EQEP_clearStatus
static void EQEP_clearStatus(uint32_t base, uint16_t statusFlags)
Definition: eqep/v1/eqep.h:831
EQEP_getStatus
static uint16_t EQEP_getStatus(uint32_t base)
Definition: eqep/v1/eqep.h:798
EQEP_SOURCE_PWMXBAROUT27
@ EQEP_SOURCE_PWMXBAROUT27
Signal comes from PWM Xbar out 27.
Definition: eqep/v1/eqep.h:345
EQEP_SOURCE_DEVICE_PIN
@ EQEP_SOURCE_DEVICE_PIN
Signal comes from Device Pin.
Definition: eqep/v1/eqep.h:317
EQEP_SOURCE_PWMXBAROUT10
@ EQEP_SOURCE_PWMXBAROUT10
Signal comes from PWM Xbar out 10.
Definition: eqep/v1/eqep.h:328
EQEP_getIndexPositionLatch
static uint32_t EQEP_getIndexPositionLatch(uint32_t base)
Definition: eqep/v1/eqep.h:1357
EQEP_SOURCE_PWMXBAROUT22
@ EQEP_SOURCE_PWMXBAROUT22
Signal comes from PWM Xbar out 22.
Definition: eqep/v1/eqep.h:340
EQEP_EmulationMode
EQEP_EmulationMode
Definition: eqep/v1/eqep.h:370
EQEP_enableWatchdog
static void EQEP_enableWatchdog(uint32_t base, uint16_t period)
Definition: eqep/v1/eqep.h:1128
EQEP_setSWPositionInit
static void EQEP_setSWPositionInit(uint32_t base, bool initialize)
Definition: eqep/v1/eqep.h:1260
EQEP_QMA_MODE_2
@ EQEP_QMA_MODE_2
QMA mode-2 operation is selected.
Definition: eqep/v1/eqep.h:305
EQEP_getDirection
static int16_t EQEP_getDirection(uint32_t base)
Definition: eqep/v1/eqep.h:558
EQEP_UNIT_POS_EVNT_DIV_512
@ EQEP_UNIT_POS_EVNT_DIV_512
UPEVNT = QCLK/512.
Definition: eqep/v1/eqep.h:277
EQEP_setEmulationMode
static void EQEP_setEmulationMode(uint32_t base, EQEP_EmulationMode emuMode)
Definition: eqep/v1/eqep.h:1614
DebugP.h
EQEP_setQMAModuleMode
static void EQEP_setQMAModuleMode(uint32_t base, EQEP_QMAMode qmaMode)
Definition: eqep/v1/eqep.h:1476
EQEP_UNIT_POS_EVNT_DIV_1024
@ EQEP_UNIT_POS_EVNT_DIV_1024
UPEVNT = QCLK/1024.
Definition: eqep/v1/eqep.h:278
EQEP_SourceSelect
Definition: eqep/v1/eqep.h:357
EQEP_enableCapture
static void EQEP_enableCapture(uint32_t base)
Definition: eqep/v1/eqep.h:891
EQEP_getError
static bool EQEP_getError(uint32_t base)
Definition: eqep/v1/eqep.h:764
EQEP_EMULATIONMODE_STOPATROLLOVER
@ EQEP_EMULATIONMODE_STOPATROLLOVER
Counters stop at period rollover.
Definition: eqep/v1/eqep.h:372
EQEP_SOURCE_PWMXBAROUT14
@ EQEP_SOURCE_PWMXBAROUT14
Signal comes from PWM Xbar out 14.
Definition: eqep/v1/eqep.h:332
EQEP_QMAMode
EQEP_QMAMode
Definition: eqep/v1/eqep.h:302
EQEP_UNIT_POS_EVNT_DIV_64
@ EQEP_UNIT_POS_EVNT_DIV_64
UPEVNT = QCLK/64.
Definition: eqep/v1/eqep.h:274
EQEP_SOURCE_PWMXBAROUT19
@ EQEP_SOURCE_PWMXBAROUT19
Signal comes from PWM Xbar out 19.
Definition: eqep/v1/eqep.h:337
EQEP_SOURCE_PWMXBAROUT25
@ EQEP_SOURCE_PWMXBAROUT25
Signal comes from PWM Xbar out 25.
Definition: eqep/v1/eqep.h:343
EQEP_setCompareConfig
void EQEP_setCompareConfig(uint32_t base, uint16_t config, uint32_t compareValue, uint16_t cycles)
EQEP_EMULATIONMODE_STOPIMMEDIATELY
@ EQEP_EMULATIONMODE_STOPIMMEDIATELY
Counters stop immediately.
Definition: eqep/v1/eqep.h:371
EQEP_SOURCE_PWMXBAROUT28
@ EQEP_SOURCE_PWMXBAROUT28
Signal comes from PWM Xbar out 28.
Definition: eqep/v1/eqep.h:346
EQEP_SOURCE_PWMXBAROUT13
@ EQEP_SOURCE_PWMXBAROUT13
Signal comes from PWM Xbar out 13.
Definition: eqep/v1/eqep.h:331
EQEP_setWatchdogTimerValue
static void EQEP_setWatchdogTimerValue(uint32_t base, uint16_t value)
Definition: eqep/v1/eqep.h:1177
EQEP_SOURCE_PWMXBAROUT7
@ EQEP_SOURCE_PWMXBAROUT7
Signal comes from PWM Xbar out 7.
Definition: eqep/v1/eqep.h:325
EQEP_CAPTURE_CLK_DIV_4
@ EQEP_CAPTURE_CLK_DIV_4
CAPCLK = SYSCLKOUT/4.
Definition: eqep/v1/eqep.h:252
EQEP_setPositionInitMode
static void EQEP_setPositionInitMode(uint32_t base, uint16_t initMode)
Definition: eqep/v1/eqep.h:1230
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:159
EQEP_QMA_MODE_1
@ EQEP_QMA_MODE_1
QMA mode-1 operation is selected.
Definition: eqep/v1/eqep.h:304
EQEP_UNIT_POS_EVNT_DIV_16
@ EQEP_UNIT_POS_EVNT_DIV_16
UPEVNT = QCLK/16.
Definition: eqep/v1/eqep.h:272
EQEP_setComparePulseWidth
static void EQEP_setComparePulseWidth(uint32_t base, uint16_t cycles)
Definition: eqep/v1/eqep.h:1021
EQEP_CAPTURE_CLK_DIV_64
@ EQEP_CAPTURE_CLK_DIV_64
CAPCLK = SYSCLKOUT/64.
Definition: eqep/v1/eqep.h:256
EQEP_SOURCE_PWMXBAROUT1
@ EQEP_SOURCE_PWMXBAROUT1
Signal comes from PWM Xbar out 1.
Definition: eqep/v1/eqep.h:319
EQEP_UNIT_POS_EVNT_DIV_128
@ EQEP_UNIT_POS_EVNT_DIV_128
UPEVNT = QCLK/128.
Definition: eqep/v1/eqep.h:275
EQEP_SOURCE_PWMXBAROUT17
@ EQEP_SOURCE_PWMXBAROUT17
Signal comes from PWM Xbar out 17.
Definition: eqep/v1/eqep.h:335
EQEP_UNIT_POS_EVNT_DIV_256
@ EQEP_UNIT_POS_EVNT_DIV_256
UPEVNT = QCLK/256.
Definition: eqep/v1/eqep.h:276
EQEP_EMULATIONMODE_RUNFREE
@ EQEP_EMULATIONMODE_RUNFREE
Counter unaffected by suspend.
Definition: eqep/v1/eqep.h:373
EQEP_UNIT_POS_EVNT_DIV_1
@ EQEP_UNIT_POS_EVNT_DIV_1
UPEVNT = QCLK/1.
Definition: eqep/v1/eqep.h:268
EQEP_POSITION_RESET_UNIT_TIME_OUT
@ EQEP_POSITION_RESET_UNIT_TIME_OUT
Reset position on a unit time event.
Definition: eqep/v1/eqep.h:239
EQEP_SOURCE_PWMXBAROUT20
@ EQEP_SOURCE_PWMXBAROUT20
Signal comes from PWM Xbar out 20.
Definition: eqep/v1/eqep.h:338