AM263x MCU+ SDK  08.03.00
adc/v1/adc.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 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 {
231 
232 //*****************************************************************************
233 //
237 //
238 //*****************************************************************************
239 typedef enum
240 {
256 } ADC_Channel;
257 
258 //*****************************************************************************
259 //
262 //
263 //*****************************************************************************
264 typedef enum
265 {
271 
272 //*****************************************************************************
273 //
279 //
280 //*****************************************************************************
281 typedef enum
282 {
286  ADC_INT_NUMBER4 = 3
288 
289 //*****************************************************************************
290 //
293 //
294 //*****************************************************************************
295 typedef enum
296 {
300  ADC_PPB_NUMBER4 = 3
302 
303 //*****************************************************************************
304 //
310 //
311 //*****************************************************************************
312 typedef enum
313 {
329  ADC_SOC_NUMBER15 = 15
331 
332 //*****************************************************************************
333 //
336 //
337 //*****************************************************************************
338 typedef enum
339 {
344 
345 //*****************************************************************************
346 //
349 //
350 //*****************************************************************************
351 typedef enum
352 {
369  ADC_PRI_ALL_HIPRI = 16
371 
372 //*****************************************************************************
373 //
375 //
376 //*****************************************************************************
378 #define ADC_ADCSOCxCTL_STEP (CSL_ADC_ADCSOC1CTL - CSL_ADC_ADCSOC0CTL)
379 #define ADC_ADCINTSELxNy_STEP (CSL_ADC_ADCINTSEL3N4 - CSL_ADC_ADCINTSEL1N2)
381 #define ADC_ADCPPBx_STEP (CSL_ADC_ADCPPB2CONFIG - CSL_ADC_ADCPPB1CONFIG)
383 #define ADC_ADCPPBTRIP_MASK ((uint32_t)CSL_ADC_ADCPPB1TRIPHI_LIMITHI_MASK \
385  | (uint32_t)CSL_ADC_ADCPPB1TRIPHI_HSIGN_MASK)
386 #define ADC_RESULT_ADCPPBxRESULT_STEP (CSL_ADC_RESULT_ADCPPB2RESULT -\
388  CSL_ADC_RESULT_ADCPPB1RESULT)
389 #define ADC_RESULT_ADCRESULTx_STEP (CSL_ADC_RESULT_ADCRESULT1 - \
391  CSL_ADC_RESULT_ADCRESULT0)
392 
393 //*****************************************************************************
394 //
395 // Prototypes for the APIs.
396 //
397 //*****************************************************************************
398 //*****************************************************************************
399 //
414 //
415 //*****************************************************************************
416 static inline void
417 ADC_setPrescaler(uint32_t base, ADC_ClkPrescale clkPrescale)
418 {
419  //
420  // Set the configuration of the ADC module prescaler.
421  //
422  HW_WR_REG16(base + CSL_ADC_ADCCTL2,
423  ((HW_RD_REG16(base + CSL_ADC_ADCCTL2) &
424  ~CSL_ADC_ADCCTL2_PRESCALE_MASK) | (uint16_t)clkPrescale));
425 }
426 
427 //*****************************************************************************
428 //
462 //
463 //*****************************************************************************
464 static inline void
465 ADC_setupSOC(uint32_t base, ADC_SOCNumber socNumber, ADC_Trigger trigger,
466  ADC_Channel channel, uint32_t sampleWindow)
467 {
468  uint32_t ctlRegAddr;
469 
470  //
471  // Check the arguments.
472  //
473  DebugP_assert((sampleWindow >= 1U) && (sampleWindow <= 512U));
474 
475  //
476  // Calculate address for the SOC control register.
477  //
478  ctlRegAddr = base + CSL_ADC_ADCSOC0CTL +
479  ((uint32_t)socNumber * ADC_ADCSOCxCTL_STEP);
480 
481  //
482  // Set the configuration of the specified SOC.
483  //
484  HW_WR_REG32(ctlRegAddr,
485  (((uint32_t)channel << CSL_ADC_ADCSOC0CTL_CHSEL_SHIFT) |
486  ((uint32_t)trigger << CSL_ADC_ADCSOC0CTL_TRIGSEL_SHIFT) |
487  (sampleWindow - 1U)));
488 }
489 
490 //*****************************************************************************
491 //
515 //
516 //*****************************************************************************
517 static inline void
518 ADC_setInterruptSOCTrigger(uint32_t base, ADC_SOCNumber socNumber,
519  ADC_IntSOCTrigger trigger)
520 {
521  uint16_t shiftVal;
522 
523  //
524  // Each SOC has a 2-bit field in this register.
525  //
526  shiftVal = (uint16_t)socNumber << 1U;
527 
528  //
529  // Set the configuration of the specified SOC. Note that we're treating
530  // ADCINTSOCSEL1 and ADCINTSOCSEL2 as one 32-bit register here.
531  //
532  HW_WR_REG32(base + CSL_ADC_ADCINTSOCSEL1,
533  ((HW_RD_REG32(base + CSL_ADC_ADCINTSOCSEL1) &
534  ~((uint32_t)CSL_ADC_ADCINTSOCSEL1_SOC0_MASK << shiftVal)) |
535  ((uint32_t)trigger << shiftVal)));
536 }
537 
538 //*****************************************************************************
539 //
553 //
554 //*****************************************************************************
555 static inline void
556 ADC_setInterruptPulseMode(uint32_t base, ADC_PulseMode pulseMode)
557 {
558  //
559  // Set the position of the pulse.
560  //
561  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
562  ((HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
563  ~CSL_ADC_ADCCTL1_INTPULSEPOS_MASK) |
564  ((uint16_t)pulseMode<<CSL_ADC_ADCCTL1_INTPULSEPOS_SHIFT)));
565 }
566 
567 //*****************************************************************************
568 //
584 //
585 //*****************************************************************************
586 static inline void
587 ADC_setInterruptCycleOffset(uint32_t base, uint16_t cycleOffset)
588 {
589  //
590  // Set the position of the pulse.
591  //
592  HW_WR_REG16(base + CSL_ADC_ADCINTCYCLE, cycleOffset);
593 }
594 
595 //*****************************************************************************
596 //
608 //
609 //*****************************************************************************
610 static inline void
611 ADC_enableConverter(uint32_t base)
612 {
613  //
614  // Set the bit that powers up the analog circuitry.
615  //
616  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
617  (HW_RD_REG16(base + CSL_ADC_ADCCTL1) | CSL_ADC_ADCCTL1_ADCPWDNZ_MASK));
618 }
619 
620 //*****************************************************************************
621 //
629 //
630 //*****************************************************************************
631 static inline void
632 ADC_disableConverter(uint32_t base)
633 {
634  //
635  // Clear the bit that powers down the analog circuitry.
636  //
637  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
638  (HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
639  ~CSL_ADC_ADCCTL1_ADCPWDNZ_MASK));
640 }
641 
642 //*****************************************************************************
643 //
655 //
656 //*****************************************************************************
657 static inline void
658 ADC_forceSOC(uint32_t base, ADC_SOCNumber socNumber)
659 {
660  //
661  // Write to the register that will force a 1 to the corresponding SOC flag
662  //
663  HW_WR_REG16(base + CSL_ADC_ADCSOCFRC1, (1U << (uint16_t)socNumber));
664 }
665 
666 //*****************************************************************************
667 //
685 //
686 //*****************************************************************************
687 static inline void
688 ADC_forceMultipleSOC(uint32_t base, uint16_t socMask)
689 {
690  //
691  // Write to the register that will force a 1 to desired SOCs
692  //
693  HW_WR_REG16(base + CSL_ADC_ADCSOCFRC1, socMask);
694 }
695 
696 //*****************************************************************************
697 //
712 //
713 //*****************************************************************************
714 static inline bool
715 ADC_getInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
716 {
717  //
718  // Get the specified ADC interrupt status.
719  //
720  return((HW_RD_REG16(base + CSL_ADC_ADCINTFLG) &
721  (1U << (uint16_t)adcIntNum)) != 0U);
722 }
723 
724 //*****************************************************************************
725 //
740 //
741 //*****************************************************************************
742 static inline void
743 ADC_clearInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
744 {
745  //
746  // Clear the specified interrupt.
747  //
748  HW_WR_REG16(base + CSL_ADC_ADCINTFLGCLR, (1U << (uint16_t)adcIntNum));
749 }
750 
751 //*****************************************************************************
752 //
768 //
769 //*****************************************************************************
770 static inline bool
772 {
773  //
774  // Get the specified ADC interrupt status.
775  //
776  return((HW_RD_REG16(base + CSL_ADC_ADCINTOVF) &
777  (1U << (uint16_t)adcIntNum)) != 0U);
778 }
779 
780 //*****************************************************************************
781 //
796 //
797 //*****************************************************************************
798 static inline void
800 {
801  //
802  // Clear the specified interrupt overflow bit.
803  //
804  HW_WR_REG16(base + CSL_ADC_ADCINTOVFCLR, (1U << (uint16_t)adcIntNum));
805 }
806 
807 //*****************************************************************************
808 //
824 //
825 //*****************************************************************************
826 static inline uint16_t
827 ADC_readResult(uint32_t resultBase, ADC_SOCNumber socNumber)
828 {
829  //
830  // Return the ADC result for the selected SOC.
831  //
832  return(HW_RD_REG16(resultBase + CSL_ADC_RESULT_ADCRESULT0 +
833  socNumber * ADC_RESULT_ADCRESULTx_STEP));
834 }
835 
836 //*****************************************************************************
837 //
847 //
848 //*****************************************************************************
849 static inline bool
850 ADC_isBusy(uint32_t base)
851 {
852  //
853  // Determine if the ADC is busy.
854  //
855  return((HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
856  CSL_ADC_ADCCTL1_ADCBSY_MASK) != 0U);
857 }
858 
859 //*****************************************************************************
860 //
878 //
879 //*****************************************************************************
880 static inline void
881 ADC_setBurstModeConfig(uint32_t base, ADC_Trigger trigger, uint16_t burstSize)
882 {
883  uint16_t regValue;
884 
885  //
886  // Check the arguments.
887  //
888  DebugP_assert((trigger & ~0x7FU) == 0U);
889  DebugP_assert((burstSize >= 1U) && (burstSize <= 16U));
890 
891  //
892  // Write the burst mode configuration to the register.
893  //
894  regValue = (uint16_t)trigger |
895  ((burstSize - 1U) << CSL_ADC_ADCBURSTCTL_BURSTSIZE_SHIFT);
896 
897  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
898  ((HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) &
899  ~((uint16_t)CSL_ADC_ADCBURSTCTL_BURSTTRIGSEL_MASK |
900  CSL_ADC_ADCBURSTCTL_BURSTSIZE_MASK)) | regValue));
901 }
902 
903 //*****************************************************************************
904 //
916 //
917 //*****************************************************************************
918 static inline void
919 ADC_enableBurstMode(uint32_t base)
920 {
921  //
922  // Enable burst mode.
923  //
924  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
925  (HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) |
926  CSL_ADC_ADCBURSTCTL_BURSTEN_MASK));
927 }
928 
929 //*****************************************************************************
930 //
940 //
941 //*****************************************************************************
942 static inline void
943 ADC_disableBurstMode(uint32_t base)
944 {
945  //
946  // Disable burst mode.
947  //
948  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
949  (HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) &
950  ~CSL_ADC_ADCBURSTCTL_BURSTEN_MASK));
951 }
952 
953 //*****************************************************************************
954 //
978 //
979 //*****************************************************************************
980 static inline void
981 ADC_setSOCPriority(uint32_t base, ADC_PriorityMode priMode)
982 {
983  //
984  // Set SOC priority
985  //
986  HW_WR_REG16(base + CSL_ADC_ADCSOCPRICTL,
987  ((HW_RD_REG16(base + CSL_ADC_ADCSOCPRICTL) &
988  ~CSL_ADC_ADCSOCPRICTL_SOCPRIORITY_MASK) | (uint16_t)priMode));
989 }
990 
991 //*****************************************************************************
992 //
1015 //
1016 //*****************************************************************************
1017 static inline void
1018 ADC_setupPPB(uint32_t base, ADC_PPBNumber ppbNumber, ADC_SOCNumber socNumber)
1019 {
1020  uint32_t ppbOffset;
1021 
1022  //
1023  // Get the offset to the appropriate PPB configuration register.
1024  //
1025  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1026  CSL_ADC_ADCPPB1CONFIG;
1027 
1028  //
1029  // Write the configuration to the register.
1030  //
1031  HW_WR_REG16(base + ppbOffset,
1032  ((HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1CONFIG_CONFIG_MASK) |
1033  ((uint16_t)socNumber & CSL_ADC_ADCPPB1CONFIG_CONFIG_MASK)));
1034 }
1035 
1036 //*****************************************************************************
1037 //
1049 //
1050 //*****************************************************************************
1051 static inline void
1052 ADC_enablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
1053 {
1054  //
1055  // Check the arguments.
1056  //
1057  DebugP_assert((evtFlags & ~0x7U) == 0U);
1058 
1059  //
1060  // Enable the specified event.
1061  //
1062  HW_WR_REG16(base + CSL_ADC_ADCEVTSEL,
1063  (HW_RD_REG16(base + CSL_ADC_ADCEVTSEL) |
1064  (evtFlags << ((uint16_t)ppbNumber * 4U))));
1065 }
1066 
1067 //*****************************************************************************
1068 //
1079 //
1080 //*****************************************************************************
1081 static inline void
1082 ADC_disablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
1083 {
1084  //
1085  // Check the arguments.
1086  //
1087  DebugP_assert((evtFlags & ~0x7U) == 0U);
1088 
1089  //
1090  // Disable the specified event.
1091  //
1092  HW_WR_REG16(base + CSL_ADC_ADCEVTSEL,
1093  (HW_RD_REG16(base + CSL_ADC_ADCEVTSEL) &
1094  ~(evtFlags << ((uint16_t)ppbNumber * 4U))));
1095 }
1096 
1097 //*****************************************************************************
1098 //
1110 //
1111 //*****************************************************************************
1112 static inline void
1114  uint16_t intFlags)
1115 {
1116  //
1117  // Check the arguments.
1118  //
1119  DebugP_assert((intFlags & ~0x7U) == 0U);
1120 
1121  //
1122  // Enable the specified event interrupts.
1123  //
1124  HW_WR_REG16(base + CSL_ADC_ADCEVTINTSEL,
1125  (HW_RD_REG16(base + CSL_ADC_ADCEVTINTSEL) |
1126  (intFlags << ((uint16_t)ppbNumber * 4U))));
1127 }
1128 
1129 //*****************************************************************************
1130 //
1142 //
1143 //*****************************************************************************
1144 static inline void
1146  uint16_t intFlags)
1147 {
1148  //
1149  // Check the arguments.
1150  //
1151  DebugP_assert((intFlags & ~0x7U) == 0U);
1152 
1153  //
1154  // Disable the specified event interrupts.
1155  //
1156  HW_WR_REG16(base + CSL_ADC_ADCEVTINTSEL,
1157  (HW_RD_REG16(base + CSL_ADC_ADCEVTINTSEL) &
1158  ~(intFlags << ((uint16_t)ppbNumber * 4U))));
1159 }
1160 
1161 //*****************************************************************************
1162 //
1171 //
1172 //*****************************************************************************
1173 static inline uint16_t
1174 ADC_getPPBEventStatus(uint32_t base, ADC_PPBNumber ppbNumber)
1175 {
1176  //
1177  // Get the event status for the specified post-processing block.
1178  //
1179  return((HW_RD_REG16(base + CSL_ADC_ADCEVTSTAT) >>
1180  ((uint16_t)ppbNumber * 4U)) & 0x7U);
1181 }
1182 
1183 //*****************************************************************************
1184 //
1196 //
1197 //*****************************************************************************
1198 static inline void
1199 ADC_clearPPBEventStatus(uint32_t base, ADC_PPBNumber ppbNumber,
1200  uint16_t evtFlags)
1201 {
1202  //
1203  // Check the arguments.
1204  //
1205  DebugP_assert((evtFlags & ~0x7U) == 0U);
1206 
1207  //
1208  // Clear the specified event interrupts.
1209  //
1210  HW_WR_REG16(base + CSL_ADC_ADCEVTCLR,
1211  (HW_RD_REG16(base + CSL_ADC_ADCEVTCLR) |
1212  evtFlags << ((uint16_t)ppbNumber * 4U)));
1213 }
1214 
1215 //*****************************************************************************
1216 //
1230 //
1231 //*****************************************************************************
1232 static inline int32_t
1233 ADC_readPPBResult(uint32_t resultBase, ADC_PPBNumber ppbNumber)
1234 {
1235  //
1236  // Return the result of selected PPB.
1237  //
1238  return((int32_t)HW_RD_REG32(resultBase + CSL_ADC_RESULT_ADCPPB1RESULT +
1239  (ppbNumber * ADC_RESULT_ADCPPBxRESULT_STEP)));
1240 }
1241 
1242 //*****************************************************************************
1243 //
1254 //
1255 //*****************************************************************************
1256 static inline uint16_t
1257 ADC_getPPBDelayTimeStamp(uint32_t base, ADC_PPBNumber ppbNumber)
1258 {
1259  uint32_t ppbOffset;
1260 
1261  //
1262  // Get the offset to the appropriate delay.
1263  //
1264  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1265  CSL_ADC_ADCPPB1STAMP;
1266 
1267  //
1268  // Return the delay time stamp.
1269  //
1270  return(HW_RD_REG16(base + ppbOffset) & CSL_ADC_ADCPPB1STAMP_DLYSTAMP_MASK);
1271 }
1272 
1273 //*****************************************************************************
1274 //
1297 //
1298 //*****************************************************************************
1299 static inline void
1301  int16_t offset)
1302 {
1303  uint32_t ppbOffset;
1304 
1305  //
1306  // Get the offset to the appropriate offset register.
1307  //
1308  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1309  CSL_ADC_ADCPPB1OFFCAL;
1310 
1311  //
1312  // Write the offset amount.
1313  //
1314  HW_WR_REG16(base + ppbOffset,
1315  ((HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1OFFCAL_OFFCAL_MASK) |
1316  ((uint16_t)offset & CSL_ADC_ADCPPB1OFFCAL_OFFCAL_MASK)));
1317 }
1318 
1319 //*****************************************************************************
1320 //
1340 //
1341 //*****************************************************************************
1342 static inline void
1343 ADC_setPPBReferenceOffset(uint32_t base, ADC_PPBNumber ppbNumber,
1344  uint16_t offset)
1345 {
1346  uint32_t ppbOffset;
1347 
1348  //
1349  // Get the offset to the appropriate offset register.
1350  //
1351  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1352  CSL_ADC_ADCPPB1OFFREF;
1353 
1354  //
1355  // Write the offset amount.
1356  //
1357  HW_WR_REG16(base + ppbOffset, offset);
1358 }
1359 
1360 //*****************************************************************************
1361 //
1375 //
1376 //*****************************************************************************
1377 static inline void
1379 {
1380  uint32_t ppbOffset;
1381 
1382  //
1383  // Get the offset to the appropriate PPB configuration register.
1384  //
1385  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1386  CSL_ADC_ADCPPB1CONFIG;
1387 
1388  //
1389  // Enable the twos complement
1390  //
1391  HW_WR_REG16(base + ppbOffset,
1392  (HW_RD_REG16(base + ppbOffset) |
1393  CSL_ADC_ADCPPB1CONFIG_TWOSCOMPEN_MASK));
1394 }
1395 
1396 //*****************************************************************************
1397 //
1411 //
1412 //*****************************************************************************
1413 static inline void
1415 {
1416  uint32_t ppbOffset;
1417 
1418  //
1419  // Get the offset to the appropriate PPB configuration register.
1420  //
1421  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1422  CSL_ADC_ADCPPB1CONFIG;
1423 
1424  //
1425  // Disable the twos complement
1426  //
1427  HW_WR_REG16(base + ppbOffset,
1428  (HW_RD_REG16(base + ppbOffset) &
1429  ~CSL_ADC_ADCPPB1CONFIG_TWOSCOMPEN_MASK));
1430 }
1431 
1432 //*****************************************************************************
1433 //
1445 //
1446 //*****************************************************************************
1447 static inline void
1448 ADC_enablePPBEventCBCClear(uint32_t base, uint32_t ppbNumber)
1449 {
1450  uint32_t ppbOffset;
1451 
1452  //
1453  // Get the offset to the appropriate PPB configuration register.
1454  //
1455  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1456  CSL_ADC_ADCPPB1CONFIG;
1457 
1458  //
1459  // Set automatic cycle-by-cycle flag clear bit
1460  //
1461  HW_WR_REG16(base + ppbOffset,
1462  (HW_RD_REG16(base + ppbOffset) | CSL_ADC_ADCPPB1CONFIG_CBCEN_MASK));
1463 }
1464 
1465 //*****************************************************************************
1466 //
1477 //
1478 //*****************************************************************************
1479 static inline void
1480 ADC_disablePPBEventCBCClear(uint32_t base, uint32_t ppbNumber)
1481 {
1482  uint32_t ppbOffset;
1483 
1484  //
1485  // Get the offset to the appropriate PPB configuration register.
1486  //
1487  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1488  CSL_ADC_ADCPPB1CONFIG;
1489 
1490  //
1491  // Clear automatic cycle-by-cycle flag clear bit
1492  //
1493  HW_WR_REG16(base + ppbOffset,
1494  (HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1CONFIG_CBCEN_MASK));
1495 }
1496 
1497 //*****************************************************************************
1498 //
1513 //
1514 //*****************************************************************************
1515 static inline void
1516 ADC_enableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
1517 {
1518  uint32_t intRegAddr;
1519  uint16_t shiftVal;
1520 
1521  //
1522  // Each INTSEL register manages two interrupts. If the interrupt number is
1523  // even, we'll be accessing the upper byte and will need to shift.
1524  //
1525  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1526  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1527  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1528 
1529  //
1530  // Enable the specified ADC interrupt.
1531  //
1532  HW_WR_REG16(intRegAddr,
1533  HW_RD_REG16(intRegAddr) |
1534  (CSL_ADC_ADCINTSEL1N2_INT1E_MASK << shiftVal));
1535 }
1536 
1537 //*****************************************************************************
1538 //
1553 //
1554 //*****************************************************************************
1555 static inline void
1556 ADC_disableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
1557 {
1558  uint32_t intRegAddr;
1559  uint16_t shiftVal;
1560 
1561  //
1562  // Each INTSEL register manages two interrupts. If the interrupt number is
1563  // even, we'll be accessing the upper byte and will need to shift.
1564  //
1565  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1566  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1567  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1568 
1569  //
1570  // Disable the specified ADC interrupt.
1571  //
1572  HW_WR_REG16(intRegAddr,
1573  HW_RD_REG16(intRegAddr) &
1574  ~(CSL_ADC_ADCINTSEL1N2_INT1E_MASK << shiftVal));
1575 }
1576 
1577 //*****************************************************************************
1578 //
1596 //
1597 //*****************************************************************************
1598 static inline void
1599 ADC_setInterruptSource(uint32_t base, ADC_IntNumber adcIntNum,
1600  ADC_SOCNumber socNumber)
1601 {
1602  uint32_t intRegAddr;
1603  uint16_t shiftVal;
1604 
1605  //
1606  // Each INTSEL register manages two interrupts. If the interrupt number is
1607  // even, we'll be accessing the upper byte and will need to shift.
1608  //
1609  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1610  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1611  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1612 
1613  //
1614  // Set the specified ADC interrupt source.
1615  //
1616  HW_WR_REG16(intRegAddr,
1617  ((HW_RD_REG16(intRegAddr) &
1618  ~(CSL_ADC_ADCINTSEL1N2_INT1SEL_MASK << shiftVal)) |
1619  ((uint16_t)socNumber << shiftVal)));
1620 }
1621 
1622 //*****************************************************************************
1623 //
1639 //
1640 //*****************************************************************************
1641 static inline void
1642 ADC_enableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
1643 {
1644  uint32_t intRegAddr;
1645  uint16_t shiftVal;
1646 
1647  //
1648  // Each INTSEL register manages two interrupts. If the interrupt number is
1649  // even, we'll be accessing the upper byte and will need to shift.
1650  //
1651  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1652  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1653  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1654 
1655  //
1656  // Enable continuous mode for the specified ADC interrupt.
1657  //
1658  HW_WR_REG16(intRegAddr,
1659  HW_RD_REG16(intRegAddr) |
1660  (CSL_ADC_ADCINTSEL1N2_INT1CONT_MASK << shiftVal));
1661 }
1662 
1663 //*****************************************************************************
1664 //
1681 //
1682 //*****************************************************************************
1683 static inline void
1684 ADC_disableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
1685 {
1686  uint32_t intRegAddr;
1687  uint16_t shiftVal;
1688 
1689  //
1690  // Each INTSEL register manages two interrupts. If the interrupt number is
1691  // even, we'll be accessing the upper byte and will need to shift.
1692  //
1693  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1694  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1695  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1696 
1697  //
1698  // Disable continuous mode for the specified ADC interrupt.
1699  //
1700  HW_WR_REG16(intRegAddr,
1701  HW_RD_REG16(intRegAddr) &
1702  ~(CSL_ADC_ADCINTSEL1N2_INT1CONT_MASK << shiftVal));
1703 }
1704 
1705 //
1725 //
1726 //*****************************************************************************
1727 extern void
1728 ADC_setMode(uint32_t base, ADC_Resolution resolution,
1729  ADC_SignalMode signalMode);
1730 
1731 //*****************************************************************************
1732 //
1751 //
1752 //*****************************************************************************
1753 extern void
1754 ADC_setPPBTripLimits(uint32_t base, ADC_PPBNumber ppbNumber,
1755  int32_t tripHiLimit, int32_t tripLoLimit);
1756 
1757 //*****************************************************************************
1758 //
1759 // Close the Doxygen group.
1761 //
1762 //*****************************************************************************
1763 
1764 //*****************************************************************************
1765 //
1766 // Mark the end of the C bindings section for C++ compilers.
1767 //
1768 //*****************************************************************************
1769 #ifdef __cplusplus
1770 }
1771 #endif
1772 
1773 #endif // ADC_V1_H_
ADC_SOC_NUMBER7
@ ADC_SOC_NUMBER7
SOC/EOC number 7.
Definition: adc/v1/adc.h:321
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:329
ADC_SOC_NUMBER9
@ ADC_SOC_NUMBER9
SOC/EOC number 9.
Definition: adc/v1/adc.h:323
ADC_CH_ADCIN3_ADCIN2
@ ADC_CH_ADCIN3_ADCIN2
differential, ADCIN3 and ADCIN2
Definition: adc/v1/adc.h:252
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:387
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:1145
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:1414
ADC_ClkPrescale
ADC_ClkPrescale
Definition: adc/v1/adc.h:110
ADC_INT_NUMBER3
@ ADC_INT_NUMBER3
ADCINT3 Interrupt.
Definition: adc/v1/adc.h:285
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:243
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:1174
ADC_PULSE_END_OF_CONV
@ ADC_PULSE_END_OF_CONV
Occurs at the end of the conversion.
Definition: adc/v1/adc.h:269
ADC_clearInterruptOverflowStatus
static void ADC_clearInterruptOverflowStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:799
ADC_enableBurstMode
static void ADC_enableBurstMode(uint32_t base)
Definition: adc/v1/adc.h:919
ADC_CH_ADCIN0
@ ADC_CH_ADCIN0
single-ended, ADCIN0
Definition: adc/v1/adc.h:241
ADC_SOC_NUMBER8
@ ADC_SOC_NUMBER8
SOC/EOC number 8.
Definition: adc/v1/adc.h:322
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:315
ADC_PRI_THRU_SOC5_HIPRI
@ ADC_PRI_THRU_SOC5_HIPRI
SOC 0-5 hi pri, others in round robin.
Definition: adc/v1/adc.h:359
ADC_disablePPBEvent
static void ADC_disablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
Definition: adc/v1/adc.h:1082
ADC_INT_SOC_TRIGGER_ADCINT1
@ ADC_INT_SOC_TRIGGER_ADCINT1
ADCINT1 will trigger the SOC.
Definition: adc/v1/adc.h:341
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:286
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:325
ADC_ADCINTSELxNy_STEP
#define ADC_ADCINTSELxNy_STEP
Register offset difference between 2 ADCINTSELxNy registers.
Definition: adc/v1/adc.h:380
ADC_INT_SOC_TRIGGER_NONE
@ ADC_INT_SOC_TRIGGER_NONE
No ADCINT will trigger the SOC.
Definition: adc/v1/adc.h:340
ADC_PRI_THRU_SOC14_HIPRI
@ ADC_PRI_THRU_SOC14_HIPRI
SOC 0-14 hi pri, SOC15 in round robin.
Definition: adc/v1/adc.h:368
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:1448
ADC_forceMultipleSOC
static void ADC_forceMultipleSOC(uint32_t base, uint16_t socMask)
Definition: adc/v1/adc.h:688
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:1480
ADC_PulseMode
ADC_PulseMode
Definition: adc/v1/adc.h:265
ADC_TRIGGER_EPWM29_SOCB
@ ADC_TRIGGER_EPWM29_SOCB
ePWM29, ADCSOCB
Definition: adc/v1/adc.h:225
ADC_ADCSOCxCTL_STEP
#define ADC_ADCSOCxCTL_STEP
Defines used by the driver.
Definition: adc/v1/adc.h:378
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:556
ADC_setInterruptSource
static void ADC_setInterruptSource(uint32_t base, ADC_IntNumber adcIntNum, ADC_SOCNumber socNumber)
Definition: adc/v1/adc.h:1599
ADC_PRI_THRU_SOC10_HIPRI
@ ADC_PRI_THRU_SOC10_HIPRI
SOC 0-10 hi pri, others in round robin.
Definition: adc/v1/adc.h:364
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:365
ADC_PRI_THRU_SOC3_HIPRI
@ ADC_PRI_THRU_SOC3_HIPRI
SOC 0-3 hi pri, others in round robin.
Definition: adc/v1/adc.h:357
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:358
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:361
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:313
ADC_CH_ADCIN1
@ ADC_CH_ADCIN1
single-ended, ADCIN1
Definition: adc/v1/adc.h:242
ADC_setBurstModeConfig
static void ADC_setBurstModeConfig(uint32_t base, ADC_Trigger trigger, uint16_t burstSize)
Definition: adc/v1/adc.h:881
ADC_enableContinuousMode
static void ADC_enableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1642
ADC_INT_NUMBER1
@ ADC_INT_NUMBER1
ADCINT1 Interrupt.
Definition: adc/v1/adc.h:283
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:518
ADC_CH_CAL0
@ ADC_CH_CAL0
single-ended, CAL0
Definition: adc/v1/adc.h:247
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:317
ADC_getInterruptStatus
static bool ADC_getInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:715
ADC_getPPBDelayTimeStamp
static uint16_t ADC_getPPBDelayTimeStamp(uint32_t base, ADC_PPBNumber ppbNumber)
Definition: adc/v1/adc.h:1257
ADC_SOC_NUMBER10
@ ADC_SOC_NUMBER10
SOC/EOC number 10.
Definition: adc/v1/adc.h:324
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:1052
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:367
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:360
ADC_setInterruptCycleOffset
static void ADC_setInterruptCycleOffset(uint32_t base, uint16_t cycleOffset)
Definition: adc/v1/adc.h:587
ADC_setPPBCalibrationOffset
static void ADC_setPPBCalibrationOffset(uint32_t base, ADC_PPBNumber ppbNumber, int16_t offset)
Definition: adc/v1/adc.h:1300
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:296
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:353
ADC_TRIGGER_EPWM17_SOCA
@ ADC_TRIGGER_EPWM17_SOCA
ePWM17, ADCSOCA
Definition: adc/v1/adc.h:200
ADC_SOC_NUMBER0
@ ADC_SOC_NUMBER0
SOC/EOC number 0.
Definition: adc/v1/adc.h:314
ADC_IntSOCTrigger
ADC_IntSOCTrigger
Definition: adc/v1/adc.h:339
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:299
ADC_clearInterruptStatus
static void ADC_clearInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:743
ADC_PriorityMode
ADC_PriorityMode
Definition: adc/v1/adc.h:352
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:362
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:319
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:342
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:611
ADC_PPB_NUMBER4
@ ADC_PPB_NUMBER4
Post-processing block 4.
Definition: adc/v1/adc.h:300
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:827
ADC_CH_ADCIN5_ADCIN4
@ ADC_CH_ADCIN5_ADCIN4
differential, ADCIN5 and ADCIN4
Definition: adc/v1/adc.h:254
ADC_SOC_NUMBER13
@ ADC_SOC_NUMBER13
SOC/EOC number 13.
Definition: adc/v1/adc.h:327
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:363
ADC_CH_ADCIN5
@ ADC_CH_ADCIN5
single-ended, ADCIN5
Definition: adc/v1/adc.h:246
ADC_TRIGGER_EPWM8_SOCA
@ ADC_TRIGGER_EPWM8_SOCA
ePWM8, ADCSOCA
Definition: adc/v1/adc.h:182
ADC_enablePPBTwosComplement
static void ADC_enablePPBTwosComplement(uint32_t base, ADC_PPBNumber ppbNumber)
Definition: adc/v1/adc.h:1378
ADC_disableInterrupt
static void ADC_disableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1556
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:1018
ADC_getInterruptOverflowStatus
static bool ADC_getInterruptOverflowStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:771
ADC_PRI_THRU_SOC1_HIPRI
@ ADC_PRI_THRU_SOC1_HIPRI
SOC 0-1 hi pri, others in round robin.
Definition: adc/v1/adc.h:355
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:658
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:632
ADC_enablePPBEventInterrupt
static void ADC_enablePPBEventInterrupt(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t intFlags)
Definition: adc/v1/adc.h:1113
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:366
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:245
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:1684
ADC_SOC_NUMBER12
@ ADC_SOC_NUMBER12
SOC/EOC number 12.
Definition: adc/v1/adc.h:326
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:417
ADC_SOC_NUMBER14
@ ADC_SOC_NUMBER14
SOC/EOC number 14.
Definition: adc/v1/adc.h:328
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:356
ADC_INT_NUMBER2
@ ADC_INT_NUMBER2
ADCINT2 Interrupt.
Definition: adc/v1/adc.h:284
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:267
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:251
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:253
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:1233
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:369
ADC_PRI_SOC0_HIPRI
@ ADC_PRI_SOC0_HIPRI
SOC 0 hi pri, others in round robin.
Definition: adc/v1/adc.h:354
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:249
ADC_SOC_NUMBER6
@ ADC_SOC_NUMBER6
SOC/EOC number 6.
Definition: adc/v1/adc.h:320
ADC_enableInterrupt
static void ADC_enableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1516
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:318
ADC_CH_ADCIN3
@ ADC_CH_ADCIN3
single-ended, ADCIN3
Definition: adc/v1/adc.h:244
ADC_RESULT_ADCRESULTx_STEP
#define ADC_RESULT_ADCRESULTx_STEP
Register offset difference between 2 ADCRESULTx registers.
Definition: adc/v1/adc.h:390
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:981
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:943
ADC_isBusy
static bool ADC_isBusy(uint32_t base)
Definition: adc/v1/adc.h:850
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:1343
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:159
ADC_CH_ADCIN1_ADCIN0
@ ADC_CH_ADCIN1_ADCIN0
differential, ADCIN1 and ADCIN0
Definition: adc/v1/adc.h:250
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:382
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:240
ADC_CH_CAL1
@ ADC_CH_CAL1
single-ended, CAL1
Definition: adc/v1/adc.h:248
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:297
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:282
ADC_CH_CAL0_CAL1
@ ADC_CH_CAL0_CAL1
differential, CAL0 and CAL1
Definition: adc/v1/adc.h:255
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:316
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:1199
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:298
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:465
ADC_TRIGGER_EPWM4_SOCB
@ ADC_TRIGGER_EPWM4_SOCB
ePWM4, ADCSOCB
Definition: adc/v1/adc.h:175