AM263x MCU+ SDK  09.02.00
adc/v1/adc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021-2023 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 ADC_V1_H_
43 #define ADC_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 #include <stdint.h>
62 #include <stdbool.h>
63 #include <drivers/hw_include/hw_types.h>
64 #include <drivers/hw_include/cslr_soc.h>
65 #include <kernel/dpl/DebugP.h>
66 #include <drivers/hw_include/cslr_adc.h>
67 
68 //*****************************************************************************
69 //
70 // Values that can be passed to ADC_enablePPBEvent(), ADC_disablePPBEvent(),
71 // ADC_enablePPBEventInterrupt(), ADC_disablePPBEventInterrupt(), and
72 // ADC_clearPPBEventStatus() as the intFlags and evtFlags parameters. They also
73 // make up the enumerated bit field returned by ADC_getPPBEventStatus().
74 //
75 //*****************************************************************************
76 #define ADC_EVT_TRIPHI (0x0001U)
77 #define ADC_EVT_TRIPLO (0x0002U)
78 #define ADC_EVT_ZERO (0x0004U)
79 
80 //*****************************************************************************
81 //
82 // Values that can be passed to ADC_forceMultipleSOC() as socMask parameter.
83 // These values can be OR'd together to trigger multiple SOCs at a time.
84 //
85 //*****************************************************************************
86 #define ADC_FORCE_SOC0 (0x0001U)
87 #define ADC_FORCE_SOC1 (0x0002U)
88 #define ADC_FORCE_SOC2 (0x0004U)
89 #define ADC_FORCE_SOC3 (0x0008U)
90 #define ADC_FORCE_SOC4 (0x0010U)
91 #define ADC_FORCE_SOC5 (0x0020U)
92 #define ADC_FORCE_SOC6 (0x0040U)
93 #define ADC_FORCE_SOC7 (0x0080U)
94 #define ADC_FORCE_SOC8 (0x0100U)
95 #define ADC_FORCE_SOC9 (0x0200U)
96 #define ADC_FORCE_SOC10 (0x0400U)
97 #define ADC_FORCE_SOC11 (0x0800U)
98 #define ADC_FORCE_SOC12 (0x1000U)
99 #define ADC_FORCE_SOC13 (0x2000U)
100 #define ADC_FORCE_SOC14 (0x4000U)
101 #define ADC_FORCE_SOC15 (0x8000U)
102 
103 //*****************************************************************************
104 //
107 //
108 //*****************************************************************************
109 typedef enum
110 {
125  ADC_CLK_DIV_8_5 = 15
127 
128 //*****************************************************************************
129 //
132 //
133 //*****************************************************************************
134 typedef enum
135 {
138 
139 //*****************************************************************************
140 //
143 //
144 //*****************************************************************************
145 typedef enum
146 {
150 
151 //*****************************************************************************
152 //
156 //
157 //*****************************************************************************
158 typedef enum
159 {
241 
242 //*****************************************************************************
243 //
247 //
248 //*****************************************************************************
249 typedef enum
250 {
266 } ADC_Channel;
267 
268 //*****************************************************************************
269 //
272 //
273 //*****************************************************************************
274 typedef enum
275 {
281 
282 //*****************************************************************************
283 //
289 //
290 //*****************************************************************************
291 typedef enum
292 {
296  ADC_INT_NUMBER4 = 3
298 
299 //*****************************************************************************
300 //
303 //
304 //*****************************************************************************
305 typedef enum
306 {
310  ADC_PPB_NUMBER4 = 3
312 
313 //*****************************************************************************
314 //
320 //
321 //*****************************************************************************
322 typedef enum
323 {
339  ADC_SOC_NUMBER15 = 15
341 
342 //*****************************************************************************
343 //
346 //
347 //*****************************************************************************
348 typedef enum
349 {
354 
355 //*****************************************************************************
356 //
359 //
360 //*****************************************************************************
361 typedef enum
362 {
379  ADC_PRI_ALL_HIPRI = 16
381 
382 //*****************************************************************************
383 //
385 //
386 //*****************************************************************************
388 #define ADC_ADCSOCxCTL_STEP (CSL_ADC_ADCSOC1CTL - CSL_ADC_ADCSOC0CTL)
389 #define ADC_ADCINTSELxNy_STEP (CSL_ADC_ADCINTSEL3N4 - CSL_ADC_ADCINTSEL1N2)
391 #define ADC_ADCPPBx_STEP (CSL_ADC_ADCPPB2CONFIG - CSL_ADC_ADCPPB1CONFIG)
393 #define ADC_ADCPPBTRIP_MASK ((uint32_t)CSL_ADC_ADCPPB1TRIPHI_LIMITHI_MASK \
395  | (uint32_t)CSL_ADC_ADCPPB1TRIPHI_HSIGN_MASK)
396 #define ADC_RESULT_ADCPPBxRESULT_STEP (CSL_ADC_RESULT_ADCPPB2RESULT -\
398  CSL_ADC_RESULT_ADCPPB1RESULT)
399 #define ADC_RESULT_ADCRESULTx_STEP (CSL_ADC_RESULT_ADCRESULT1 - \
401  CSL_ADC_RESULT_ADCRESULT0)
402 
403 //*****************************************************************************
404 //
405 // Prototypes for the APIs.
406 //
407 //*****************************************************************************
408 //*****************************************************************************
409 //
424 //
425 //*****************************************************************************
426 static inline void
427 ADC_setPrescaler(uint32_t base, ADC_ClkPrescale clkPrescale)
428 {
429  //
430  // Set the configuration of the ADC module prescaler.
431  //
432  HW_WR_REG16(base + CSL_ADC_ADCCTL2,
433  ((HW_RD_REG16(base + CSL_ADC_ADCCTL2) &
434  ~CSL_ADC_ADCCTL2_PRESCALE_MASK) | (uint16_t)clkPrescale));
435 }
436 
437 //*****************************************************************************
438 //
472 //
473 //*****************************************************************************
474 static inline void
475 ADC_setupSOC(uint32_t base, ADC_SOCNumber socNumber, ADC_Trigger trigger,
476  ADC_Channel channel, uint32_t sampleWindow)
477 {
478  uint32_t ctlRegAddr;
479 
480  //
481  // Check the arguments.
482  //
483  DebugP_assert((sampleWindow >= 16U) && (sampleWindow <= 512U));
484 
485  //
486  // Calculate address for the SOC control register.
487  //
488  ctlRegAddr = base + CSL_ADC_ADCSOC0CTL +
489  ((uint32_t)socNumber * ADC_ADCSOCxCTL_STEP);
490 
491  //
492  // Set the configuration of the specified SOC.
493  //
494  HW_WR_REG32(ctlRegAddr,
495  (((uint32_t)channel << CSL_ADC_ADCSOC0CTL_CHSEL_SHIFT) |
496  ((uint32_t)trigger << CSL_ADC_ADCSOC0CTL_TRIGSEL_SHIFT) |
497  (sampleWindow - 1U)));
498 }
499 
500 //*****************************************************************************
501 //
525 //
526 //*****************************************************************************
527 static inline void
528 ADC_setInterruptSOCTrigger(uint32_t base, ADC_SOCNumber socNumber,
529  ADC_IntSOCTrigger trigger)
530 {
531  uint16_t shiftVal;
532 
533  //
534  // Each SOC has a 2-bit field in this register.
535  //
536  shiftVal = (uint16_t)socNumber << 1U;
537 
538  //
539  // Set the configuration of the specified SOC. Note that we're treating
540  // ADCINTSOCSEL1 and ADCINTSOCSEL2 as one 32-bit register here.
541  //
542  HW_WR_REG32(base + CSL_ADC_ADCINTSOCSEL1,
543  ((HW_RD_REG32(base + CSL_ADC_ADCINTSOCSEL1) &
544  ~((uint32_t)CSL_ADC_ADCINTSOCSEL1_SOC0_MASK << shiftVal)) |
545  ((uint32_t)trigger << shiftVal)));
546 }
547 
548 //*****************************************************************************
549 //
563 //
564 //*****************************************************************************
565 static inline void
566 ADC_setInterruptPulseMode(uint32_t base, ADC_PulseMode pulseMode)
567 {
568  //
569  // Set the position of the pulse.
570  //
571  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
572  ((HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
573  ~CSL_ADC_ADCCTL1_INTPULSEPOS_MASK) |
574  ((uint16_t)pulseMode<<CSL_ADC_ADCCTL1_INTPULSEPOS_SHIFT)));
575 }
576 
577 //*****************************************************************************
578 //
594 //
595 //*****************************************************************************
596 static inline void
597 ADC_setInterruptCycleOffset(uint32_t base, uint16_t cycleOffset)
598 {
599  //
600  // Set the position of the pulse.
601  //
602  HW_WR_REG16(base + CSL_ADC_ADCINTCYCLE, cycleOffset);
603 }
604 
605 //*****************************************************************************
606 //
618 //
619 //*****************************************************************************
620 static inline void
621 ADC_enableConverter(uint32_t base)
622 {
623  //
624  // Set the bit that powers up the analog circuitry.
625  //
626  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
627  (HW_RD_REG16(base + CSL_ADC_ADCCTL1) | CSL_ADC_ADCCTL1_ADCPWDNZ_MASK));
628 }
629 
630 //*****************************************************************************
631 //
639 //
640 //*****************************************************************************
641 static inline void
642 ADC_disableConverter(uint32_t base)
643 {
644  //
645  // Clear the bit that powers down the analog circuitry.
646  //
647  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
648  (HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
649  ~CSL_ADC_ADCCTL1_ADCPWDNZ_MASK));
650 }
651 
652 //*****************************************************************************
653 //
665 //
666 //*****************************************************************************
667 static inline void
668 ADC_forceSOC(uint32_t base, ADC_SOCNumber socNumber)
669 {
670  //
671  // Write to the register that will force a 1 to the corresponding SOC flag
672  //
673  HW_WR_REG16(base + CSL_ADC_ADCSOCFRC1, ((uint16_t)1U << (uint16_t)socNumber));
674 }
675 
676 //*****************************************************************************
677 //
695 //
696 //*****************************************************************************
697 static inline void
698 ADC_forceMultipleSOC(uint32_t base, uint16_t socMask)
699 {
700  //
701  // Write to the register that will force a 1 to desired SOCs
702  //
703  HW_WR_REG16(base + CSL_ADC_ADCSOCFRC1, socMask);
704 }
705 
706 //*****************************************************************************
707 //
722 //
723 //*****************************************************************************
724 static inline bool
725 ADC_getInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
726 {
727  //
728  // Get the specified ADC interrupt status.
729  //
730  return((HW_RD_REG16(base + CSL_ADC_ADCINTFLG) &
731  (1U << (uint16_t)adcIntNum)) != 0U);
732 }
733 
734 //*****************************************************************************
735 //
750 //
751 //*****************************************************************************
752 static inline void
753 ADC_clearInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
754 {
755  //
756  // Clear the specified interrupt.
757  //
758  HW_WR_REG16(base + CSL_ADC_ADCINTFLGCLR, ((uint16_t)1U << (uint16_t)adcIntNum));
759 }
760 
761 //*****************************************************************************
762 //
778 //
779 //*****************************************************************************
780 static inline bool
782 {
783  //
784  // Get the specified ADC interrupt status.
785  //
786  return((HW_RD_REG16(base + CSL_ADC_ADCINTOVF) &
787  (1U << (uint16_t)adcIntNum)) != 0U);
788 }
789 
790 //*****************************************************************************
791 //
806 //
807 //*****************************************************************************
808 static inline void
810 {
811  //
812  // Clear the specified interrupt overflow bit.
813  //
814  HW_WR_REG16(base + CSL_ADC_ADCINTOVFCLR, ((uint16_t)1U << (uint16_t)adcIntNum));
815 }
816 
817 //*****************************************************************************
818 //
834 //
835 //*****************************************************************************
836 static inline uint16_t
837 ADC_readResult(uint32_t resultBase, ADC_SOCNumber socNumber)
838 {
839  //
840  // Return the ADC result for the selected SOC.
841  //
842  return(HW_RD_REG16(resultBase + CSL_ADC_RESULT_ADCRESULT0 +
843  ((uint32_t)socNumber * ADC_RESULT_ADCRESULTx_STEP)));
844 }
845 
846 //*****************************************************************************
847 //
857 //
858 //*****************************************************************************
859 static inline bool
860 ADC_isBusy(uint32_t base)
861 {
862  //
863  // Determine if the ADC is busy.
864  //
865  return((HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
866  CSL_ADC_ADCCTL1_ADCBSY_MASK) != 0U);
867 }
868 
869 //*****************************************************************************
870 //
888 //
889 //*****************************************************************************
890 static inline void
891 ADC_setBurstModeConfig(uint32_t base, ADC_Trigger trigger, uint16_t burstSize)
892 {
893  uint16_t regValue;
894 
895  //
896  // Check the arguments.
897  //
898  DebugP_assert(((uint32_t)trigger & ~0x7FU) == 0U);
899  DebugP_assert((burstSize >= 1U) && (burstSize <= 16U));
900 
901  //
902  // Write the burst mode configuration to the register.
903  //
904  regValue = (uint16_t)trigger |
905  ((burstSize - 1U) << CSL_ADC_ADCBURSTCTL_BURSTSIZE_SHIFT);
906 
907  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
908  ((HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) &
909  ~((uint16_t)CSL_ADC_ADCBURSTCTL_BURSTTRIGSEL_MASK |
910  CSL_ADC_ADCBURSTCTL_BURSTSIZE_MASK)) | regValue));
911 }
912 
913 //*****************************************************************************
914 //
926 //
927 //*****************************************************************************
928 static inline void
929 ADC_enableBurstMode(uint32_t base)
930 {
931  //
932  // Enable burst mode.
933  //
934  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
935  (HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) |
936  CSL_ADC_ADCBURSTCTL_BURSTEN_MASK));
937 }
938 
939 //*****************************************************************************
940 //
950 //
951 //*****************************************************************************
952 static inline void
953 ADC_disableBurstMode(uint32_t base)
954 {
955  //
956  // Disable burst mode.
957  //
958  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
959  (HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) &
960  ~CSL_ADC_ADCBURSTCTL_BURSTEN_MASK));
961 }
962 
963 //*****************************************************************************
964 //
988 //
989 //*****************************************************************************
990 static inline void
991 ADC_setSOCPriority(uint32_t base, ADC_PriorityMode priMode)
992 {
993  //
994  // Set SOC priority
995  //
996  HW_WR_REG16(base + CSL_ADC_ADCSOCPRICTL,
997  ((HW_RD_REG16(base + CSL_ADC_ADCSOCPRICTL) &
998  ~CSL_ADC_ADCSOCPRICTL_SOCPRIORITY_MASK) | (uint16_t)priMode));
999 }
1000 
1001 //*****************************************************************************
1002 //
1025 //
1026 //*****************************************************************************
1027 static inline void
1028 ADC_setupPPB(uint32_t base, ADC_PPBNumber ppbNumber, ADC_SOCNumber socNumber)
1029 {
1030  uint32_t ppbOffset;
1031 
1032  //
1033  // Get the offset to the appropriate PPB configuration register.
1034  //
1035  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1036  CSL_ADC_ADCPPB1CONFIG;
1037 
1038  //
1039  // Write the configuration to the register.
1040  //
1041  HW_WR_REG16(base + ppbOffset,
1042  ((HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1CONFIG_CONFIG_MASK) |
1043  ((uint16_t)socNumber & CSL_ADC_ADCPPB1CONFIG_CONFIG_MASK)));
1044 }
1045 
1046 //*****************************************************************************
1047 //
1059 //
1060 //*****************************************************************************
1061 static inline void
1062 ADC_enablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
1063 {
1064  //
1065  // Check the arguments.
1066  //
1067  DebugP_assert((evtFlags & ~0x7U) == 0U);
1068 
1069  //
1070  // Enable the specified event.
1071  //
1072  HW_WR_REG16(base + CSL_ADC_ADCEVTSEL,
1073  (HW_RD_REG16(base + CSL_ADC_ADCEVTSEL) |
1074  (evtFlags << ((uint16_t)ppbNumber * 4U))));
1075 }
1076 
1077 //*****************************************************************************
1078 //
1089 //
1090 //*****************************************************************************
1091 static inline void
1092 ADC_disablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
1093 {
1094  //
1095  // Check the arguments.
1096  //
1097  DebugP_assert((evtFlags & ~0x7U) == 0U);
1098 
1099  //
1100  // Disable the specified event.
1101  //
1102  HW_WR_REG16(base + CSL_ADC_ADCEVTSEL,
1103  (HW_RD_REG16(base + CSL_ADC_ADCEVTSEL) &
1104  ~(evtFlags << ((uint16_t)ppbNumber * 4U))));
1105 }
1106 
1107 //*****************************************************************************
1108 //
1120 //
1121 //*****************************************************************************
1122 static inline void
1124  uint16_t intFlags)
1125 {
1126  //
1127  // Check the arguments.
1128  //
1129  DebugP_assert((intFlags & ~0x7U) == 0U);
1130 
1131  //
1132  // Enable the specified event interrupts.
1133  //
1134  HW_WR_REG16(base + CSL_ADC_ADCEVTINTSEL,
1135  (HW_RD_REG16(base + CSL_ADC_ADCEVTINTSEL) |
1136  (intFlags << ((uint16_t)ppbNumber * 4U))));
1137 }
1138 
1139 //*****************************************************************************
1140 //
1152 //
1153 //*****************************************************************************
1154 static inline void
1156  uint16_t intFlags)
1157 {
1158  //
1159  // Check the arguments.
1160  //
1161  DebugP_assert((intFlags & ~0x7U) == 0U);
1162 
1163  //
1164  // Disable the specified event interrupts.
1165  //
1166  HW_WR_REG16(base + CSL_ADC_ADCEVTINTSEL,
1167  (HW_RD_REG16(base + CSL_ADC_ADCEVTINTSEL) &
1168  ~(intFlags << ((uint16_t)ppbNumber * 4U))));
1169 }
1170 
1171 //*****************************************************************************
1172 //
1181 //
1182 //*****************************************************************************
1183 static inline uint16_t
1184 ADC_getPPBEventStatus(uint32_t base, ADC_PPBNumber ppbNumber)
1185 {
1186  //
1187  // Get the event status for the specified post-processing block.
1188  //
1189  return((HW_RD_REG16(base + CSL_ADC_ADCEVTSTAT) >>
1190  ((uint16_t)ppbNumber * 4U)) & 0x7U);
1191 }
1192 
1193 //*****************************************************************************
1194 //
1206 //
1207 //*****************************************************************************
1208 static inline void
1209 ADC_clearPPBEventStatus(uint32_t base, ADC_PPBNumber ppbNumber,
1210  uint16_t evtFlags)
1211 {
1212  //
1213  // Check the arguments.
1214  //
1215  DebugP_assert((evtFlags & ~0x7U) == 0U);
1216 
1217  //
1218  // Clear the specified event interrupts.
1219  //
1220  HW_WR_REG16(base + CSL_ADC_ADCEVTCLR,
1221  (HW_RD_REG16(base + CSL_ADC_ADCEVTCLR) |
1222  (evtFlags << ((uint16_t)ppbNumber * 4U))));
1223 }
1224 
1225 //*****************************************************************************
1226 //
1240 //
1241 //*****************************************************************************
1242 static inline int32_t
1243 ADC_readPPBResult(uint32_t resultBase, ADC_PPBNumber ppbNumber)
1244 {
1245  //
1246  // Return the result of selected PPB.
1247  //
1248  return((int32_t)HW_RD_REG32(resultBase + CSL_ADC_RESULT_ADCPPB1RESULT +
1249  ((uint32_t)ppbNumber * ADC_RESULT_ADCPPBxRESULT_STEP)));
1250 }
1251 
1252 //*****************************************************************************
1253 //
1264 //
1265 //*****************************************************************************
1266 static inline uint16_t
1267 ADC_getPPBDelayTimeStamp(uint32_t base, ADC_PPBNumber ppbNumber)
1268 {
1269  uint32_t ppbOffset;
1270 
1271  //
1272  // Get the offset to the appropriate delay.
1273  //
1274  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1275  CSL_ADC_ADCPPB1STAMP;
1276 
1277  //
1278  // Return the delay time stamp.
1279  //
1280  return(HW_RD_REG16(base + ppbOffset) & CSL_ADC_ADCPPB1STAMP_DLYSTAMP_MASK);
1281 }
1282 
1283 //*****************************************************************************
1284 //
1307 //
1308 //*****************************************************************************
1309 static inline void
1311  int16_t offset)
1312 {
1313  uint32_t ppbOffset;
1314 
1315  //
1316  // Get the offset to the appropriate offset register.
1317  //
1318  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1319  CSL_ADC_ADCPPB1OFFCAL;
1320 
1321  //
1322  // Write the offset amount.
1323  //
1324  HW_WR_REG16(base + ppbOffset,
1325  ((HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1OFFCAL_OFFCAL_MASK) |
1326  ((uint16_t)offset & CSL_ADC_ADCPPB1OFFCAL_OFFCAL_MASK)));
1327 }
1328 
1329 //*****************************************************************************
1330 //
1350 //
1351 //*****************************************************************************
1352 static inline void
1353 ADC_setPPBReferenceOffset(uint32_t base, ADC_PPBNumber ppbNumber,
1354  uint16_t offset)
1355 {
1356  uint32_t ppbOffset;
1357 
1358  //
1359  // Get the offset to the appropriate offset register.
1360  //
1361  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1362  CSL_ADC_ADCPPB1OFFREF;
1363 
1364  //
1365  // Write the offset amount.
1366  //
1367  HW_WR_REG16(base + ppbOffset, offset);
1368 }
1369 
1370 //*****************************************************************************
1371 //
1385 //
1386 //*****************************************************************************
1387 static inline void
1389 {
1390  uint32_t ppbOffset;
1391 
1392  //
1393  // Get the offset to the appropriate PPB configuration register.
1394  //
1395  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1396  CSL_ADC_ADCPPB1CONFIG;
1397 
1398  //
1399  // Enable the twos complement
1400  //
1401  HW_WR_REG16(base + ppbOffset,
1402  (HW_RD_REG16(base + ppbOffset) |
1403  CSL_ADC_ADCPPB1CONFIG_TWOSCOMPEN_MASK));
1404 }
1405 
1406 //*****************************************************************************
1407 //
1421 //
1422 //*****************************************************************************
1423 static inline void
1425 {
1426  uint32_t ppbOffset;
1427 
1428  //
1429  // Get the offset to the appropriate PPB configuration register.
1430  //
1431  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1432  CSL_ADC_ADCPPB1CONFIG;
1433 
1434  //
1435  // Disable the twos complement
1436  //
1437  HW_WR_REG16(base + ppbOffset,
1438  (HW_RD_REG16(base + ppbOffset) &
1439  ~CSL_ADC_ADCPPB1CONFIG_TWOSCOMPEN_MASK));
1440 }
1441 
1442 //*****************************************************************************
1443 //
1455 //
1456 //*****************************************************************************
1457 static inline void
1458 ADC_enablePPBEventCBCClear(uint32_t base, uint32_t ppbNumber)
1459 {
1460  uint32_t ppbOffset;
1461 
1462  //
1463  // Get the offset to the appropriate PPB configuration register.
1464  //
1465  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1466  CSL_ADC_ADCPPB1CONFIG;
1467 
1468  //
1469  // Set automatic cycle-by-cycle flag clear bit
1470  //
1471  HW_WR_REG16(base + ppbOffset,
1472  (HW_RD_REG16(base + ppbOffset) | CSL_ADC_ADCPPB1CONFIG_CBCEN_MASK));
1473 }
1474 
1475 //*****************************************************************************
1476 //
1487 //
1488 //*****************************************************************************
1489 static inline void
1490 ADC_disablePPBEventCBCClear(uint32_t base, uint32_t ppbNumber)
1491 {
1492  uint32_t ppbOffset;
1493 
1494  //
1495  // Get the offset to the appropriate PPB configuration register.
1496  //
1497  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1498  CSL_ADC_ADCPPB1CONFIG;
1499 
1500  //
1501  // Clear automatic cycle-by-cycle flag clear bit
1502  //
1503  HW_WR_REG16(base + ppbOffset,
1504  (HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1CONFIG_CBCEN_MASK));
1505 }
1506 
1507 //*****************************************************************************
1508 //
1523 //
1524 //*****************************************************************************
1525 static inline void
1526 ADC_enableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
1527 {
1528  uint32_t intRegAddr;
1529  uint16_t shiftVal;
1530 
1531  //
1532  // Each INTSEL register manages two interrupts. If the interrupt number is
1533  // even, we'll be accessing the upper byte and will need to shift.
1534  //
1535  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1536  (((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP);
1537  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1538 
1539  //
1540  // Enable the specified ADC interrupt.
1541  //
1542  HW_WR_REG16(intRegAddr,
1543  HW_RD_REG16(intRegAddr) |
1544  (CSL_ADC_ADCINTSEL1N2_INT1E_MASK << shiftVal));
1545 }
1546 
1547 //*****************************************************************************
1548 //
1563 //
1564 //*****************************************************************************
1565 static inline void
1566 ADC_disableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
1567 {
1568  uint32_t intRegAddr;
1569  uint16_t shiftVal;
1570 
1571  //
1572  // Each INTSEL register manages two interrupts. If the interrupt number is
1573  // even, we'll be accessing the upper byte and will need to shift.
1574  //
1575  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1576  (((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP);
1577  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1578 
1579  //
1580  // Disable the specified ADC interrupt.
1581  //
1582  HW_WR_REG16(intRegAddr,
1583  HW_RD_REG16(intRegAddr) &
1584  ~(CSL_ADC_ADCINTSEL1N2_INT1E_MASK << shiftVal));
1585 }
1586 
1587 //*****************************************************************************
1588 //
1606 //
1607 //*****************************************************************************
1608 static inline void
1609 ADC_setInterruptSource(uint32_t base, ADC_IntNumber adcIntNum,
1610  ADC_SOCNumber socNumber)
1611 {
1612  uint32_t intRegAddr;
1613  uint16_t shiftVal;
1614 
1615  //
1616  // Each INTSEL register manages two interrupts. If the interrupt number is
1617  // even, we'll be accessing the upper byte and will need to shift.
1618  //
1619  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1620  (((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP);
1621  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1622 
1623  //
1624  // Set the specified ADC interrupt source.
1625  //
1626  HW_WR_REG16(intRegAddr,
1627  ((HW_RD_REG16(intRegAddr) &
1628  ~(CSL_ADC_ADCINTSEL1N2_INT1SEL_MASK << shiftVal)) |
1629  ((uint16_t)socNumber << shiftVal)));
1630 }
1631 
1632 //*****************************************************************************
1633 //
1649 //
1650 //*****************************************************************************
1651 static inline void
1652 ADC_enableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
1653 {
1654  uint32_t intRegAddr;
1655  uint16_t shiftVal;
1656 
1657  //
1658  // Each INTSEL register manages two interrupts. If the interrupt number is
1659  // even, we'll be accessing the upper byte and will need to shift.
1660  //
1661  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1662  (((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP);
1663  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1664 
1665  //
1666  // Enable continuous mode for the specified ADC interrupt.
1667  //
1668  HW_WR_REG16(intRegAddr,
1669  HW_RD_REG16(intRegAddr) |
1670  (CSL_ADC_ADCINTSEL1N2_INT1CONT_MASK << shiftVal));
1671 }
1672 
1673 //*****************************************************************************
1674 //
1691 //
1692 //*****************************************************************************
1693 static inline void
1694 ADC_disableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
1695 {
1696  uint32_t intRegAddr;
1697  uint16_t shiftVal;
1698 
1699  //
1700  // Each INTSEL register manages two interrupts. If the interrupt number is
1701  // even, we'll be accessing the upper byte and will need to shift.
1702  //
1703  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1704  (((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP);
1705  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1706 
1707  //
1708  // Disable continuous mode for the specified ADC interrupt.
1709  //
1710  HW_WR_REG16(intRegAddr,
1711  HW_RD_REG16(intRegAddr) &
1712  ~(CSL_ADC_ADCINTSEL1N2_INT1CONT_MASK << shiftVal));
1713 }
1714 
1715 //
1735 //
1736 //*****************************************************************************
1737 extern void
1738 ADC_setMode(uint32_t base, ADC_Resolution resolution,
1739  ADC_SignalMode signalMode);
1740 
1741 //*****************************************************************************
1742 //
1761 //
1762 //*****************************************************************************
1763 extern void
1764 ADC_setPPBTripLimits(uint32_t base, ADC_PPBNumber ppbNumber,
1765  int32_t tripHiLimit, int32_t tripLoLimit);
1766 
1767 //*****************************************************************************
1768 //
1769 // Close the Doxygen group.
1771 //
1772 //*****************************************************************************
1773 
1774 //*****************************************************************************
1775 //
1776 // Mark the end of the C bindings section for C++ compilers.
1777 //
1778 //*****************************************************************************
1779 #ifdef __cplusplus
1780 }
1781 #endif
1782 
1783 #endif // ADC_V1_H_
ADC_SOC_NUMBER7
@ ADC_SOC_NUMBER7
SOC/EOC number 7.
Definition: adc/v1/adc.h:331
ADC_Resolution
ADC_Resolution
Definition: adc/v1/adc.h:135
ADC_SOC_NUMBER15
@ ADC_SOC_NUMBER15
SOC/EOC number 15.
Definition: adc/v1/adc.h:339
ADC_SOC_NUMBER9
@ ADC_SOC_NUMBER9
SOC/EOC number 9.
Definition: adc/v1/adc.h:333
ADC_CH_ADCIN3_ADCIN2
@ ADC_CH_ADCIN3_ADCIN2
differential, ADCIN3 and ADCIN2
Definition: adc/v1/adc.h:262
ADC_TRIGGER_EPWM26_SOCA
@ ADC_TRIGGER_EPWM26_SOCA
ePWM26, ADCSOCA
Definition: adc/v1/adc.h:218
ADC_TRIGGER_EPWM3_SOCA
@ ADC_TRIGGER_EPWM3_SOCA
ePWM3, ADCSOCA
Definition: adc/v1/adc.h:172
ADC_RESULT_ADCPPBxRESULT_STEP
#define ADC_RESULT_ADCPPBxRESULT_STEP
Register offset difference between 2 ADCPPBxRESULT registers.
Definition: adc/v1/adc.h:397
ADC_CLK_DIV_2_0
@ ADC_CLK_DIV_2_0
ADCCLK = (input clock) / 2.0.
Definition: adc/v1/adc.h:112
ADC_disablePPBEventInterrupt
static void ADC_disablePPBEventInterrupt(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t intFlags)
Definition: adc/v1/adc.h:1155
ADC_TRIGGER_EPWM14_SOCB
@ ADC_TRIGGER_EPWM14_SOCB
ePWM14, ADCSOCB
Definition: adc/v1/adc.h:195
ADC_disablePPBTwosComplement
static void ADC_disablePPBTwosComplement(uint32_t base, ADC_PPBNumber ppbNumber)
Definition: adc/v1/adc.h:1424
ADC_ClkPrescale
ADC_ClkPrescale
Definition: adc/v1/adc.h:110
ADC_INT_NUMBER3
@ ADC_INT_NUMBER3
ADCINT3 Interrupt.
Definition: adc/v1/adc.h:295
ADC_TRIGGER_ECAP8_SOCEVT
@ ADC_TRIGGER_ECAP8_SOCEVT
eCAP8, SOCEVT
Definition: adc/v1/adc.h:238
ADC_TRIGGER_EPWM24_SOCA
@ ADC_TRIGGER_EPWM24_SOCA
ePWM24, ADCSOCA
Definition: adc/v1/adc.h:214
ADC_CH_ADCIN2
@ ADC_CH_ADCIN2
single-ended, ADCIN2
Definition: adc/v1/adc.h:253
ADC_TRIGGER_EPWM23_SOCA
@ ADC_TRIGGER_EPWM23_SOCA
ePWM23, ADCSOCA
Definition: adc/v1/adc.h:212
ADC_TRIGGER_EPWM11_SOCB
@ ADC_TRIGGER_EPWM11_SOCB
ePWM11, ADCSOCB
Definition: adc/v1/adc.h:189
ADC_getPPBEventStatus
static uint16_t ADC_getPPBEventStatus(uint32_t base, ADC_PPBNumber ppbNumber)
Definition: adc/v1/adc.h:1184
ADC_PULSE_END_OF_CONV
@ ADC_PULSE_END_OF_CONV
Occurs at the end of the conversion.
Definition: adc/v1/adc.h:279
ADC_clearInterruptOverflowStatus
static void ADC_clearInterruptOverflowStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:809
ADC_enableBurstMode
static void ADC_enableBurstMode(uint32_t base)
Definition: adc/v1/adc.h:929
ADC_CH_ADCIN0
@ ADC_CH_ADCIN0
single-ended, ADCIN0
Definition: adc/v1/adc.h:251
ADC_SOC_NUMBER8
@ ADC_SOC_NUMBER8
SOC/EOC number 8.
Definition: adc/v1/adc.h:332
ADC_TRIGGER_EPWM9_SOCB
@ ADC_TRIGGER_EPWM9_SOCB
ePWM9, ADCSOCB
Definition: adc/v1/adc.h:185
ADC_TRIGGER_EPWM16_SOCA
@ ADC_TRIGGER_EPWM16_SOCA
ePWM16, ADCSOCA
Definition: adc/v1/adc.h:198
ADC_SOC_NUMBER1
@ ADC_SOC_NUMBER1
SOC/EOC number 1.
Definition: adc/v1/adc.h:325
ADC_PRI_THRU_SOC5_HIPRI
@ ADC_PRI_THRU_SOC5_HIPRI
SOC 0-5 hi pri, others in round robin.
Definition: adc/v1/adc.h:369
ADC_disablePPBEvent
static void ADC_disablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
Definition: adc/v1/adc.h:1092
ADC_INT_SOC_TRIGGER_ADCINT1
@ ADC_INT_SOC_TRIGGER_ADCINT1
ADCINT1 will trigger the SOC.
Definition: adc/v1/adc.h:351
ADC_TRIGGER_EPWM2_SOCB
@ ADC_TRIGGER_EPWM2_SOCB
ePWM2, ADCSOCB
Definition: adc/v1/adc.h:171
ADC_INT_NUMBER4
@ ADC_INT_NUMBER4
ADCINT4 Interrupt.
Definition: adc/v1/adc.h:296
ADC_TRIGGER_EPWM27_SOCA
@ ADC_TRIGGER_EPWM27_SOCA
ePWM27, ADCSOCA
Definition: adc/v1/adc.h:220
ADC_SOC_NUMBER11
@ ADC_SOC_NUMBER11
SOC/EOC number 11.
Definition: adc/v1/adc.h:335
ADC_ADCINTSELxNy_STEP
#define ADC_ADCINTSELxNy_STEP
Register offset difference between 2 ADCINTSELxNy registers.
Definition: adc/v1/adc.h:390
ADC_INT_SOC_TRIGGER_NONE
@ ADC_INT_SOC_TRIGGER_NONE
No ADCINT will trigger the SOC.
Definition: adc/v1/adc.h:350
ADC_PRI_THRU_SOC14_HIPRI
@ ADC_PRI_THRU_SOC14_HIPRI
SOC 0-14 hi pri, SOC15 in round robin.
Definition: adc/v1/adc.h:378
ADC_MODE_SINGLE_ENDED
@ ADC_MODE_SINGLE_ENDED
Sample on single pin with VREFLO.
Definition: adc/v1/adc.h:147
ADC_TRIGGER_EPWM28_SOCA
@ ADC_TRIGGER_EPWM28_SOCA
ePWM28, ADCSOCA
Definition: adc/v1/adc.h:222
ADC_TRIGGER_EPWM6_SOCB
@ ADC_TRIGGER_EPWM6_SOCB
ePWM6, ADCSOCB
Definition: adc/v1/adc.h:179
ADC_TRIGGER_EPWM12_SOCB
@ ADC_TRIGGER_EPWM12_SOCB
ePWM12, ADCSOCB
Definition: adc/v1/adc.h:191
ADC_TRIGGER_EPWM4_SOCA
@ ADC_TRIGGER_EPWM4_SOCA
ePWM4, ADCSOCA
Definition: adc/v1/adc.h:174
ADC_enablePPBEventCBCClear
static void ADC_enablePPBEventCBCClear(uint32_t base, uint32_t ppbNumber)
Definition: adc/v1/adc.h:1458
ADC_forceMultipleSOC
static void ADC_forceMultipleSOC(uint32_t base, uint16_t socMask)
Definition: adc/v1/adc.h:698
ADC_CLK_DIV_4_0
@ ADC_CLK_DIV_4_0
ADCCLK = (input clock) / 4.0.
Definition: adc/v1/adc.h:116
ADC_disablePPBEventCBCClear
static void ADC_disablePPBEventCBCClear(uint32_t base, uint32_t ppbNumber)
Definition: adc/v1/adc.h:1490
ADC_PulseMode
ADC_PulseMode
Definition: adc/v1/adc.h:275
ADC_TRIGGER_EPWM29_SOCB
@ ADC_TRIGGER_EPWM29_SOCB
ePWM29, ADCSOCB
Definition: adc/v1/adc.h:225
ADC_TRIGGER_ECAP3_SOCEVT
@ ADC_TRIGGER_ECAP3_SOCEVT
eCAP3, SOCEVT
Definition: adc/v1/adc.h:233
ADC_ADCSOCxCTL_STEP
#define ADC_ADCSOCxCTL_STEP
Defines used by the driver.
Definition: adc/v1/adc.h:388
ADC_TRIGGER_EPWM27_SOCB
@ ADC_TRIGGER_EPWM27_SOCB
ePWM27, ADCSOCB
Definition: adc/v1/adc.h:221
ADC_setInterruptPulseMode
static void ADC_setInterruptPulseMode(uint32_t base, ADC_PulseMode pulseMode)
Definition: adc/v1/adc.h:566
ADC_setInterruptSource
static void ADC_setInterruptSource(uint32_t base, ADC_IntNumber adcIntNum, ADC_SOCNumber socNumber)
Definition: adc/v1/adc.h:1609
ADC_PRI_THRU_SOC10_HIPRI
@ ADC_PRI_THRU_SOC10_HIPRI
SOC 0-10 hi pri, others in round robin.
Definition: adc/v1/adc.h:374
ADC_TRIGGER_ECAP1_SOCEVT
@ ADC_TRIGGER_ECAP1_SOCEVT
eCAP1, SOCEVT
Definition: adc/v1/adc.h:231
ADC_TRIGGER_EPWM30_SOCB
@ ADC_TRIGGER_EPWM30_SOCB
ePWM30, ADCSOCB
Definition: adc/v1/adc.h:227
ADC_PRI_THRU_SOC11_HIPRI
@ ADC_PRI_THRU_SOC11_HIPRI
SOC 0-11 hi pri, others in round robin.
Definition: adc/v1/adc.h:375
ADC_PRI_THRU_SOC3_HIPRI
@ ADC_PRI_THRU_SOC3_HIPRI
SOC 0-3 hi pri, others in round robin.
Definition: adc/v1/adc.h:367
ADC_Trigger
ADC_Trigger
Definition: adc/v1/adc.h:159
ADC_CLK_DIV_5_0
@ ADC_CLK_DIV_5_0
ADCCLK = (input clock) / 5.0.
Definition: adc/v1/adc.h:118
ADC_PRI_THRU_SOC4_HIPRI
@ ADC_PRI_THRU_SOC4_HIPRI
SOC 0-4 hi pri, others in round robin.
Definition: adc/v1/adc.h:368
ADC_TRIGGER_EPWM2_SOCA
@ ADC_TRIGGER_EPWM2_SOCA
ePWM2, ADCSOCA
Definition: adc/v1/adc.h:170
ADC_PRI_THRU_SOC7_HIPRI
@ ADC_PRI_THRU_SOC7_HIPRI
SOC 0-7 hi pri, others in round robin.
Definition: adc/v1/adc.h:371
ADC_TRIGGER_EPWM31_SOCA
@ ADC_TRIGGER_EPWM31_SOCA
ePWM31, ADCSOCA
Definition: adc/v1/adc.h:228
ADC_SOCNumber
ADC_SOCNumber
Definition: adc/v1/adc.h:323
ADC_CH_ADCIN1
@ ADC_CH_ADCIN1
single-ended, ADCIN1
Definition: adc/v1/adc.h:252
ADC_setBurstModeConfig
static void ADC_setBurstModeConfig(uint32_t base, ADC_Trigger trigger, uint16_t burstSize)
Definition: adc/v1/adc.h:891
ADC_enableContinuousMode
static void ADC_enableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1652
ADC_INT_NUMBER1
@ ADC_INT_NUMBER1
ADCINT1 Interrupt.
Definition: adc/v1/adc.h:293
ADC_TRIGGER_EPWM7_SOCB
@ ADC_TRIGGER_EPWM7_SOCB
ePWM7, ADCSOCB
Definition: adc/v1/adc.h:181
ADC_setInterruptSOCTrigger
static void ADC_setInterruptSOCTrigger(uint32_t base, ADC_SOCNumber socNumber, ADC_IntSOCTrigger trigger)
Definition: adc/v1/adc.h:528
ADC_CH_CAL0
@ ADC_CH_CAL0
single-ended, CAL0
Definition: adc/v1/adc.h:257
ADC_TRIGGER_RTI1
@ ADC_TRIGGER_RTI1
RTI Timer 1.
Definition: adc/v1/adc.h:162
ADC_SOC_NUMBER3
@ ADC_SOC_NUMBER3
SOC/EOC number 3.
Definition: adc/v1/adc.h:327
ADC_getInterruptStatus
static bool ADC_getInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:725
ADC_getPPBDelayTimeStamp
static uint16_t ADC_getPPBDelayTimeStamp(uint32_t base, ADC_PPBNumber ppbNumber)
Definition: adc/v1/adc.h:1267
ADC_SOC_NUMBER10
@ ADC_SOC_NUMBER10
SOC/EOC number 10.
Definition: adc/v1/adc.h:334
ADC_TRIGGER_EPWM12_SOCA
@ ADC_TRIGGER_EPWM12_SOCA
ePWM12, ADCSOCA
Definition: adc/v1/adc.h:190
ADC_TRIGGER_EPWM9_SOCA
@ ADC_TRIGGER_EPWM9_SOCA
ePWM9, ADCSOCA
Definition: adc/v1/adc.h:184
ADC_TRIGGER_EPWM15_SOCB
@ ADC_TRIGGER_EPWM15_SOCB
ePWM15, ADCSOCB
Definition: adc/v1/adc.h:197
ADC_enablePPBEvent
static void ADC_enablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
Definition: adc/v1/adc.h:1062
ADC_TRIGGER_EPWM17_SOCB
@ ADC_TRIGGER_EPWM17_SOCB
ePWM17, ADCSOCB
Definition: adc/v1/adc.h:201
ADC_PRI_THRU_SOC13_HIPRI
@ ADC_PRI_THRU_SOC13_HIPRI
SOC 0-13 hi pri, others in round robin.
Definition: adc/v1/adc.h:377
ADC_CLK_DIV_7_5
@ ADC_CLK_DIV_7_5
ADCCLK = (input clock) / 7.5.
Definition: adc/v1/adc.h:123
ADC_TRIGGER_EPWM29_SOCA
@ ADC_TRIGGER_EPWM29_SOCA
ePWM29, ADCSOCA
Definition: adc/v1/adc.h:224
ADC_PRI_THRU_SOC6_HIPRI
@ ADC_PRI_THRU_SOC6_HIPRI
SOC 0-6 hi pri, others in round robin.
Definition: adc/v1/adc.h:370
ADC_TRIGGER_ECAP7_SOCEVT
@ ADC_TRIGGER_ECAP7_SOCEVT
eCAP7, SOCEVT
Definition: adc/v1/adc.h:237
ADC_setInterruptCycleOffset
static void ADC_setInterruptCycleOffset(uint32_t base, uint16_t cycleOffset)
Definition: adc/v1/adc.h:597
ADC_setPPBCalibrationOffset
static void ADC_setPPBCalibrationOffset(uint32_t base, ADC_PPBNumber ppbNumber, int16_t offset)
Definition: adc/v1/adc.h:1310
ADC_TRIGGER_EPWM5_SOCB
@ ADC_TRIGGER_EPWM5_SOCB
ePWM5, ADCSOCB
Definition: adc/v1/adc.h:177
ADC_CLK_DIV_6_0
@ ADC_CLK_DIV_6_0
ADCCLK = (input clock) / 6.0.
Definition: adc/v1/adc.h:120
ADC_TRIGGER_EPWM25_SOCA
@ ADC_TRIGGER_EPWM25_SOCA
ePWM25, ADCSOCA
Definition: adc/v1/adc.h:216
ADC_PPBNumber
ADC_PPBNumber
Definition: adc/v1/adc.h:306
ADC_CLK_DIV_8_5
@ ADC_CLK_DIV_8_5
ADCCLK = (input clock) / 8.5.
Definition: adc/v1/adc.h:125
ADC_TRIGGER_EPWM22_SOCB
@ ADC_TRIGGER_EPWM22_SOCB
ePWM22, ADCSOCB
Definition: adc/v1/adc.h:211
ADC_PRI_ALL_ROUND_ROBIN
@ ADC_PRI_ALL_ROUND_ROBIN
Round robin mode is used for all.
Definition: adc/v1/adc.h:363
ADC_TRIGGER_EPWM17_SOCA
@ ADC_TRIGGER_EPWM17_SOCA
ePWM17, ADCSOCA
Definition: adc/v1/adc.h:200
ADC_TRIGGER_ECAP9_SOCEVT
@ ADC_TRIGGER_ECAP9_SOCEVT
eCAP9, SOCEVT
Definition: adc/v1/adc.h:239
ADC_SOC_NUMBER0
@ ADC_SOC_NUMBER0
SOC/EOC number 0.
Definition: adc/v1/adc.h:324
ADC_IntSOCTrigger
ADC_IntSOCTrigger
Definition: adc/v1/adc.h:349
ADC_setMode
void ADC_setMode(uint32_t base, ADC_Resolution resolution, ADC_SignalMode signalMode)
ADC_TRIGGER_EPWM28_SOCB
@ ADC_TRIGGER_EPWM28_SOCB
ePWM28, ADCSOCB
Definition: adc/v1/adc.h:223
ADC_PPB_NUMBER3
@ ADC_PPB_NUMBER3
Post-processing block 3.
Definition: adc/v1/adc.h:309
ADC_clearInterruptStatus
static void ADC_clearInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:753
ADC_PriorityMode
ADC_PriorityMode
Definition: adc/v1/adc.h:362
ADC_CLK_DIV_8_0
@ ADC_CLK_DIV_8_0
ADCCLK = (input clock) / 8.0.
Definition: adc/v1/adc.h:124
ADC_PRI_THRU_SOC8_HIPRI
@ ADC_PRI_THRU_SOC8_HIPRI
SOC 0-8 hi pri, others in round robin.
Definition: adc/v1/adc.h:372
ADC_TRIGGER_EPWM1_SOCB
@ ADC_TRIGGER_EPWM1_SOCB
ePWM1, ADCSOCB
Definition: adc/v1/adc.h:169
ADC_SOC_NUMBER5
@ ADC_SOC_NUMBER5
SOC/EOC number 5.
Definition: adc/v1/adc.h:329
ADC_CLK_DIV_6_5
@ ADC_CLK_DIV_6_5
ADCCLK = (input clock) / 6.5.
Definition: adc/v1/adc.h:121
ADC_INT_SOC_TRIGGER_ADCINT2
@ ADC_INT_SOC_TRIGGER_ADCINT2
ADCINT2 will trigger the SOC.
Definition: adc/v1/adc.h:352
ADC_TRIGGER_EPWM6_SOCA
@ ADC_TRIGGER_EPWM6_SOCA
ePWM6, ADCSOCA
Definition: adc/v1/adc.h:178
ADC_enableConverter
static void ADC_enableConverter(uint32_t base)
Definition: adc/v1/adc.h:621
ADC_PPB_NUMBER4
@ ADC_PPB_NUMBER4
Post-processing block 4.
Definition: adc/v1/adc.h:310
ADC_TRIGGER_EPWM13_SOCB
@ ADC_TRIGGER_EPWM13_SOCB
ePWM13, ADCSOCB
Definition: adc/v1/adc.h:193
ADC_readResult
static uint16_t ADC_readResult(uint32_t resultBase, ADC_SOCNumber socNumber)
Definition: adc/v1/adc.h:837
ADC_CH_ADCIN5_ADCIN4
@ ADC_CH_ADCIN5_ADCIN4
differential, ADCIN5 and ADCIN4
Definition: adc/v1/adc.h:264
ADC_TRIGGER_ECAP6_SOCEVT
@ ADC_TRIGGER_ECAP6_SOCEVT
eCAP6, SOCEVT
Definition: adc/v1/adc.h:236
ADC_SOC_NUMBER13
@ ADC_SOC_NUMBER13
SOC/EOC number 13.
Definition: adc/v1/adc.h:337
ADC_TRIGGER_ECAP2_SOCEVT
@ ADC_TRIGGER_ECAP2_SOCEVT
eCAP2, SOCEVT
Definition: adc/v1/adc.h:232
ADC_CLK_DIV_3_5
@ ADC_CLK_DIV_3_5
ADCCLK = (input clock) / 3.5.
Definition: adc/v1/adc.h:115
ADC_PRI_THRU_SOC9_HIPRI
@ ADC_PRI_THRU_SOC9_HIPRI
SOC 0-9 hi pri, others in round robin.
Definition: adc/v1/adc.h:373
ADC_CH_ADCIN5
@ ADC_CH_ADCIN5
single-ended, ADCIN5
Definition: adc/v1/adc.h:256
ADC_TRIGGER_EPWM8_SOCA
@ ADC_TRIGGER_EPWM8_SOCA
ePWM8, ADCSOCA
Definition: adc/v1/adc.h:182
ADC_TRIGGER_ECAP5_SOCEVT
@ ADC_TRIGGER_ECAP5_SOCEVT
eCAP5, SOCEVT
Definition: adc/v1/adc.h:235
ADC_enablePPBTwosComplement
static void ADC_enablePPBTwosComplement(uint32_t base, ADC_PPBNumber ppbNumber)
Definition: adc/v1/adc.h:1388
ADC_disableInterrupt
static void ADC_disableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1566
ADC_RESOLUTION_12BIT
@ ADC_RESOLUTION_12BIT
12-bit conversion resolution
Definition: adc/v1/adc.h:136
ADC_setupPPB
static void ADC_setupPPB(uint32_t base, ADC_PPBNumber ppbNumber, ADC_SOCNumber socNumber)
Definition: adc/v1/adc.h:1028
ADC_getInterruptOverflowStatus
static bool ADC_getInterruptOverflowStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:781
ADC_PRI_THRU_SOC1_HIPRI
@ ADC_PRI_THRU_SOC1_HIPRI
SOC 0-1 hi pri, others in round robin.
Definition: adc/v1/adc.h:365
ADC_TRIGGER_EPWM15_SOCA
@ ADC_TRIGGER_EPWM15_SOCA
ePWM15, ADCSOCA
Definition: adc/v1/adc.h:196
ADC_forceSOC
static void ADC_forceSOC(uint32_t base, ADC_SOCNumber socNumber)
Definition: adc/v1/adc.h:668
ADC_MODE_DIFFERENTIAL
@ ADC_MODE_DIFFERENTIAL
Sample on pair of pins.
Definition: adc/v1/adc.h:148
ADC_TRIGGER_EPWM10_SOCB
@ ADC_TRIGGER_EPWM10_SOCB
ePWM10, ADCSOCB
Definition: adc/v1/adc.h:187
ADC_disableConverter
static void ADC_disableConverter(uint32_t base)
Definition: adc/v1/adc.h:642
ADC_enablePPBEventInterrupt
static void ADC_enablePPBEventInterrupt(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t intFlags)
Definition: adc/v1/adc.h:1123
ADC_TRIGGER_EPWM10_SOCA
@ ADC_TRIGGER_EPWM10_SOCA
ePWM10, ADCSOCA
Definition: adc/v1/adc.h:186
ADC_PRI_THRU_SOC12_HIPRI
@ ADC_PRI_THRU_SOC12_HIPRI
SOC 0-12 hi pri, others in round robin.
Definition: adc/v1/adc.h:376
ADC_TRIGGER_EPWM31_SOCB
@ ADC_TRIGGER_EPWM31_SOCB
ePWM31, ADCSOCB
Definition: adc/v1/adc.h:229
ADC_CH_ADCIN4
@ ADC_CH_ADCIN4
single-ended, ADCIN4
Definition: adc/v1/adc.h:255
ADC_CLK_DIV_7_0
@ ADC_CLK_DIV_7_0
ADCCLK = (input clock) / 7.0.
Definition: adc/v1/adc.h:122
ADC_TRIGGER_EPWM19_SOCA
@ ADC_TRIGGER_EPWM19_SOCA
ePWM19, ADCSOCA
Definition: adc/v1/adc.h:204
ADC_disableContinuousMode
static void ADC_disableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1694
ADC_TRIGGER_ECAP4_SOCEVT
@ ADC_TRIGGER_ECAP4_SOCEVT
eCAP4, SOCEVT
Definition: adc/v1/adc.h:234
ADC_SOC_NUMBER12
@ ADC_SOC_NUMBER12
SOC/EOC number 12.
Definition: adc/v1/adc.h:336
ADC_TRIGGER_EPWM7_SOCA
@ ADC_TRIGGER_EPWM7_SOCA
ePWM7, ADCSOCA
Definition: adc/v1/adc.h:180
ADC_TRIGGER_EPWM16_SOCB
@ ADC_TRIGGER_EPWM16_SOCB
ePWM16, ADCSOCB
Definition: adc/v1/adc.h:199
ADC_setPrescaler
static void ADC_setPrescaler(uint32_t base, ADC_ClkPrescale clkPrescale)
Definition: adc/v1/adc.h:427
ADC_SOC_NUMBER14
@ ADC_SOC_NUMBER14
SOC/EOC number 14.
Definition: adc/v1/adc.h:338
ADC_TRIGGER_EPWM30_SOCA
@ ADC_TRIGGER_EPWM30_SOCA
ePWM30, ADCSOCA
Definition: adc/v1/adc.h:226
ADC_PRI_THRU_SOC2_HIPRI
@ ADC_PRI_THRU_SOC2_HIPRI
SOC 0-2 hi pri, others in round robin.
Definition: adc/v1/adc.h:366
ADC_INT_NUMBER2
@ ADC_INT_NUMBER2
ADCINT2 Interrupt.
Definition: adc/v1/adc.h:294
ADC_PULSE_END_OF_ACQ_WIN
@ ADC_PULSE_END_OF_ACQ_WIN
Occurs at the end of the acquisition window.
Definition: adc/v1/adc.h:277
ADC_TRIGGER_ECAP0_SOCEVT
@ ADC_TRIGGER_ECAP0_SOCEVT
eCAP0, SOCEVT
Definition: adc/v1/adc.h:230
ADC_TRIGGER_EPWM18_SOCB
@ ADC_TRIGGER_EPWM18_SOCB
ePWM18, ADCSOCB
Definition: adc/v1/adc.h:203
ADC_CH_ADCIN2_ADCIN3
@ ADC_CH_ADCIN2_ADCIN3
differential, ADCIN2 and ADCIN3
Definition: adc/v1/adc.h:261
DebugP.h
ADC_setPPBTripLimits
void ADC_setPPBTripLimits(uint32_t base, ADC_PPBNumber ppbNumber, int32_t tripHiLimit, int32_t tripLoLimit)
ADC_SignalMode
ADC_SignalMode
Definition: adc/v1/adc.h:146
ADC_CH_ADCIN4_ADCIN5
@ ADC_CH_ADCIN4_ADCIN5
differential, ADCIN4 and ADCIN5
Definition: adc/v1/adc.h:263
ADC_TRIGGER_EPWM18_SOCA
@ ADC_TRIGGER_EPWM18_SOCA
ePWM18, ADCSOCA
Definition: adc/v1/adc.h:202
ADC_CLK_DIV_1_0
@ ADC_CLK_DIV_1_0
ADCCLK = (input clock) / 1.0.
Definition: adc/v1/adc.h:111
ADC_TRIGGER_SW_ONLY
@ ADC_TRIGGER_SW_ONLY
Software only.
Definition: adc/v1/adc.h:160
ADC_TRIGGER_INPUT_XBAR_OUT5
@ ADC_TRIGGER_INPUT_XBAR_OUT5
InputXBar.Out[5].
Definition: adc/v1/adc.h:165
ADC_TRIGGER_EPWM11_SOCA
@ ADC_TRIGGER_EPWM11_SOCA
ePWM11, ADCSOCA
Definition: adc/v1/adc.h:188
ADC_readPPBResult
static int32_t ADC_readPPBResult(uint32_t resultBase, ADC_PPBNumber ppbNumber)
Definition: adc/v1/adc.h:1243
ADC_TRIGGER_EPWM3_SOCB
@ ADC_TRIGGER_EPWM3_SOCB
ePWM3, ADCSOCB
Definition: adc/v1/adc.h:173
ADC_PRI_ALL_HIPRI
@ ADC_PRI_ALL_HIPRI
All priorities based on SOC number.
Definition: adc/v1/adc.h:379
ADC_PRI_SOC0_HIPRI
@ ADC_PRI_SOC0_HIPRI
SOC 0 hi pri, others in round robin.
Definition: adc/v1/adc.h:364
ADC_TRIGGER_EPWM0_SOCA
@ ADC_TRIGGER_EPWM0_SOCA
ePWM0, ADCSOCA
Definition: adc/v1/adc.h:166
ADC_CH_ADCIN0_ADCIN1
@ ADC_CH_ADCIN0_ADCIN1
differential, ADCIN0 and ADCIN1
Definition: adc/v1/adc.h:259
ADC_SOC_NUMBER6
@ ADC_SOC_NUMBER6
SOC/EOC number 6.
Definition: adc/v1/adc.h:330
ADC_enableInterrupt
static void ADC_enableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1526
ADC_TRIGGER_EPWM20_SOCB
@ ADC_TRIGGER_EPWM20_SOCB
ePWM20, ADCSOCB
Definition: adc/v1/adc.h:207
ADC_TRIGGER_EPWM1_SOCA
@ ADC_TRIGGER_EPWM1_SOCA
ePWM1, ADCSOCA
Definition: adc/v1/adc.h:168
ADC_SOC_NUMBER4
@ ADC_SOC_NUMBER4
SOC/EOC number 4.
Definition: adc/v1/adc.h:328
ADC_CH_ADCIN3
@ ADC_CH_ADCIN3
single-ended, ADCIN3
Definition: adc/v1/adc.h:254
ADC_RESULT_ADCRESULTx_STEP
#define ADC_RESULT_ADCRESULTx_STEP
Register offset difference between 2 ADCRESULTx registers.
Definition: adc/v1/adc.h:400
ADC_TRIGGER_RTI2
@ ADC_TRIGGER_RTI2
RTI Timer 2.
Definition: adc/v1/adc.h:163
ADC_TRIGGER_EPWM19_SOCB
@ ADC_TRIGGER_EPWM19_SOCB
ePWM19, ADCSOCB
Definition: adc/v1/adc.h:205
ADC_TRIGGER_EPWM20_SOCA
@ ADC_TRIGGER_EPWM20_SOCA
ePWM20, ADCSOCA
Definition: adc/v1/adc.h:206
ADC_CLK_DIV_3_0
@ ADC_CLK_DIV_3_0
ADCCLK = (input clock) / 3.0.
Definition: adc/v1/adc.h:114
ADC_setSOCPriority
static void ADC_setSOCPriority(uint32_t base, ADC_PriorityMode priMode)
Definition: adc/v1/adc.h:991
ADC_TRIGGER_EPWM23_SOCB
@ ADC_TRIGGER_EPWM23_SOCB
ePWM23, ADCSOCB
Definition: adc/v1/adc.h:213
ADC_disableBurstMode
static void ADC_disableBurstMode(uint32_t base)
Definition: adc/v1/adc.h:953
ADC_isBusy
static bool ADC_isBusy(uint32_t base)
Definition: adc/v1/adc.h:860
ADC_TRIGGER_RTI3
@ ADC_TRIGGER_RTI3
RTI Timer 3.
Definition: adc/v1/adc.h:164
ADC_setPPBReferenceOffset
static void ADC_setPPBReferenceOffset(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t offset)
Definition: adc/v1/adc.h:1353
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:177
ADC_CH_ADCIN1_ADCIN0
@ ADC_CH_ADCIN1_ADCIN0
differential, ADCIN1 and ADCIN0
Definition: adc/v1/adc.h:260
ADC_TRIGGER_EPWM21_SOCA
@ ADC_TRIGGER_EPWM21_SOCA
ePWM21, ADCSOCA
Definition: adc/v1/adc.h:208
ADC_CLK_DIV_5_5
@ ADC_CLK_DIV_5_5
ADCCLK = (input clock) / 5.5.
Definition: adc/v1/adc.h:119
ADC_ADCPPBx_STEP
#define ADC_ADCPPBx_STEP
Register offset difference between 2 ADCPPBxCONFIG registers.
Definition: adc/v1/adc.h:392
ADC_TRIGGER_EPWM22_SOCA
@ ADC_TRIGGER_EPWM22_SOCA
ePWM22, ADCSOCA
Definition: adc/v1/adc.h:210
ADC_Channel
ADC_Channel
Definition: adc/v1/adc.h:250
ADC_CH_CAL1
@ ADC_CH_CAL1
single-ended, CAL1
Definition: adc/v1/adc.h:258
ADC_CLK_DIV_4_5
@ ADC_CLK_DIV_4_5
ADCCLK = (input clock) / 4.5.
Definition: adc/v1/adc.h:117
ADC_PPB_NUMBER1
@ ADC_PPB_NUMBER1
Post-processing block 1.
Definition: adc/v1/adc.h:307
ADC_TRIGGER_EPWM8_SOCB
@ ADC_TRIGGER_EPWM8_SOCB
ePWM8, ADCSOCB
Definition: adc/v1/adc.h:183
ADC_TRIGGER_EPWM0_SOCB
@ ADC_TRIGGER_EPWM0_SOCB
ePWM0, ADCSOCB
Definition: adc/v1/adc.h:167
ADC_TRIGGER_EPWM24_SOCB
@ ADC_TRIGGER_EPWM24_SOCB
ePWM24, ADCSOCB
Definition: adc/v1/adc.h:215
ADC_CLK_DIV_2_5
@ ADC_CLK_DIV_2_5
ADCCLK = (input clock) / 2.5.
Definition: adc/v1/adc.h:113
ADC_IntNumber
ADC_IntNumber
Definition: adc/v1/adc.h:292
ADC_CH_CAL0_CAL1
@ ADC_CH_CAL0_CAL1
differential, CAL0 and CAL1
Definition: adc/v1/adc.h:265
ADC_TRIGGER_EPWM13_SOCA
@ ADC_TRIGGER_EPWM13_SOCA
ePWM13, ADCSOCA
Definition: adc/v1/adc.h:192
ADC_TRIGGER_EPWM5_SOCA
@ ADC_TRIGGER_EPWM5_SOCA
ePWM5, ADCSOCA
Definition: adc/v1/adc.h:176
ADC_SOC_NUMBER2
@ ADC_SOC_NUMBER2
SOC/EOC number 2.
Definition: adc/v1/adc.h:326
ADC_TRIGGER_EPWM21_SOCB
@ ADC_TRIGGER_EPWM21_SOCB
ePWM21, ADCSOCB
Definition: adc/v1/adc.h:209
ADC_TRIGGER_EPWM25_SOCB
@ ADC_TRIGGER_EPWM25_SOCB
ePWM25, ADCSOCB
Definition: adc/v1/adc.h:217
ADC_clearPPBEventStatus
static void ADC_clearPPBEventStatus(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
Definition: adc/v1/adc.h:1209
ADC_TRIGGER_RTI0
@ ADC_TRIGGER_RTI0
RTI Timer 0.
Definition: adc/v1/adc.h:161
ADC_TRIGGER_EPWM14_SOCA
@ ADC_TRIGGER_EPWM14_SOCA
ePWM14, ADCSOCA
Definition: adc/v1/adc.h:194
ADC_TRIGGER_EPWM26_SOCB
@ ADC_TRIGGER_EPWM26_SOCB
ePWM26, ADCSOCB
Definition: adc/v1/adc.h:219
ADC_PPB_NUMBER2
@ ADC_PPB_NUMBER2
Post-processing block 2.
Definition: adc/v1/adc.h:308
ADC_setupSOC
static void ADC_setupSOC(uint32_t base, ADC_SOCNumber socNumber, ADC_Trigger trigger, ADC_Channel channel, uint32_t sampleWindow)
Definition: adc/v1/adc.h:475
ADC_TRIGGER_EPWM4_SOCB
@ ADC_TRIGGER_EPWM4_SOCB
ePWM4, ADCSOCB
Definition: adc/v1/adc.h:175