AM263x MCU+ SDK  08.02.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 {
253 } ADC_Channel;
254 
255 //*****************************************************************************
256 //
259 //
260 //*****************************************************************************
261 typedef enum
262 {
268 
269 //*****************************************************************************
270 //
276 //
277 //*****************************************************************************
278 typedef enum
279 {
283  ADC_INT_NUMBER4 = 3
285 
286 //*****************************************************************************
287 //
290 //
291 //*****************************************************************************
292 typedef enum
293 {
297  ADC_PPB_NUMBER4 = 3
299 
300 //*****************************************************************************
301 //
307 //
308 //*****************************************************************************
309 typedef enum
310 {
326  ADC_SOC_NUMBER15 = 15
328 
329 //*****************************************************************************
330 //
333 //
334 //*****************************************************************************
335 typedef enum
336 {
341 
342 //*****************************************************************************
343 //
346 //
347 //*****************************************************************************
348 typedef enum
349 {
366  ADC_PRI_ALL_HIPRI = 16
368 
369 //*****************************************************************************
370 //
372 //
373 //*****************************************************************************
375 #define ADC_ADCSOCxCTL_STEP (CSL_ADC_ADCSOC1CTL - CSL_ADC_ADCSOC0CTL)
376 #define ADC_ADCINTSELxNy_STEP (CSL_ADC_ADCINTSEL3N4 - CSL_ADC_ADCINTSEL1N2)
378 #define ADC_ADCPPBx_STEP (CSL_ADC_ADCPPB2CONFIG - CSL_ADC_ADCPPB1CONFIG)
380 #define ADC_ADCPPBTRIP_MASK ((uint32_t)CSL_ADC_ADCPPB1TRIPHI_LIMITHI_MASK \
382  | (uint32_t)CSL_ADC_ADCPPB1TRIPHI_HSIGN_MASK)
383 #define ADC_RESULT_ADCPPBxRESULT_STEP (CSL_ADC_RESULT_ADCPPB2RESULT -\
385  CSL_ADC_RESULT_ADCPPB1RESULT)
386 #define ADC_RESULT_ADCRESULTx_STEP (CSL_ADC_RESULT_ADCRESULT1 - \
388  CSL_ADC_RESULT_ADCRESULT0)
389 
390 //*****************************************************************************
391 //
392 // Prototypes for the APIs.
393 //
394 //*****************************************************************************
395 //*****************************************************************************
396 //
411 //
412 //*****************************************************************************
413 static inline void
414 ADC_setPrescaler(uint32_t base, ADC_ClkPrescale clkPrescale)
415 {
416  //
417  // Set the configuration of the ADC module prescaler.
418  //
419  HW_WR_REG16(base + CSL_ADC_ADCCTL2,
420  ((HW_RD_REG16(base + CSL_ADC_ADCCTL2) &
421  ~CSL_ADC_ADCCTL2_PRESCALE_MASK) | (uint16_t)clkPrescale));
422 }
423 
424 //*****************************************************************************
425 //
459 //
460 //*****************************************************************************
461 static inline void
462 ADC_setupSOC(uint32_t base, ADC_SOCNumber socNumber, ADC_Trigger trigger,
463  ADC_Channel channel, uint32_t sampleWindow)
464 {
465  uint32_t ctlRegAddr;
466 
467  //
468  // Check the arguments.
469  //
470  DebugP_assert((sampleWindow >= 1U) && (sampleWindow <= 512U));
471 
472  //
473  // Calculate address for the SOC control register.
474  //
475  ctlRegAddr = base + CSL_ADC_ADCSOC0CTL +
476  ((uint32_t)socNumber * ADC_ADCSOCxCTL_STEP);
477 
478  //
479  // Set the configuration of the specified SOC.
480  //
481  HW_WR_REG32(ctlRegAddr,
482  (((uint32_t)channel << CSL_ADC_ADCSOC0CTL_CHSEL_SHIFT) |
483  ((uint32_t)trigger << CSL_ADC_ADCSOC0CTL_TRIGSEL_SHIFT) |
484  (sampleWindow - 1U)));
485 }
486 
487 //*****************************************************************************
488 //
512 //
513 //*****************************************************************************
514 static inline void
515 ADC_setInterruptSOCTrigger(uint32_t base, ADC_SOCNumber socNumber,
516  ADC_IntSOCTrigger trigger)
517 {
518  uint16_t shiftVal;
519 
520  //
521  // Each SOC has a 2-bit field in this register.
522  //
523  shiftVal = (uint16_t)socNumber << 1U;
524 
525  //
526  // Set the configuration of the specified SOC. Note that we're treating
527  // ADCINTSOCSEL1 and ADCINTSOCSEL2 as one 32-bit register here.
528  //
529  HW_WR_REG32(base + CSL_ADC_ADCINTSOCSEL1,
530  ((HW_RD_REG32(base + CSL_ADC_ADCINTSOCSEL1) &
531  ~((uint32_t)CSL_ADC_ADCINTSOCSEL1_SOC0_MASK << shiftVal)) |
532  ((uint32_t)trigger << shiftVal)));
533 }
534 
535 //*****************************************************************************
536 //
550 //
551 //*****************************************************************************
552 static inline void
553 ADC_setInterruptPulseMode(uint32_t base, ADC_PulseMode pulseMode)
554 {
555  //
556  // Set the position of the pulse.
557  //
558  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
559  ((HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
560  ~CSL_ADC_ADCCTL1_INTPULSEPOS_MASK) |
561  ((uint16_t)pulseMode<<CSL_ADC_ADCCTL1_INTPULSEPOS_SHIFT)));
562 }
563 
564 //*****************************************************************************
565 //
581 //
582 //*****************************************************************************
583 static inline void
584 ADC_setInterruptCycleOffset(uint32_t base, uint16_t cycleOffset)
585 {
586  //
587  // Set the position of the pulse.
588  //
589  HW_WR_REG16(base + CSL_ADC_ADCINTCYCLE, cycleOffset);
590 }
591 
592 //*****************************************************************************
593 //
605 //
606 //*****************************************************************************
607 static inline void
608 ADC_enableConverter(uint32_t base)
609 {
610  //
611  // Set the bit that powers up the analog circuitry.
612  //
613  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
614  (HW_RD_REG16(base + CSL_ADC_ADCCTL1) | CSL_ADC_ADCCTL1_ADCPWDNZ_MASK));
615 }
616 
617 //*****************************************************************************
618 //
626 //
627 //*****************************************************************************
628 static inline void
629 ADC_disableConverter(uint32_t base)
630 {
631  //
632  // Clear the bit that powers down the analog circuitry.
633  //
634  HW_WR_REG16(base + CSL_ADC_ADCCTL1,
635  (HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
636  ~CSL_ADC_ADCCTL1_ADCPWDNZ_MASK));
637 }
638 
639 //*****************************************************************************
640 //
652 //
653 //*****************************************************************************
654 static inline void
655 ADC_forceSOC(uint32_t base, ADC_SOCNumber socNumber)
656 {
657  //
658  // Write to the register that will force a 1 to the corresponding SOC flag
659  //
660  HW_WR_REG16(base + CSL_ADC_ADCSOCFRC1, (1U << (uint16_t)socNumber));
661 }
662 
663 //*****************************************************************************
664 //
682 //
683 //*****************************************************************************
684 static inline void
685 ADC_forceMultipleSOC(uint32_t base, uint16_t socMask)
686 {
687  //
688  // Write to the register that will force a 1 to desired SOCs
689  //
690  HW_WR_REG16(base + CSL_ADC_ADCSOCFRC1, socMask);
691 }
692 
693 //*****************************************************************************
694 //
709 //
710 //*****************************************************************************
711 static inline bool
712 ADC_getInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
713 {
714  //
715  // Get the specified ADC interrupt status.
716  //
717  return((HW_RD_REG16(base + CSL_ADC_ADCINTFLG) &
718  (1U << (uint16_t)adcIntNum)) != 0U);
719 }
720 
721 //*****************************************************************************
722 //
737 //
738 //*****************************************************************************
739 static inline void
740 ADC_clearInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
741 {
742  //
743  // Clear the specified interrupt.
744  //
745  HW_WR_REG16(base + CSL_ADC_ADCINTFLGCLR, (1U << (uint16_t)adcIntNum));
746 }
747 
748 //*****************************************************************************
749 //
765 //
766 //*****************************************************************************
767 static inline bool
769 {
770  //
771  // Get the specified ADC interrupt status.
772  //
773  return((HW_RD_REG16(base + CSL_ADC_ADCINTOVF) &
774  (1U << (uint16_t)adcIntNum)) != 0U);
775 }
776 
777 //*****************************************************************************
778 //
793 //
794 //*****************************************************************************
795 static inline void
797 {
798  //
799  // Clear the specified interrupt overflow bit.
800  //
801  HW_WR_REG16(base + CSL_ADC_ADCINTOVFCLR, (1U << (uint16_t)adcIntNum));
802 }
803 
804 //*****************************************************************************
805 //
821 //
822 //*****************************************************************************
823 static inline uint16_t
824 ADC_readResult(uint32_t resultBase, ADC_SOCNumber socNumber)
825 {
826  //
827  // Return the ADC result for the selected SOC.
828  //
829  return(HW_RD_REG16(resultBase + CSL_ADC_RESULT_ADCRESULT0 +
830  socNumber * ADC_RESULT_ADCRESULTx_STEP));
831 }
832 
833 //*****************************************************************************
834 //
844 //
845 //*****************************************************************************
846 static inline bool
847 ADC_isBusy(uint32_t base)
848 {
849  //
850  // Determine if the ADC is busy.
851  //
852  return((HW_RD_REG16(base + CSL_ADC_ADCCTL1) &
853  CSL_ADC_ADCCTL1_ADCBSY_MASK) != 0U);
854 }
855 
856 //*****************************************************************************
857 //
875 //
876 //*****************************************************************************
877 static inline void
878 ADC_setBurstModeConfig(uint32_t base, ADC_Trigger trigger, uint16_t burstSize)
879 {
880  uint16_t regValue;
881 
882  //
883  // Check the arguments.
884  //
885  DebugP_assert((trigger & ~0x7FU) == 0U);
886  DebugP_assert((burstSize >= 1U) && (burstSize <= 16U));
887 
888  //
889  // Write the burst mode configuration to the register.
890  //
891  regValue = (uint16_t)trigger |
892  ((burstSize - 1U) << CSL_ADC_ADCBURSTCTL_BURSTSIZE_SHIFT);
893 
894  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
895  ((HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) &
896  ~((uint16_t)CSL_ADC_ADCBURSTCTL_BURSTTRIGSEL_MASK |
897  CSL_ADC_ADCBURSTCTL_BURSTSIZE_MASK)) | regValue));
898 }
899 
900 //*****************************************************************************
901 //
913 //
914 //*****************************************************************************
915 static inline void
916 ADC_enableBurstMode(uint32_t base)
917 {
918  //
919  // Enable burst mode.
920  //
921  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
922  (HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) |
923  CSL_ADC_ADCBURSTCTL_BURSTEN_MASK));
924 }
925 
926 //*****************************************************************************
927 //
937 //
938 //*****************************************************************************
939 static inline void
940 ADC_disableBurstMode(uint32_t base)
941 {
942  //
943  // Disable burst mode.
944  //
945  HW_WR_REG16(base + CSL_ADC_ADCBURSTCTL,
946  (HW_RD_REG16(base + CSL_ADC_ADCBURSTCTL) &
947  ~CSL_ADC_ADCBURSTCTL_BURSTEN_MASK));
948 }
949 
950 //*****************************************************************************
951 //
975 //
976 //*****************************************************************************
977 static inline void
978 ADC_setSOCPriority(uint32_t base, ADC_PriorityMode priMode)
979 {
980  //
981  // Set SOC priority
982  //
983  HW_WR_REG16(base + CSL_ADC_ADCSOCPRICTL,
984  ((HW_RD_REG16(base + CSL_ADC_ADCSOCPRICTL) &
985  ~CSL_ADC_ADCSOCPRICTL_SOCPRIORITY_MASK) | (uint16_t)priMode));
986 }
987 
988 //*****************************************************************************
989 //
1012 //
1013 //*****************************************************************************
1014 static inline void
1015 ADC_setupPPB(uint32_t base, ADC_PPBNumber ppbNumber, ADC_SOCNumber socNumber)
1016 {
1017  uint32_t ppbOffset;
1018 
1019  //
1020  // Get the offset to the appropriate PPB configuration register.
1021  //
1022  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1023  CSL_ADC_ADCPPB1CONFIG;
1024 
1025  //
1026  // Write the configuration to the register.
1027  //
1028  HW_WR_REG16(base + ppbOffset,
1029  ((HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1CONFIG_CONFIG_MASK) |
1030  ((uint16_t)socNumber & CSL_ADC_ADCPPB1CONFIG_CONFIG_MASK)));
1031 }
1032 
1033 //*****************************************************************************
1034 //
1046 //
1047 //*****************************************************************************
1048 static inline void
1049 ADC_enablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
1050 {
1051  //
1052  // Check the arguments.
1053  //
1054  DebugP_assert((evtFlags & ~0x7U) == 0U);
1055 
1056  //
1057  // Enable the specified event.
1058  //
1059  HW_WR_REG16(base + CSL_ADC_ADCEVTSEL,
1060  (HW_RD_REG16(base + CSL_ADC_ADCEVTSEL) |
1061  (evtFlags << ((uint16_t)ppbNumber * 4U))));
1062 }
1063 
1064 //*****************************************************************************
1065 //
1076 //
1077 //*****************************************************************************
1078 static inline void
1079 ADC_disablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
1080 {
1081  //
1082  // Check the arguments.
1083  //
1084  DebugP_assert((evtFlags & ~0x7U) == 0U);
1085 
1086  //
1087  // Disable the specified event.
1088  //
1089  HW_WR_REG16(base + CSL_ADC_ADCEVTSEL,
1090  (HW_RD_REG16(base + CSL_ADC_ADCEVTSEL) &
1091  ~(evtFlags << ((uint16_t)ppbNumber * 4U))));
1092 }
1093 
1094 //*****************************************************************************
1095 //
1107 //
1108 //*****************************************************************************
1109 static inline void
1111  uint16_t intFlags)
1112 {
1113  //
1114  // Check the arguments.
1115  //
1116  DebugP_assert((intFlags & ~0x7U) == 0U);
1117 
1118  //
1119  // Enable the specified event interrupts.
1120  //
1121  HW_WR_REG16(base + CSL_ADC_ADCEVTINTSEL,
1122  (HW_RD_REG16(base + CSL_ADC_ADCEVTINTSEL) |
1123  (intFlags << ((uint16_t)ppbNumber * 4U))));
1124 }
1125 
1126 //*****************************************************************************
1127 //
1139 //
1140 //*****************************************************************************
1141 static inline void
1143  uint16_t intFlags)
1144 {
1145  //
1146  // Check the arguments.
1147  //
1148  DebugP_assert((intFlags & ~0x7U) == 0U);
1149 
1150  //
1151  // Disable the specified event interrupts.
1152  //
1153  HW_WR_REG16(base + CSL_ADC_ADCEVTINTSEL,
1154  (HW_RD_REG16(base + CSL_ADC_ADCEVTINTSEL) &
1155  ~(intFlags << ((uint16_t)ppbNumber * 4U))));
1156 }
1157 
1158 //*****************************************************************************
1159 //
1168 //
1169 //*****************************************************************************
1170 static inline uint16_t
1171 ADC_getPPBEventStatus(uint32_t base, ADC_PPBNumber ppbNumber)
1172 {
1173  //
1174  // Get the event status for the specified post-processing block.
1175  //
1176  return((HW_RD_REG16(base + CSL_ADC_ADCEVTSTAT) >>
1177  ((uint16_t)ppbNumber * 4U)) & 0x7U);
1178 }
1179 
1180 //*****************************************************************************
1181 //
1193 //
1194 //*****************************************************************************
1195 static inline void
1196 ADC_clearPPBEventStatus(uint32_t base, ADC_PPBNumber ppbNumber,
1197  uint16_t evtFlags)
1198 {
1199  //
1200  // Check the arguments.
1201  //
1202  DebugP_assert((evtFlags & ~0x7U) == 0U);
1203 
1204  //
1205  // Clear the specified event interrupts.
1206  //
1207  HW_WR_REG16(base + CSL_ADC_ADCEVTCLR,
1208  (HW_RD_REG16(base + CSL_ADC_ADCEVTCLR) |
1209  evtFlags << ((uint16_t)ppbNumber * 4U)));
1210 }
1211 
1212 //*****************************************************************************
1213 //
1227 //
1228 //*****************************************************************************
1229 static inline int32_t
1230 ADC_readPPBResult(uint32_t resultBase, ADC_PPBNumber ppbNumber)
1231 {
1232  //
1233  // Return the result of selected PPB.
1234  //
1235  return((int32_t)HW_RD_REG32(resultBase + CSL_ADC_RESULT_ADCPPB1RESULT +
1236  (ppbNumber * ADC_RESULT_ADCPPBxRESULT_STEP)));
1237 }
1238 
1239 //*****************************************************************************
1240 //
1251 //
1252 //*****************************************************************************
1253 static inline uint16_t
1254 ADC_getPPBDelayTimeStamp(uint32_t base, ADC_PPBNumber ppbNumber)
1255 {
1256  uint32_t ppbOffset;
1257 
1258  //
1259  // Get the offset to the appropriate delay.
1260  //
1261  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1262  CSL_ADC_ADCPPB1STAMP;
1263 
1264  //
1265  // Return the delay time stamp.
1266  //
1267  return(HW_RD_REG16(base + ppbOffset) & CSL_ADC_ADCPPB1STAMP_DLYSTAMP_MASK);
1268 }
1269 
1270 //*****************************************************************************
1271 //
1294 //
1295 //*****************************************************************************
1296 static inline void
1298  int16_t offset)
1299 {
1300  uint32_t ppbOffset;
1301 
1302  //
1303  // Get the offset to the appropriate offset register.
1304  //
1305  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1306  CSL_ADC_ADCPPB1OFFCAL;
1307 
1308  //
1309  // Write the offset amount.
1310  //
1311  HW_WR_REG16(base + ppbOffset,
1312  ((HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1OFFCAL_OFFCAL_MASK) |
1313  ((uint16_t)offset & CSL_ADC_ADCPPB1OFFCAL_OFFCAL_MASK)));
1314 }
1315 
1316 //*****************************************************************************
1317 //
1337 //
1338 //*****************************************************************************
1339 static inline void
1340 ADC_setPPBReferenceOffset(uint32_t base, ADC_PPBNumber ppbNumber,
1341  uint16_t offset)
1342 {
1343  uint32_t ppbOffset;
1344 
1345  //
1346  // Get the offset to the appropriate offset register.
1347  //
1348  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1349  CSL_ADC_ADCPPB1OFFREF;
1350 
1351  //
1352  // Write the offset amount.
1353  //
1354  HW_WR_REG16(base + ppbOffset, offset);
1355 }
1356 
1357 //*****************************************************************************
1358 //
1372 //
1373 //*****************************************************************************
1374 static inline void
1376 {
1377  uint32_t ppbOffset;
1378 
1379  //
1380  // Get the offset to the appropriate PPB configuration register.
1381  //
1382  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1383  CSL_ADC_ADCPPB1CONFIG;
1384 
1385  //
1386  // Enable the twos complement
1387  //
1388  HW_WR_REG16(base + ppbOffset,
1389  (HW_RD_REG16(base + ppbOffset) |
1390  CSL_ADC_ADCPPB1CONFIG_TWOSCOMPEN_MASK));
1391 }
1392 
1393 //*****************************************************************************
1394 //
1408 //
1409 //*****************************************************************************
1410 static inline void
1412 {
1413  uint32_t ppbOffset;
1414 
1415  //
1416  // Get the offset to the appropriate PPB configuration register.
1417  //
1418  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1419  CSL_ADC_ADCPPB1CONFIG;
1420 
1421  //
1422  // Disable the twos complement
1423  //
1424  HW_WR_REG16(base + ppbOffset,
1425  (HW_RD_REG16(base + ppbOffset) &
1426  ~CSL_ADC_ADCPPB1CONFIG_TWOSCOMPEN_MASK));
1427 }
1428 
1429 //*****************************************************************************
1430 //
1442 //
1443 //*****************************************************************************
1444 static inline void
1445 ADC_enablePPBEventCBCClear(uint32_t base, uint32_t ppbNumber)
1446 {
1447  uint32_t ppbOffset;
1448 
1449  //
1450  // Get the offset to the appropriate PPB configuration register.
1451  //
1452  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1453  CSL_ADC_ADCPPB1CONFIG;
1454 
1455  //
1456  // Set automatic cycle-by-cycle flag clear bit
1457  //
1458  HW_WR_REG16(base + ppbOffset,
1459  (HW_RD_REG16(base + ppbOffset) | CSL_ADC_ADCPPB1CONFIG_CBCEN_MASK));
1460 }
1461 
1462 //*****************************************************************************
1463 //
1474 //
1475 //*****************************************************************************
1476 static inline void
1477 ADC_disablePPBEventCBCClear(uint32_t base, uint32_t ppbNumber)
1478 {
1479  uint32_t ppbOffset;
1480 
1481  //
1482  // Get the offset to the appropriate PPB configuration register.
1483  //
1484  ppbOffset = (ADC_ADCPPBx_STEP * (uint32_t)ppbNumber) +
1485  CSL_ADC_ADCPPB1CONFIG;
1486 
1487  //
1488  // Clear automatic cycle-by-cycle flag clear bit
1489  //
1490  HW_WR_REG16(base + ppbOffset,
1491  (HW_RD_REG16(base + ppbOffset) & ~CSL_ADC_ADCPPB1CONFIG_CBCEN_MASK));
1492 }
1493 
1494 //*****************************************************************************
1495 //
1510 //
1511 //*****************************************************************************
1512 static inline void
1513 ADC_enableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
1514 {
1515  uint32_t intRegAddr;
1516  uint16_t shiftVal;
1517 
1518  //
1519  // Each INTSEL register manages two interrupts. If the interrupt number is
1520  // even, we'll be accessing the upper byte and will need to shift.
1521  //
1522  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1523  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1524  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1525 
1526  //
1527  // Enable the specified ADC interrupt.
1528  //
1529  HW_WR_REG16(intRegAddr,
1530  HW_RD_REG16(intRegAddr) |
1531  (CSL_ADC_ADCINTSEL1N2_INT1E_MASK << shiftVal));
1532 }
1533 
1534 //*****************************************************************************
1535 //
1550 //
1551 //*****************************************************************************
1552 static inline void
1553 ADC_disableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
1554 {
1555  uint32_t intRegAddr;
1556  uint16_t shiftVal;
1557 
1558  //
1559  // Each INTSEL register manages two interrupts. If the interrupt number is
1560  // even, we'll be accessing the upper byte and will need to shift.
1561  //
1562  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1563  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1564  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1565 
1566  //
1567  // Disable the specified ADC interrupt.
1568  //
1569  HW_WR_REG16(intRegAddr,
1570  HW_RD_REG16(intRegAddr) &
1571  ~(CSL_ADC_ADCINTSEL1N2_INT1E_MASK << shiftVal));
1572 }
1573 
1574 //*****************************************************************************
1575 //
1593 //
1594 //*****************************************************************************
1595 static inline void
1596 ADC_setInterruptSource(uint32_t base, ADC_IntNumber adcIntNum,
1597  ADC_SOCNumber socNumber)
1598 {
1599  uint32_t intRegAddr;
1600  uint16_t shiftVal;
1601 
1602  //
1603  // Each INTSEL register manages two interrupts. If the interrupt number is
1604  // even, we'll be accessing the upper byte and will need to shift.
1605  //
1606  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1607  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1608  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1609 
1610  //
1611  // Set the specified ADC interrupt source.
1612  //
1613  HW_WR_REG16(intRegAddr,
1614  ((HW_RD_REG16(intRegAddr) &
1615  ~(CSL_ADC_ADCINTSEL1N2_INT1SEL_MASK << shiftVal)) |
1616  ((uint16_t)socNumber << shiftVal)));
1617 }
1618 
1619 //*****************************************************************************
1620 //
1636 //
1637 //*****************************************************************************
1638 static inline void
1639 ADC_enableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
1640 {
1641  uint32_t intRegAddr;
1642  uint16_t shiftVal;
1643 
1644  //
1645  // Each INTSEL register manages two interrupts. If the interrupt number is
1646  // even, we'll be accessing the upper byte and will need to shift.
1647  //
1648  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1649  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1650  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1651 
1652  //
1653  // Enable continuous mode for the specified ADC interrupt.
1654  //
1655  HW_WR_REG16(intRegAddr,
1656  HW_RD_REG16(intRegAddr) |
1657  (CSL_ADC_ADCINTSEL1N2_INT1CONT_MASK << shiftVal));
1658 }
1659 
1660 //*****************************************************************************
1661 //
1678 //
1679 //*****************************************************************************
1680 static inline void
1681 ADC_disableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
1682 {
1683  uint32_t intRegAddr;
1684  uint16_t shiftVal;
1685 
1686  //
1687  // Each INTSEL register manages two interrupts. If the interrupt number is
1688  // even, we'll be accessing the upper byte and will need to shift.
1689  //
1690  intRegAddr = base + CSL_ADC_ADCINTSEL1N2 +
1691  ((uint32_t)adcIntNum >> 1) * ADC_ADCINTSELxNy_STEP;
1692  shiftVal = ((uint16_t)adcIntNum & 0x1U) << 3U;
1693 
1694  //
1695  // Disable continuous mode for the specified ADC interrupt.
1696  //
1697  HW_WR_REG16(intRegAddr,
1698  HW_RD_REG16(intRegAddr) &
1699  ~(CSL_ADC_ADCINTSEL1N2_INT1CONT_MASK << shiftVal));
1700 }
1701 
1702 //
1722 //
1723 //*****************************************************************************
1724 extern void
1725 ADC_setMode(uint32_t base, ADC_Resolution resolution,
1726  ADC_SignalMode signalMode);
1727 
1728 //*****************************************************************************
1729 //
1748 //
1749 //*****************************************************************************
1750 extern void
1751 ADC_setPPBTripLimits(uint32_t base, ADC_PPBNumber ppbNumber,
1752  int32_t tripHiLimit, int32_t tripLoLimit);
1753 
1754 //*****************************************************************************
1755 //
1756 // Close the Doxygen group.
1758 //
1759 //*****************************************************************************
1760 
1761 //*****************************************************************************
1762 //
1763 // Mark the end of the C bindings section for C++ compilers.
1764 //
1765 //*****************************************************************************
1766 #ifdef __cplusplus
1767 }
1768 #endif
1769 
1770 #endif // ADC_V1_H_
ADC_SOC_NUMBER7
@ ADC_SOC_NUMBER7
SOC/EOC number 7.
Definition: adc/v1/adc.h:318
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:326
ADC_SOC_NUMBER9
@ ADC_SOC_NUMBER9
SOC/EOC number 9.
Definition: adc/v1/adc.h:320
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:384
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:1142
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:1411
ADC_ClkPrescale
ADC_ClkPrescale
Definition: adc/v1/adc.h:110
ADC_INT_NUMBER3
@ ADC_INT_NUMBER3
ADCINT3 Interrupt.
Definition: adc/v1/adc.h:282
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:1171
ADC_PULSE_END_OF_CONV
@ ADC_PULSE_END_OF_CONV
Occurs at the end of the conversion.
Definition: adc/v1/adc.h:266
ADC_clearInterruptOverflowStatus
static void ADC_clearInterruptOverflowStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:796
ADC_enableBurstMode
static void ADC_enableBurstMode(uint32_t base)
Definition: adc/v1/adc.h:916
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:319
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:312
ADC_PRI_THRU_SOC5_HIPRI
@ ADC_PRI_THRU_SOC5_HIPRI
SOC 0-5 hi pri, others in round robin.
Definition: adc/v1/adc.h:356
ADC_disablePPBEvent
static void ADC_disablePPBEvent(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
Definition: adc/v1/adc.h:1079
ADC_INT_SOC_TRIGGER_ADCINT1
@ ADC_INT_SOC_TRIGGER_ADCINT1
ADCINT1 will trigger the SOC.
Definition: adc/v1/adc.h:338
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:283
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:322
ADC_ADCINTSELxNy_STEP
#define ADC_ADCINTSELxNy_STEP
Register offset difference between 2 ADCINTSELxNy registers.
Definition: adc/v1/adc.h:377
ADC_INT_SOC_TRIGGER_NONE
@ ADC_INT_SOC_TRIGGER_NONE
No ADCINT will trigger the SOC.
Definition: adc/v1/adc.h:337
ADC_PRI_THRU_SOC14_HIPRI
@ ADC_PRI_THRU_SOC14_HIPRI
SOC 0-14 hi pri, SOC15 in round robin.
Definition: adc/v1/adc.h:365
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:1445
ADC_forceMultipleSOC
static void ADC_forceMultipleSOC(uint32_t base, uint16_t socMask)
Definition: adc/v1/adc.h:685
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:1477
ADC_PulseMode
ADC_PulseMode
Definition: adc/v1/adc.h:262
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:375
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:553
ADC_setInterruptSource
static void ADC_setInterruptSource(uint32_t base, ADC_IntNumber adcIntNum, ADC_SOCNumber socNumber)
Definition: adc/v1/adc.h:1596
ADC_PRI_THRU_SOC10_HIPRI
@ ADC_PRI_THRU_SOC10_HIPRI
SOC 0-10 hi pri, others in round robin.
Definition: adc/v1/adc.h:361
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:362
ADC_PRI_THRU_SOC3_HIPRI
@ ADC_PRI_THRU_SOC3_HIPRI
SOC 0-3 hi pri, others in round robin.
Definition: adc/v1/adc.h:354
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:355
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:358
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:310
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:878
ADC_enableContinuousMode
static void ADC_enableContinuousMode(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1639
ADC_INT_NUMBER1
@ ADC_INT_NUMBER1
ADCINT1 Interrupt.
Definition: adc/v1/adc.h:280
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:515
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:314
ADC_getInterruptStatus
static bool ADC_getInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:712
ADC_getPPBDelayTimeStamp
static uint16_t ADC_getPPBDelayTimeStamp(uint32_t base, ADC_PPBNumber ppbNumber)
Definition: adc/v1/adc.h:1254
ADC_SOC_NUMBER10
@ ADC_SOC_NUMBER10
SOC/EOC number 10.
Definition: adc/v1/adc.h:321
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:1049
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:364
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:357
ADC_setInterruptCycleOffset
static void ADC_setInterruptCycleOffset(uint32_t base, uint16_t cycleOffset)
Definition: adc/v1/adc.h:584
ADC_setPPBCalibrationOffset
static void ADC_setPPBCalibrationOffset(uint32_t base, ADC_PPBNumber ppbNumber, int16_t offset)
Definition: adc/v1/adc.h:1297
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:293
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:350
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:311
ADC_IntSOCTrigger
ADC_IntSOCTrigger
Definition: adc/v1/adc.h:336
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:296
ADC_clearInterruptStatus
static void ADC_clearInterruptStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:740
ADC_PriorityMode
ADC_PriorityMode
Definition: adc/v1/adc.h:349
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:359
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:316
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:339
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:608
ADC_PPB_NUMBER4
@ ADC_PPB_NUMBER4
Post-processing block 4.
Definition: adc/v1/adc.h:297
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:824
ADC_SOC_NUMBER13
@ ADC_SOC_NUMBER13
SOC/EOC number 13.
Definition: adc/v1/adc.h:324
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:360
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:1375
ADC_disableInterrupt
static void ADC_disableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1553
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:1015
ADC_getInterruptOverflowStatus
static bool ADC_getInterruptOverflowStatus(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:768
ADC_PRI_THRU_SOC1_HIPRI
@ ADC_PRI_THRU_SOC1_HIPRI
SOC 0-1 hi pri, others in round robin.
Definition: adc/v1/adc.h:352
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:655
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:629
ADC_enablePPBEventInterrupt
static void ADC_enablePPBEventInterrupt(uint32_t base, ADC_PPBNumber ppbNumber, uint16_t intFlags)
Definition: adc/v1/adc.h:1110
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:363
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:1681
ADC_SOC_NUMBER12
@ ADC_SOC_NUMBER12
SOC/EOC number 12.
Definition: adc/v1/adc.h:323
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:414
ADC_SOC_NUMBER14
@ ADC_SOC_NUMBER14
SOC/EOC number 14.
Definition: adc/v1/adc.h:325
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:353
ADC_INT_NUMBER2
@ ADC_INT_NUMBER2
ADCINT2 Interrupt.
Definition: adc/v1/adc.h:281
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:264
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:250
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:251
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:1230
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:366
ADC_PRI_SOC0_HIPRI
@ ADC_PRI_SOC0_HIPRI
SOC 0 hi pri, others in round robin.
Definition: adc/v1/adc.h:351
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:317
ADC_enableInterrupt
static void ADC_enableInterrupt(uint32_t base, ADC_IntNumber adcIntNum)
Definition: adc/v1/adc.h:1513
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:315
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:387
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:978
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:940
ADC_isBusy
static bool ADC_isBusy(uint32_t base)
Definition: adc/v1/adc.h:847
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:1340
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:159
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:379
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:294
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:279
ADC_CH_CAL0_CAL1
@ ADC_CH_CAL0_CAL1
differential, CAL0 and CAL1
Definition: adc/v1/adc.h:252
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:313
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:1196
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:295
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:462
ADC_TRIGGER_EPWM4_SOCB
@ ADC_TRIGGER_EPWM4_SOCB
ePWM4, ADCSOCB
Definition: adc/v1/adc.h:175