AM263x MCU+ SDK  08.02.00

Introduction

This module contains APIs to program and use the ADC module.

Functions

static void ADC_setPrescaler (uint32_t base, ADC_ClkPrescale clkPrescale)
 
static void ADC_setupSOC (uint32_t base, ADC_SOCNumber socNumber, ADC_Trigger trigger, ADC_Channel channel, uint32_t sampleWindow)
 
static void ADC_setInterruptSOCTrigger (uint32_t base, ADC_SOCNumber socNumber, ADC_IntSOCTrigger trigger)
 
static void ADC_setInterruptPulseMode (uint32_t base, ADC_PulseMode pulseMode)
 
static void ADC_setInterruptCycleOffset (uint32_t base, uint16_t cycleOffset)
 
static void ADC_enableConverter (uint32_t base)
 
static void ADC_disableConverter (uint32_t base)
 
static void ADC_forceSOC (uint32_t base, ADC_SOCNumber socNumber)
 
static void ADC_forceMultipleSOC (uint32_t base, uint16_t socMask)
 
static bool ADC_getInterruptStatus (uint32_t base, ADC_IntNumber adcIntNum)
 
static void ADC_clearInterruptStatus (uint32_t base, ADC_IntNumber adcIntNum)
 
static bool ADC_getInterruptOverflowStatus (uint32_t base, ADC_IntNumber adcIntNum)
 
static void ADC_clearInterruptOverflowStatus (uint32_t base, ADC_IntNumber adcIntNum)
 
static uint16_t ADC_readResult (uint32_t resultBase, ADC_SOCNumber socNumber)
 
static bool ADC_isBusy (uint32_t base)
 
static void ADC_setBurstModeConfig (uint32_t base, ADC_Trigger trigger, uint16_t burstSize)
 
static void ADC_enableBurstMode (uint32_t base)
 
static void ADC_disableBurstMode (uint32_t base)
 
static void ADC_setSOCPriority (uint32_t base, ADC_PriorityMode priMode)
 
static void ADC_setupPPB (uint32_t base, ADC_PPBNumber ppbNumber, ADC_SOCNumber socNumber)
 
static void ADC_enablePPBEvent (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
 
static void ADC_disablePPBEvent (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
 
static void ADC_enablePPBEventInterrupt (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t intFlags)
 
static void ADC_disablePPBEventInterrupt (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t intFlags)
 
static uint16_t ADC_getPPBEventStatus (uint32_t base, ADC_PPBNumber ppbNumber)
 
static void ADC_clearPPBEventStatus (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags)
 
static int32_t ADC_readPPBResult (uint32_t resultBase, ADC_PPBNumber ppbNumber)
 
static uint16_t ADC_getPPBDelayTimeStamp (uint32_t base, ADC_PPBNumber ppbNumber)
 
static void ADC_setPPBCalibrationOffset (uint32_t base, ADC_PPBNumber ppbNumber, int16_t offset)
 
static void ADC_setPPBReferenceOffset (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t offset)
 
static void ADC_enablePPBTwosComplement (uint32_t base, ADC_PPBNumber ppbNumber)
 
static void ADC_disablePPBTwosComplement (uint32_t base, ADC_PPBNumber ppbNumber)
 
static void ADC_enablePPBEventCBCClear (uint32_t base, uint32_t ppbNumber)
 
static void ADC_disablePPBEventCBCClear (uint32_t base, uint32_t ppbNumber)
 
static void ADC_enableInterrupt (uint32_t base, ADC_IntNumber adcIntNum)
 
static void ADC_disableInterrupt (uint32_t base, ADC_IntNumber adcIntNum)
 
static void ADC_setInterruptSource (uint32_t base, ADC_IntNumber adcIntNum, ADC_SOCNumber socNumber)
 
static void ADC_enableContinuousMode (uint32_t base, ADC_IntNumber adcIntNum)
 
static void ADC_disableContinuousMode (uint32_t base, ADC_IntNumber adcIntNum)
 
void ADC_setMode (uint32_t base, ADC_Resolution resolution, ADC_SignalMode signalMode)
 
void ADC_setPPBTripLimits (uint32_t base, ADC_PPBNumber ppbNumber, int32_t tripHiLimit, int32_t tripLoLimit)
 

Enumerations

enum  ADC_ClkPrescale {
  ADC_CLK_DIV_1_0 = 0, ADC_CLK_DIV_2_0 = 2, ADC_CLK_DIV_2_5 = 3, ADC_CLK_DIV_3_0 = 4,
  ADC_CLK_DIV_3_5 = 5, ADC_CLK_DIV_4_0 = 6, ADC_CLK_DIV_4_5 = 7, ADC_CLK_DIV_5_0 = 8,
  ADC_CLK_DIV_5_5 = 9, ADC_CLK_DIV_6_0 = 10, ADC_CLK_DIV_6_5 = 11, ADC_CLK_DIV_7_0 = 12,
  ADC_CLK_DIV_7_5 = 13, ADC_CLK_DIV_8_0 = 14, ADC_CLK_DIV_8_5 = 15
}
 
enum  ADC_Resolution { ADC_RESOLUTION_12BIT = 0 }
 
enum  ADC_SignalMode { ADC_MODE_SINGLE_ENDED = 0, ADC_MODE_DIFFERENTIAL = 1 }
 
enum  ADC_Trigger {
  ADC_TRIGGER_SW_ONLY = 0x00, ADC_TRIGGER_RTI0 = 0x01, ADC_TRIGGER_RTI1 = 0x02, ADC_TRIGGER_RTI2 = 0x03,
  ADC_TRIGGER_RTI3 = 0x04, ADC_TRIGGER_INPUT_XBAR_OUT5 = 0x05, ADC_TRIGGER_EPWM0_SOCA = 0x08, ADC_TRIGGER_EPWM0_SOCB = 0x09,
  ADC_TRIGGER_EPWM1_SOCA = 0x0A, ADC_TRIGGER_EPWM1_SOCB = 0x0B, ADC_TRIGGER_EPWM2_SOCA = 0x0C, ADC_TRIGGER_EPWM2_SOCB = 0x0D,
  ADC_TRIGGER_EPWM3_SOCA = 0x0E, ADC_TRIGGER_EPWM3_SOCB = 0x0F, ADC_TRIGGER_EPWM4_SOCA = 0x10, ADC_TRIGGER_EPWM4_SOCB = 0x11,
  ADC_TRIGGER_EPWM5_SOCA = 0x12, ADC_TRIGGER_EPWM5_SOCB = 0x13, ADC_TRIGGER_EPWM6_SOCA = 0x14, ADC_TRIGGER_EPWM6_SOCB = 0x15,
  ADC_TRIGGER_EPWM7_SOCA = 0x16, ADC_TRIGGER_EPWM7_SOCB = 0x17, ADC_TRIGGER_EPWM8_SOCA = 0x18, ADC_TRIGGER_EPWM8_SOCB = 0x19,
  ADC_TRIGGER_EPWM9_SOCA = 0x1A, ADC_TRIGGER_EPWM9_SOCB = 0x1B, ADC_TRIGGER_EPWM10_SOCA = 0x1C, ADC_TRIGGER_EPWM10_SOCB = 0x1D,
  ADC_TRIGGER_EPWM11_SOCA = 0x1E, ADC_TRIGGER_EPWM11_SOCB = 0x1F, ADC_TRIGGER_EPWM12_SOCA = 0x20, ADC_TRIGGER_EPWM12_SOCB = 0x21,
  ADC_TRIGGER_EPWM13_SOCA = 0x22, ADC_TRIGGER_EPWM13_SOCB = 0x23, ADC_TRIGGER_EPWM14_SOCA = 0x24, ADC_TRIGGER_EPWM14_SOCB = 0x25,
  ADC_TRIGGER_EPWM15_SOCA = 0x26, ADC_TRIGGER_EPWM15_SOCB = 0x27, ADC_TRIGGER_EPWM16_SOCA = 0x28, ADC_TRIGGER_EPWM16_SOCB = 0x29,
  ADC_TRIGGER_EPWM17_SOCA = 0x2A, ADC_TRIGGER_EPWM17_SOCB = 0x2B, ADC_TRIGGER_EPWM18_SOCA = 0x2C, ADC_TRIGGER_EPWM18_SOCB = 0x2D,
  ADC_TRIGGER_EPWM19_SOCA = 0x2E, ADC_TRIGGER_EPWM19_SOCB = 0x2F, ADC_TRIGGER_EPWM20_SOCA = 0x30, ADC_TRIGGER_EPWM20_SOCB = 0x31,
  ADC_TRIGGER_EPWM21_SOCA = 0x32, ADC_TRIGGER_EPWM21_SOCB = 0x33, ADC_TRIGGER_EPWM22_SOCA = 0x34, ADC_TRIGGER_EPWM22_SOCB = 0x35,
  ADC_TRIGGER_EPWM23_SOCA = 0x36, ADC_TRIGGER_EPWM23_SOCB = 0x37, ADC_TRIGGER_EPWM24_SOCA = 0x38, ADC_TRIGGER_EPWM24_SOCB = 0x39,
  ADC_TRIGGER_EPWM25_SOCA = 0x3A, ADC_TRIGGER_EPWM25_SOCB = 0x3B, ADC_TRIGGER_EPWM26_SOCA = 0x3C, ADC_TRIGGER_EPWM26_SOCB = 0x3D,
  ADC_TRIGGER_EPWM27_SOCA = 0x3E, ADC_TRIGGER_EPWM27_SOCB = 0x3F, ADC_TRIGGER_EPWM28_SOCA = 0x40, ADC_TRIGGER_EPWM28_SOCB = 0x41,
  ADC_TRIGGER_EPWM29_SOCA = 0x42, ADC_TRIGGER_EPWM29_SOCB = 0x43, ADC_TRIGGER_EPWM30_SOCA = 0x44, ADC_TRIGGER_EPWM30_SOCB = 0x45,
  ADC_TRIGGER_EPWM31_SOCA = 0x46, ADC_TRIGGER_EPWM31_SOCB = 0x47
}
 
enum  ADC_Channel {
  ADC_CH_ADCIN0 = 0, ADC_CH_ADCIN1 = 1, ADC_CH_ADCIN2 = 2, ADC_CH_ADCIN3 = 3,
  ADC_CH_ADCIN4 = 4, ADC_CH_ADCIN5 = 5, ADC_CH_CAL0 = 6, ADC_CH_CAL1 = 7,
  ADC_CH_ADCIN0_ADCIN1 = 0, ADC_CH_ADCIN2_ADCIN3 = 2, ADC_CH_ADCIN4_ADCIN5 = 4, ADC_CH_CAL0_CAL1 = 6
}
 
enum  ADC_PulseMode { ADC_PULSE_END_OF_ACQ_WIN = 0, ADC_PULSE_END_OF_CONV = 1 }
 
enum  ADC_IntNumber { ADC_INT_NUMBER1 = 0, ADC_INT_NUMBER2 = 1, ADC_INT_NUMBER3 = 2, ADC_INT_NUMBER4 = 3 }
 
enum  ADC_PPBNumber { ADC_PPB_NUMBER1 = 0, ADC_PPB_NUMBER2 = 1, ADC_PPB_NUMBER3 = 2, ADC_PPB_NUMBER4 = 3 }
 
enum  ADC_SOCNumber {
  ADC_SOC_NUMBER0 = 0, ADC_SOC_NUMBER1 = 1, ADC_SOC_NUMBER2 = 2, ADC_SOC_NUMBER3 = 3,
  ADC_SOC_NUMBER4 = 4, ADC_SOC_NUMBER5 = 5, ADC_SOC_NUMBER6 = 6, ADC_SOC_NUMBER7 = 7,
  ADC_SOC_NUMBER8 = 8, ADC_SOC_NUMBER9 = 9, ADC_SOC_NUMBER10 = 10, ADC_SOC_NUMBER11 = 11,
  ADC_SOC_NUMBER12 = 12, ADC_SOC_NUMBER13 = 13, ADC_SOC_NUMBER14 = 14, ADC_SOC_NUMBER15 = 15
}
 
enum  ADC_IntSOCTrigger { ADC_INT_SOC_TRIGGER_NONE = 0, ADC_INT_SOC_TRIGGER_ADCINT1 = 1, ADC_INT_SOC_TRIGGER_ADCINT2 = 2 }
 
enum  ADC_PriorityMode {
  ADC_PRI_ALL_ROUND_ROBIN = 0, ADC_PRI_SOC0_HIPRI = 1, ADC_PRI_THRU_SOC1_HIPRI = 2, ADC_PRI_THRU_SOC2_HIPRI = 3,
  ADC_PRI_THRU_SOC3_HIPRI = 4, ADC_PRI_THRU_SOC4_HIPRI = 5, ADC_PRI_THRU_SOC5_HIPRI = 6, ADC_PRI_THRU_SOC6_HIPRI = 7,
  ADC_PRI_THRU_SOC7_HIPRI = 8, ADC_PRI_THRU_SOC8_HIPRI = 9, ADC_PRI_THRU_SOC9_HIPRI = 10, ADC_PRI_THRU_SOC10_HIPRI = 11,
  ADC_PRI_THRU_SOC11_HIPRI = 12, ADC_PRI_THRU_SOC12_HIPRI = 13, ADC_PRI_THRU_SOC13_HIPRI = 14, ADC_PRI_THRU_SOC14_HIPRI = 15,
  ADC_PRI_ALL_HIPRI = 16
}
 

Macros

#define ADC_EVT_TRIPHI   (0x0001U)
 Header Files. More...
 
#define ADC_EVT_TRIPLO   (0x0002U)
 Trip Low Event. More...
 
#define ADC_EVT_ZERO   (0x0004U)
 Zero Crossing Event. More...
 
#define ADC_FORCE_SOC0   (0x0001U)
 SW trigger ADC SOC 0. More...
 
#define ADC_FORCE_SOC1   (0x0002U)
 SW trigger ADC SOC 1. More...
 
#define ADC_FORCE_SOC2   (0x0004U)
 SW trigger ADC SOC 2. More...
 
#define ADC_FORCE_SOC3   (0x0008U)
 SW trigger ADC SOC 3. More...
 
#define ADC_FORCE_SOC4   (0x0010U)
 SW trigger ADC SOC 4. More...
 
#define ADC_FORCE_SOC5   (0x0020U)
 SW trigger ADC SOC 5. More...
 
#define ADC_FORCE_SOC6   (0x0040U)
 SW trigger ADC SOC 6. More...
 
#define ADC_FORCE_SOC7   (0x0080U)
 SW trigger ADC SOC 7. More...
 
#define ADC_FORCE_SOC8   (0x0100U)
 SW trigger ADC SOC 8. More...
 
#define ADC_FORCE_SOC9   (0x0200U)
 SW trigger ADC SOC 9. More...
 
#define ADC_FORCE_SOC10   (0x0400U)
 SW trigger ADC SOC 10. More...
 
#define ADC_FORCE_SOC11   (0x0800U)
 SW trigger ADC SOC 11. More...
 
#define ADC_FORCE_SOC12   (0x1000U)
 SW trigger ADC SOC 12. More...
 
#define ADC_FORCE_SOC13   (0x2000U)
 SW trigger ADC SOC 13. More...
 
#define ADC_FORCE_SOC14   (0x4000U)
 SW trigger ADC SOC 14. More...
 
#define ADC_FORCE_SOC15   (0x8000U)
 SW trigger ADC SOC 15. More...
 
#define ADC_ADCSOCxCTL_STEP   (CSL_ADC_ADCSOC1CTL - CSL_ADC_ADCSOC0CTL)
 Defines used by the driver. More...
 
#define ADC_ADCINTSELxNy_STEP   (CSL_ADC_ADCINTSEL3N4 - CSL_ADC_ADCINTSEL1N2)
 Register offset difference between 2 ADCINTSELxNy registers. More...
 
#define ADC_ADCPPBx_STEP   (CSL_ADC_ADCPPB2CONFIG - CSL_ADC_ADCPPB1CONFIG)
 Register offset difference between 2 ADCPPBxCONFIG registers. More...
 
#define ADC_ADCPPBTRIP_MASK
 ADC PPB Trip Mask. More...
 
#define ADC_RESULT_ADCPPBxRESULT_STEP
 Register offset difference between 2 ADCPPBxRESULT registers. More...
 
#define ADC_RESULT_ADCRESULTx_STEP
 Register offset difference between 2 ADCRESULTx registers. More...
 

Macro Definition Documentation

◆ ADC_EVT_TRIPHI

#define ADC_EVT_TRIPHI   (0x0001U)

Header Files.

Trip High Event

◆ ADC_EVT_TRIPLO

#define ADC_EVT_TRIPLO   (0x0002U)

Trip Low Event.

◆ ADC_EVT_ZERO

#define ADC_EVT_ZERO   (0x0004U)

Zero Crossing Event.

◆ ADC_FORCE_SOC0

#define ADC_FORCE_SOC0   (0x0001U)

SW trigger ADC SOC 0.

◆ ADC_FORCE_SOC1

#define ADC_FORCE_SOC1   (0x0002U)

SW trigger ADC SOC 1.

◆ ADC_FORCE_SOC2

#define ADC_FORCE_SOC2   (0x0004U)

SW trigger ADC SOC 2.

◆ ADC_FORCE_SOC3

#define ADC_FORCE_SOC3   (0x0008U)

SW trigger ADC SOC 3.

◆ ADC_FORCE_SOC4

#define ADC_FORCE_SOC4   (0x0010U)

SW trigger ADC SOC 4.

◆ ADC_FORCE_SOC5

#define ADC_FORCE_SOC5   (0x0020U)

SW trigger ADC SOC 5.

◆ ADC_FORCE_SOC6

#define ADC_FORCE_SOC6   (0x0040U)

SW trigger ADC SOC 6.

◆ ADC_FORCE_SOC7

#define ADC_FORCE_SOC7   (0x0080U)

SW trigger ADC SOC 7.

◆ ADC_FORCE_SOC8

#define ADC_FORCE_SOC8   (0x0100U)

SW trigger ADC SOC 8.

◆ ADC_FORCE_SOC9

#define ADC_FORCE_SOC9   (0x0200U)

SW trigger ADC SOC 9.

◆ ADC_FORCE_SOC10

#define ADC_FORCE_SOC10   (0x0400U)

SW trigger ADC SOC 10.

◆ ADC_FORCE_SOC11

#define ADC_FORCE_SOC11   (0x0800U)

SW trigger ADC SOC 11.

◆ ADC_FORCE_SOC12

#define ADC_FORCE_SOC12   (0x1000U)

SW trigger ADC SOC 12.

◆ ADC_FORCE_SOC13

#define ADC_FORCE_SOC13   (0x2000U)

SW trigger ADC SOC 13.

◆ ADC_FORCE_SOC14

#define ADC_FORCE_SOC14   (0x4000U)

SW trigger ADC SOC 14.

◆ ADC_FORCE_SOC15

#define ADC_FORCE_SOC15   (0x8000U)

SW trigger ADC SOC 15.

◆ ADC_ADCSOCxCTL_STEP

#define ADC_ADCSOCxCTL_STEP   (CSL_ADC_ADCSOC1CTL - CSL_ADC_ADCSOC0CTL)

Defines used by the driver.

Register offset difference between 2 ADCSOCxCTL registers

◆ ADC_ADCINTSELxNy_STEP

#define ADC_ADCINTSELxNy_STEP   (CSL_ADC_ADCINTSEL3N4 - CSL_ADC_ADCINTSEL1N2)

Register offset difference between 2 ADCINTSELxNy registers.

◆ ADC_ADCPPBx_STEP

#define ADC_ADCPPBx_STEP   (CSL_ADC_ADCPPB2CONFIG - CSL_ADC_ADCPPB1CONFIG)

Register offset difference between 2 ADCPPBxCONFIG registers.

◆ ADC_ADCPPBTRIP_MASK

#define ADC_ADCPPBTRIP_MASK
Value:
((uint32_t)CSL_ADC_ADCPPB1TRIPHI_LIMITHI_MASK \
| (uint32_t)CSL_ADC_ADCPPB1TRIPHI_HSIGN_MASK)

ADC PPB Trip Mask.

◆ ADC_RESULT_ADCPPBxRESULT_STEP

#define ADC_RESULT_ADCPPBxRESULT_STEP
Value:
(CSL_ADC_RESULT_ADCPPB2RESULT -\
CSL_ADC_RESULT_ADCPPB1RESULT)

Register offset difference between 2 ADCPPBxRESULT registers.

◆ ADC_RESULT_ADCRESULTx_STEP

#define ADC_RESULT_ADCRESULTx_STEP
Value:
(CSL_ADC_RESULT_ADCRESULT1 - \
CSL_ADC_RESULT_ADCRESULT0)

Register offset difference between 2 ADCRESULTx registers.

Enumeration Type Documentation

◆ ADC_ClkPrescale

Values that can be passed to ADC_setPrescaler() as the clkPrescale parameter.

Enumerator
ADC_CLK_DIV_1_0 

ADCCLK = (input clock) / 1.0.

ADC_CLK_DIV_2_0 

ADCCLK = (input clock) / 2.0.

ADC_CLK_DIV_2_5 

ADCCLK = (input clock) / 2.5.

ADC_CLK_DIV_3_0 

ADCCLK = (input clock) / 3.0.

ADC_CLK_DIV_3_5 

ADCCLK = (input clock) / 3.5.

ADC_CLK_DIV_4_0 

ADCCLK = (input clock) / 4.0.

ADC_CLK_DIV_4_5 

ADCCLK = (input clock) / 4.5.

ADC_CLK_DIV_5_0 

ADCCLK = (input clock) / 5.0.

ADC_CLK_DIV_5_5 

ADCCLK = (input clock) / 5.5.

ADC_CLK_DIV_6_0 

ADCCLK = (input clock) / 6.0.

ADC_CLK_DIV_6_5 

ADCCLK = (input clock) / 6.5.

ADC_CLK_DIV_7_0 

ADCCLK = (input clock) / 7.0.

ADC_CLK_DIV_7_5 

ADCCLK = (input clock) / 7.5.

ADC_CLK_DIV_8_0 

ADCCLK = (input clock) / 8.0.

ADC_CLK_DIV_8_5 

ADCCLK = (input clock) / 8.5.

◆ ADC_Resolution

Values that can be passed to ADC_setMode() as the resolution parameter.

Enumerator
ADC_RESOLUTION_12BIT 

12-bit conversion resolution

◆ ADC_SignalMode

Values that can be passed to ADC_setMode() as the signalMode parameter.

Enumerator
ADC_MODE_SINGLE_ENDED 

Sample on single pin with VREFLO.

ADC_MODE_DIFFERENTIAL 

Sample on pair of pins.

◆ ADC_Trigger

Values that can be passed to ADC_setupSOC() as the trigger parameter to specify the event that will trigger a conversion to start. It is also used with ADC_setBurstModeConfig().

Enumerator
ADC_TRIGGER_SW_ONLY 

Software only.

ADC_TRIGGER_RTI0 

RTI Timer 0.

ADC_TRIGGER_RTI1 

RTI Timer 1.

ADC_TRIGGER_RTI2 

RTI Timer 2.

ADC_TRIGGER_RTI3 

RTI Timer 3.

ADC_TRIGGER_INPUT_XBAR_OUT5 

InputXBar.Out[5].

ADC_TRIGGER_EPWM0_SOCA 

ePWM0, ADCSOCA

ADC_TRIGGER_EPWM0_SOCB 

ePWM0, ADCSOCB

ADC_TRIGGER_EPWM1_SOCA 

ePWM1, ADCSOCA

ADC_TRIGGER_EPWM1_SOCB 

ePWM1, ADCSOCB

ADC_TRIGGER_EPWM2_SOCA 

ePWM2, ADCSOCA

ADC_TRIGGER_EPWM2_SOCB 

ePWM2, ADCSOCB

ADC_TRIGGER_EPWM3_SOCA 

ePWM3, ADCSOCA

ADC_TRIGGER_EPWM3_SOCB 

ePWM3, ADCSOCB

ADC_TRIGGER_EPWM4_SOCA 

ePWM4, ADCSOCA

ADC_TRIGGER_EPWM4_SOCB 

ePWM4, ADCSOCB

ADC_TRIGGER_EPWM5_SOCA 

ePWM5, ADCSOCA

ADC_TRIGGER_EPWM5_SOCB 

ePWM5, ADCSOCB

ADC_TRIGGER_EPWM6_SOCA 

ePWM6, ADCSOCA

ADC_TRIGGER_EPWM6_SOCB 

ePWM6, ADCSOCB

ADC_TRIGGER_EPWM7_SOCA 

ePWM7, ADCSOCA

ADC_TRIGGER_EPWM7_SOCB 

ePWM7, ADCSOCB

ADC_TRIGGER_EPWM8_SOCA 

ePWM8, ADCSOCA

ADC_TRIGGER_EPWM8_SOCB 

ePWM8, ADCSOCB

ADC_TRIGGER_EPWM9_SOCA 

ePWM9, ADCSOCA

ADC_TRIGGER_EPWM9_SOCB 

ePWM9, ADCSOCB

ADC_TRIGGER_EPWM10_SOCA 

ePWM10, ADCSOCA

ADC_TRIGGER_EPWM10_SOCB 

ePWM10, ADCSOCB

ADC_TRIGGER_EPWM11_SOCA 

ePWM11, ADCSOCA

ADC_TRIGGER_EPWM11_SOCB 

ePWM11, ADCSOCB

ADC_TRIGGER_EPWM12_SOCA 

ePWM12, ADCSOCA

ADC_TRIGGER_EPWM12_SOCB 

ePWM12, ADCSOCB

ADC_TRIGGER_EPWM13_SOCA 

ePWM13, ADCSOCA

ADC_TRIGGER_EPWM13_SOCB 

ePWM13, ADCSOCB

ADC_TRIGGER_EPWM14_SOCA 

ePWM14, ADCSOCA

ADC_TRIGGER_EPWM14_SOCB 

ePWM14, ADCSOCB

ADC_TRIGGER_EPWM15_SOCA 

ePWM15, ADCSOCA

ADC_TRIGGER_EPWM15_SOCB 

ePWM15, ADCSOCB

ADC_TRIGGER_EPWM16_SOCA 

ePWM16, ADCSOCA

ADC_TRIGGER_EPWM16_SOCB 

ePWM16, ADCSOCB

ADC_TRIGGER_EPWM17_SOCA 

ePWM17, ADCSOCA

ADC_TRIGGER_EPWM17_SOCB 

ePWM17, ADCSOCB

ADC_TRIGGER_EPWM18_SOCA 

ePWM18, ADCSOCA

ADC_TRIGGER_EPWM18_SOCB 

ePWM18, ADCSOCB

ADC_TRIGGER_EPWM19_SOCA 

ePWM19, ADCSOCA

ADC_TRIGGER_EPWM19_SOCB 

ePWM19, ADCSOCB

ADC_TRIGGER_EPWM20_SOCA 

ePWM20, ADCSOCA

ADC_TRIGGER_EPWM20_SOCB 

ePWM20, ADCSOCB

ADC_TRIGGER_EPWM21_SOCA 

ePWM21, ADCSOCA

ADC_TRIGGER_EPWM21_SOCB 

ePWM21, ADCSOCB

ADC_TRIGGER_EPWM22_SOCA 

ePWM22, ADCSOCA

ADC_TRIGGER_EPWM22_SOCB 

ePWM22, ADCSOCB

ADC_TRIGGER_EPWM23_SOCA 

ePWM23, ADCSOCA

ADC_TRIGGER_EPWM23_SOCB 

ePWM23, ADCSOCB

ADC_TRIGGER_EPWM24_SOCA 

ePWM24, ADCSOCA

ADC_TRIGGER_EPWM24_SOCB 

ePWM24, ADCSOCB

ADC_TRIGGER_EPWM25_SOCA 

ePWM25, ADCSOCA

ADC_TRIGGER_EPWM25_SOCB 

ePWM25, ADCSOCB

ADC_TRIGGER_EPWM26_SOCA 

ePWM26, ADCSOCA

ADC_TRIGGER_EPWM26_SOCB 

ePWM26, ADCSOCB

ADC_TRIGGER_EPWM27_SOCA 

ePWM27, ADCSOCA

ADC_TRIGGER_EPWM27_SOCB 

ePWM27, ADCSOCB

ADC_TRIGGER_EPWM28_SOCA 

ePWM28, ADCSOCA

ADC_TRIGGER_EPWM28_SOCB 

ePWM28, ADCSOCB

ADC_TRIGGER_EPWM29_SOCA 

ePWM29, ADCSOCA

ADC_TRIGGER_EPWM29_SOCB 

ePWM29, ADCSOCB

ADC_TRIGGER_EPWM30_SOCA 

ePWM30, ADCSOCA

ADC_TRIGGER_EPWM30_SOCB 

ePWM30, ADCSOCB

ADC_TRIGGER_EPWM31_SOCA 

ePWM31, ADCSOCA

ADC_TRIGGER_EPWM31_SOCB 

ePWM31, ADCSOCB

◆ ADC_Channel

Values that can be passed to ADC_setupSOC() as the channel parameter. This is the input pin on which the signal to be converted is located.

Enumerator
ADC_CH_ADCIN0 

single-ended, ADCIN0

ADC_CH_ADCIN1 

single-ended, ADCIN1

ADC_CH_ADCIN2 

single-ended, ADCIN2

ADC_CH_ADCIN3 

single-ended, ADCIN3

ADC_CH_ADCIN4 

single-ended, ADCIN4

ADC_CH_ADCIN5 

single-ended, ADCIN5

ADC_CH_CAL0 

single-ended, CAL0

ADC_CH_CAL1 

single-ended, CAL1

ADC_CH_ADCIN0_ADCIN1 

differential, ADCIN0 and ADCIN1

ADC_CH_ADCIN2_ADCIN3 

differential, ADCIN2 and ADCIN3

ADC_CH_ADCIN4_ADCIN5 

differential, ADCIN4 and ADCIN5

ADC_CH_CAL0_CAL1 

differential, CAL0 and CAL1

◆ ADC_PulseMode

Values that can be passed to ADC_setInterruptPulseMode() as the pulseMode parameter.

Enumerator
ADC_PULSE_END_OF_ACQ_WIN 

Occurs at the end of the acquisition window.

ADC_PULSE_END_OF_CONV 

Occurs at the end of the conversion.

◆ ADC_IntNumber

Values that can be passed to ADC_enableInterrupt(), ADC_disableInterrupt(), ADC_clearInterruptStatus(), ADC_getInterruptOverflowStatus(), ADC_clearInterruptOverflowStatus(), ADC_setInterruptSource(), ADC_enableContinuousMode(), ADC_disableContinuousMode() and ADC_getInterruptStatus() as the adcIntNum parameter.

Enumerator
ADC_INT_NUMBER1 

ADCINT1 Interrupt.

ADC_INT_NUMBER2 

ADCINT2 Interrupt.

ADC_INT_NUMBER3 

ADCINT3 Interrupt.

ADC_INT_NUMBER4 

ADCINT4 Interrupt.

◆ ADC_PPBNumber

Values that can be passed in as the ppbNumber parameter for several functions.

Enumerator
ADC_PPB_NUMBER1 

Post-processing block 1.

ADC_PPB_NUMBER2 

Post-processing block 2.

ADC_PPB_NUMBER3 

Post-processing block 3.

ADC_PPB_NUMBER4 

Post-processing block 4.

◆ ADC_SOCNumber

Values that can be passed in as the socNumber parameter for several functions. This value identifies the start-of-conversion (SOC) that a function is configuring or accessing. Note that in some cases (for example, ADC_setInterruptSource()) socNumber is used to refer to the corresponding end-of-conversion (EOC).

Enumerator
ADC_SOC_NUMBER0 

SOC/EOC number 0.

ADC_SOC_NUMBER1 

SOC/EOC number 1.

ADC_SOC_NUMBER2 

SOC/EOC number 2.

ADC_SOC_NUMBER3 

SOC/EOC number 3.

ADC_SOC_NUMBER4 

SOC/EOC number 4.

ADC_SOC_NUMBER5 

SOC/EOC number 5.

ADC_SOC_NUMBER6 

SOC/EOC number 6.

ADC_SOC_NUMBER7 

SOC/EOC number 7.

ADC_SOC_NUMBER8 

SOC/EOC number 8.

ADC_SOC_NUMBER9 

SOC/EOC number 9.

ADC_SOC_NUMBER10 

SOC/EOC number 10.

ADC_SOC_NUMBER11 

SOC/EOC number 11.

ADC_SOC_NUMBER12 

SOC/EOC number 12.

ADC_SOC_NUMBER13 

SOC/EOC number 13.

ADC_SOC_NUMBER14 

SOC/EOC number 14.

ADC_SOC_NUMBER15 

SOC/EOC number 15.

◆ ADC_IntSOCTrigger

Values that can be passed in as the trigger parameter for the ADC_setInterruptSOCTrigger() function.

Enumerator
ADC_INT_SOC_TRIGGER_NONE 

No ADCINT will trigger the SOC.

ADC_INT_SOC_TRIGGER_ADCINT1 

ADCINT1 will trigger the SOC.

ADC_INT_SOC_TRIGGER_ADCINT2 

ADCINT2 will trigger the SOC.

◆ ADC_PriorityMode

Values that can be passed to ADC_setSOCPriority() as the priMode parameter.

Enumerator
ADC_PRI_ALL_ROUND_ROBIN 

Round robin mode is used for all.

ADC_PRI_SOC0_HIPRI 

SOC 0 hi pri, others in round robin.

ADC_PRI_THRU_SOC1_HIPRI 

SOC 0-1 hi pri, others in round robin.

ADC_PRI_THRU_SOC2_HIPRI 

SOC 0-2 hi pri, others in round robin.

ADC_PRI_THRU_SOC3_HIPRI 

SOC 0-3 hi pri, others in round robin.

ADC_PRI_THRU_SOC4_HIPRI 

SOC 0-4 hi pri, others in round robin.

ADC_PRI_THRU_SOC5_HIPRI 

SOC 0-5 hi pri, others in round robin.

ADC_PRI_THRU_SOC6_HIPRI 

SOC 0-6 hi pri, others in round robin.

ADC_PRI_THRU_SOC7_HIPRI 

SOC 0-7 hi pri, others in round robin.

ADC_PRI_THRU_SOC8_HIPRI 

SOC 0-8 hi pri, others in round robin.

ADC_PRI_THRU_SOC9_HIPRI 

SOC 0-9 hi pri, others in round robin.

ADC_PRI_THRU_SOC10_HIPRI 

SOC 0-10 hi pri, others in round robin.

ADC_PRI_THRU_SOC11_HIPRI 

SOC 0-11 hi pri, others in round robin.

ADC_PRI_THRU_SOC12_HIPRI 

SOC 0-12 hi pri, others in round robin.

ADC_PRI_THRU_SOC13_HIPRI 

SOC 0-13 hi pri, others in round robin.

ADC_PRI_THRU_SOC14_HIPRI 

SOC 0-14 hi pri, SOC15 in round robin.

ADC_PRI_ALL_HIPRI 

All priorities based on SOC number.

Function Documentation

◆ ADC_setPrescaler()

static void ADC_setPrescaler ( uint32_t  base,
ADC_ClkPrescale  clkPrescale 
)
inlinestatic

Configures the analog-to-digital converter module prescaler.

Parameters
baseis the base address of the ADC module.
clkPrescaleis the ADC clock prescaler.

This function configures the ADC module's ADCCLK.

The clkPrescale parameter specifies the value by which the input clock is divided to make the ADCCLK. The clkPrescale value can be specified with any of the following variables: ADC_CLK_DIV_1_0, ADC_CLK_DIV_2_0, ADC_CLK_DIV_2_5, ..., ADC_CLK_DIV_7_5, ADC_CLK_DIV_8_0, or ADC_CLK_DIV_8_5.

Returns
None.

◆ ADC_setupSOC()

static void ADC_setupSOC ( uint32_t  base,
ADC_SOCNumber  socNumber,
ADC_Trigger  trigger,
ADC_Channel  channel,
uint32_t  sampleWindow 
)
inlinestatic

Configures a start-of-conversion (SOC) in the ADC.

Parameters
baseis the base address of the ADC module.
socNumberis the number of the start-of-conversion.
triggerthe source that will cause the SOC.
channelis the number associated with the input signal.
sampleWindowis the acquisition window duration.

This function configures the a start-of-conversion (SOC) in the ADC module.

The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which SOC is to be configured on the ADC module specified by base.

The trigger specifies the event that causes the SOC such as software, a timer interrupt, an ePWM event, or an ADC interrupt. It should be a value in the format of ADC_TRIGGER_XXXX where XXXX is the event such as ADC_TRIGGER_SW_ONLY, ADC_TRIGGER_EPWM1_SOCA, and so on.

The channel parameter specifies the channel to be converted. In single-ended mode this is a single pin given by ADC_CH_ADCINx where x is the number identifying the pin between 0 and 5 inclusive. In differential mode, two pins are used as inputs and are passed in the channel parameter as ADC_CH_ADCIN0_ADCIN1, ADC_CH_ADCIN2_ADCIN3, ..., or ADC_CH_ADCIN14_ADCIN5.

The sampleWindow parameter is the acquisition window duration in SYSCLK cycles. It should be a value between 1 and 512 cycles inclusive. The selected duration must be at least as long as one ADCCLK cycle. Also, the datasheet will specify a minimum window duration requirement in nanoseconds.

Returns
None.

◆ ADC_setInterruptSOCTrigger()

static void ADC_setInterruptSOCTrigger ( uint32_t  base,
ADC_SOCNumber  socNumber,
ADC_IntSOCTrigger  trigger 
)
inlinestatic

Configures the interrupt SOC trigger of an SOC.

Parameters
baseis the base address of the ADC module.
socNumberis the number of the start-of-conversion.
triggerthe interrupt source that will cause the SOC.

This function configures the interrupt start-of-conversion trigger in the ADC module.

The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which SOC is to be configured on the ADC module specified by base.

The trigger specifies the interrupt that causes a start of conversion or none. It should be one of the following values.

  • ADC_INT_SOC_TRIGGER_NONE
  • ADC_INT_SOC_TRIGGER_ADCINT1
  • ADC_INT_SOC_TRIGGER_ADCINT2

This functionality is useful for creating continuous conversions.

Returns
None.

◆ ADC_setInterruptPulseMode()

static void ADC_setInterruptPulseMode ( uint32_t  base,
ADC_PulseMode  pulseMode 
)
inlinestatic

Sets the timing of the end-of-conversion pulse

Parameters
baseis the base address of the ADC module.
pulseModeis the generation mode of the EOC pulse.

This function configures the end-of-conversion (EOC) pulse generated by ADC. This pulse will be generated either at the end of the acquisition window plus a number of SYSCLK cycles configured by ADC_setInterruptCycleOffset() (pass ADC_PULSE_END_OF_ACQ_WIN into pulseMode) or at the end of the voltage conversion, one cycle prior to the ADC result latching into it's result register (pass ADC_PULSE_END_OF_CONV into pulseMode).

Returns
None.

◆ ADC_setInterruptCycleOffset()

static void ADC_setInterruptCycleOffset ( uint32_t  base,
uint16_t  cycleOffset 
)
inlinestatic

Sets the timing of early interrupt generation.

Parameters
baseis the base address of the ADC module.
cycleOffsetis the cycles from an SOC falling edge to an early interrupt pulse.

This function configures cycle offset between the negative edge of a sample pulse and an early interrupt pulse being generated. This number of cycles is specified with the cycleOffset parameter.

This function only applies when early interrupt generation is enabled. That means the ADC_setInterruptPulseMode() function pulseMode parameter is configured as ADC_PULSE_END_OF_ACQ_WIN.

Returns
None.

◆ ADC_enableConverter()

static void ADC_enableConverter ( uint32_t  base)
inlinestatic

Powers up the analog-to-digital converter core.

Parameters
baseis the base address of the ADC module.

This function powers up the analog circuitry inside the analog core.

Note
Allow at least a 500us delay before sampling after calling this API. If you enable multiple ADCs, you can delay after they all have begun powering up.
Returns
None.

◆ ADC_disableConverter()

static void ADC_disableConverter ( uint32_t  base)
inlinestatic

Powers down the analog-to-digital converter module.

Parameters
baseis the base address of the ADC module.

This function powers down the analog circuitry inside the analog core.

Returns
None.

◆ ADC_forceSOC()

static void ADC_forceSOC ( uint32_t  base,
ADC_SOCNumber  socNumber 
)
inlinestatic

Forces a SOC flag to a 1 in the analog-to-digital converter.

Parameters
baseis the base address of the ADC module.
socNumberis the number of the start-of-conversion.

This function forces the SOC flag associated with the SOC specified by socNumber. This initiates a conversion once that SOC is given priority. This software trigger can be used whether or not the SOC has been configured to accept some other specific trigger.

Returns
None.

◆ ADC_forceMultipleSOC()

static void ADC_forceMultipleSOC ( uint32_t  base,
uint16_t  socMask 
)
inlinestatic

Forces multiple SOC flags to 1 in the analog-to-digital converter.

Parameters
baseis the base address of the ADC module.
socMaskis the SOCs to be forced through software

This function forces the SOCFRC1 flags associated with the SOCs specified by socMask. This initiates a conversion once the desired SOCs are given priority. This software trigger can be used whether or not the SOC has been configured to accept some other specific trigger. Valid values for socMask parameter can be any of the individual ADC_FORCE_SOCx values or any of their OR'd combination to trigger multiple SOCs.

Note
To trigger SOC0, SOC1 and SOC2, value (ADC_FORCE_SOC0 | ADC_FORCE_SOC1 | ADC_FORCE_SOC2) should be passed as socMask.
Returns
None.

◆ ADC_getInterruptStatus()

static bool ADC_getInterruptStatus ( uint32_t  base,
ADC_IntNumber  adcIntNum 
)
inlinestatic

Gets the current ADC interrupt status.

Parameters
baseis the base address of the ADC module.
adcIntNumis interrupt number within the ADC wrapper.

This function returns the interrupt status for the analog-to-digital converter.

adcIntNum takes a one of the values ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be cleared.

Returns
true if the interrupt flag for the specified interrupt number is set and false if it is not.

◆ ADC_clearInterruptStatus()

static void ADC_clearInterruptStatus ( uint32_t  base,
ADC_IntNumber  adcIntNum 
)
inlinestatic

Clears ADC interrupt sources.

Parameters
baseis the base address of the ADC module.
adcIntNumis interrupt number within the ADC wrapper.

This function clears the specified ADC interrupt sources so that they no longer assert. If not in continuous mode, this function must be called before any further interrupt pulses may occur.

adcIntNum takes a one of the values ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be cleared.

Returns
None.

◆ ADC_getInterruptOverflowStatus()

static bool ADC_getInterruptOverflowStatus ( uint32_t  base,
ADC_IntNumber  adcIntNum 
)
inlinestatic

Gets the current ADC interrupt overflow status.

Parameters
baseis the base address of the ADC module.
adcIntNumis interrupt number within the ADC wrapper.

This function returns the interrupt overflow status for the analog-to-digital converter. An overflow condition is generated irrespective of the continuous mode.

adcIntNum takes a one of the values ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be cleared.

Returns
true if the interrupt overflow flag for the specified interrupt number is set and false if it is not.

◆ ADC_clearInterruptOverflowStatus()

static void ADC_clearInterruptOverflowStatus ( uint32_t  base,
ADC_IntNumber  adcIntNum 
)
inlinestatic

Clears ADC interrupt overflow sources.

Parameters
baseis the base address of the ADC module.
adcIntNumis interrupt number within the ADC wrapper.

This function clears the specified ADC interrupt overflow sources so that they no longer assert. If software tries to clear the overflow in the same cycle that hardware tries to set the overflow, then hardware has priority.

adcIntNum takes a one of the values ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be cleared.

Returns
None.

◆ ADC_readResult()

static uint16_t ADC_readResult ( uint32_t  resultBase,
ADC_SOCNumber  socNumber 
)
inlinestatic

Reads the conversion result.

Parameters
resultBaseis the base address of the ADC results.
socNumberis the number of the start-of-conversion.

This function returns the conversion result that corresponds to the base address passed into resultBase and the SOC passed into socNumber.

The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which SOC's result is to be read.

Note
Take care that you are using a base address for the result registers (ADCxRESULT_BASE) and not a base address for the control registers.
Returns
Returns the conversion result.

◆ ADC_isBusy()

static bool ADC_isBusy ( uint32_t  base)
inlinestatic

Determines whether the ADC is busy or not.

Parameters
baseis the base address of the ADC.

This function allows the caller to determine whether or not the ADC is busy and can sample another channel.

Returns
Returns true if the ADC is sampling or false if all samples are complete.

◆ ADC_setBurstModeConfig()

static void ADC_setBurstModeConfig ( uint32_t  base,
ADC_Trigger  trigger,
uint16_t  burstSize 
)
inlinestatic

Set SOC burst mode.

Parameters
baseis the base address of the ADC.
triggerthe source that will cause the burst conversion sequence.
burstSizeis the number of SOCs converted during a burst sequence.

This function configures the burst trigger and burstSize of an ADC module. Burst mode allows a single trigger to walk through the round-robin SOCs one or more at a time. When burst mode is enabled, the trigger selected by the ADC_setupSOC() API will no longer have an effect on the SOCs in round-robin mode. Instead, the source specified through the trigger parameter will cause a burst of burstSize conversions to occur.

The trigger parameter takes the same values as the ADC_setupSOC() API The burstSize parameter should be a value between 1 and 16 inclusive.

Returns
None.

◆ ADC_enableBurstMode()

static void ADC_enableBurstMode ( uint32_t  base)
inlinestatic

Enables SOC burst mode.

Parameters
baseis the base address of the ADC.

This function enables SOC burst mode operation of the ADC. Burst mode allows a single trigger to walk through the round-robin SOCs one or more at a time. When burst mode is enabled, the trigger selected by the ADC_setupSOC() API will no longer have an effect on the SOCs in round-robin mode. Use ADC_setBurstMode() to configure the burst trigger and size.

Returns
None.

◆ ADC_disableBurstMode()

static void ADC_disableBurstMode ( uint32_t  base)
inlinestatic

Disables SOC burst mode.

Parameters
baseis the base address of the ADC.

This function disables SOC burst mode operation of the ADC. SOCs in round-robin mode will be triggered by the trigger configured using the ADC_setupSOC() API.

Returns
None.

◆ ADC_setSOCPriority()

static void ADC_setSOCPriority ( uint32_t  base,
ADC_PriorityMode  priMode 
)
inlinestatic

Sets the priority mode of the SOCs.

Parameters
baseis the base address of the ADC.
priModeis the priority mode of the SOCs.

This function sets the priority mode of the SOCs. There are three main modes that can be passed in the priMode parameter

  • All SOCs are in round-robin mode. This means no SOC has an inherent higher priority over another. This is selected by passing in the value ADC_PRI_ALL_ROUND_ROBIN.
  • All priorities are in high priority mode. This means that the priority of the SOC is determined by its SOC number. This option is selected by passing in the value ADC_PRI_ALL_HIPRI.
  • A range of SOCs are assigned high priority, with all others in round robin mode. High priority mode means that an SOC with high priority will interrupt the round robin wheel and insert itself as the next conversion. Passing in the value ADC_PRI_SOC0_HIPRI will make SOC0 highest priority, ADC_PRI_THRU_SOC1_HIPRI will put SOC0 and SOC 1 in high priority, and so on up to ADC_PRI_THRU_SOC14_HIPRI where SOCs 0 through 14 are in high priority.
Returns
None.

◆ ADC_setupPPB()

static void ADC_setupPPB ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
ADC_SOCNumber  socNumber 
)
inlinestatic

Configures a post-processing block (PPB) in the ADC.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
socNumberis the number of the start-of-conversion.

This function associates a post-processing block with a SOC.

The ppbNumber is a value ADC_PPB_NUMBERX where X is a value from 1 to 4 inclusive that identifies a PPB to be configured. The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which SOC is to be configured on the ADC module specified by base.

Note
You can have more that one PPB associated with the same SOC, but a PPB can only be configured to correspond to one SOC at a time. Also note that when you have multiple PPBs for the same SOC, the calibration offset that actually gets applied will be that of the PPB with the highest number. Since SOC0 is the default for all PPBs, look out for unintentional overwriting of a lower numbered PPB's offset.
Returns
None.

◆ ADC_enablePPBEvent()

static void ADC_enablePPBEvent ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
uint16_t  evtFlags 
)
inlinestatic

Enables individual ADC PPB event sources.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
evtFlagsis a bit mask of the event sources to be enabled.

This function enables the indicated ADC PPB event sources. This will allow the specified events to propagate through the X-BAR to a pin or to an ePWM module.

Returns
None.

◆ ADC_disablePPBEvent()

static void ADC_disablePPBEvent ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
uint16_t  evtFlags 
)
inlinestatic

Disables individual ADC PPB event sources.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
evtFlagsis a bit mask of the event sources to be enabled.

This function disables the indicated ADC PPB event sources. This will stop the specified events from propagating through the X-BAR to other modules.

Returns
None.

◆ ADC_enablePPBEventInterrupt()

static void ADC_enablePPBEventInterrupt ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
uint16_t  intFlags 
)
inlinestatic

Enables individual ADC PPB event interrupt sources.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
intFlagsis a bit mask of the interrupt sources to be enabled.

This function enables the indicated ADC PPB interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.

Returns
None.

◆ ADC_disablePPBEventInterrupt()

static void ADC_disablePPBEventInterrupt ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
uint16_t  intFlags 
)
inlinestatic

Disables individual ADC PPB event interrupt sources.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
intFlagsis a bit mask of the interrupt source to be disabled.

This function disables the indicated ADC PPB interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.

Returns
None.

◆ ADC_getPPBEventStatus()

static uint16_t ADC_getPPBEventStatus ( uint32_t  base,
ADC_PPBNumber  ppbNumber 
)
inlinestatic

Gets the current ADC event status.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.

This function returns the event status for the analog-to-digital converter.

Returns
Returns the current event status

◆ ADC_clearPPBEventStatus()

static void ADC_clearPPBEventStatus ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
uint16_t  evtFlags 
)
inlinestatic

Clears ADC event flags.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
evtFlagsis a bit mask of the event source to be cleared.

This function clears the indicated ADC PPB event flags. After an event occurs this function must be called to allow additional events to be produced.

Returns
None.

◆ ADC_readPPBResult()

static int32_t ADC_readPPBResult ( uint32_t  resultBase,
ADC_PPBNumber  ppbNumber 
)
inlinestatic

Reads the processed conversion result from the PPB.

Parameters
resultBaseis the base address of the ADC results.
ppbNumberis the number of the post-processing block.

This function returns the processed conversion result that corresponds to the base address passed into resultBase and the PPB passed into ppbNumber.

Note
Take care that you are using a base address for the result registers (ADCxRESULT_BASE) and not a base address for the control registers.
Returns
Returns the signed 32-bit conversion result.

◆ ADC_getPPBDelayTimeStamp()

static uint16_t ADC_getPPBDelayTimeStamp ( uint32_t  base,
ADC_PPBNumber  ppbNumber 
)
inlinestatic

Reads sample delay time stamp from a PPB.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.

This function returns the sample delay time stamp. This delay is the number of system clock cycles between the SOC being triggered and when it began converting.

Returns
Returns the delay time stamp.

◆ ADC_setPPBCalibrationOffset()

static void ADC_setPPBCalibrationOffset ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
int16_t  offset 
)
inlinestatic

Sets the post processing block offset correction.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
offsetis the 10-bit signed value subtracted from ADC the output.

This function sets the PPB offset correction value. This value can be used to digitally remove any system-level offset inherent in the ADCIN circuit before it is stored in the appropriate result register. The offset parameter is subtracted from the ADC output and is a signed value from -512 to 511 inclusive. For example, when offset = 1, ADCRESULT = ADC output - 1. When offset = -512, ADCRESULT = ADC output - (-512) or ADC output + 512.

Passing a zero in to the offset parameter will effectively disable the calculation, allowing the raw ADC result to be passed unchanged into the result register.

Note
If multiple PPBs are applied to the same SOC, the offset that will be applied will be that of the PPB with the highest number.
Returns
None

◆ ADC_setPPBReferenceOffset()

static void ADC_setPPBReferenceOffset ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
uint16_t  offset 
)
inlinestatic

Sets the post processing block reference offset.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
offsetis the 12-bit unsigned value subtracted from ADC the output.

This function sets the PPB reference offset value. This can be used to either calculate the feedback error or convert a unipolar signal to bipolar by subtracting a reference value. The result will be stored in the appropriate PPB result register which can be read using ADC_readPPBResult().

Passing a zero in to the offset parameter will effectively disable the calculation and will pass the ADC result to the PPB result register unchanged.

Note
If in 12-bit mode, you may only pass a 12-bit value into the offset parameter.
Returns
None

◆ ADC_enablePPBTwosComplement()

static void ADC_enablePPBTwosComplement ( uint32_t  base,
ADC_PPBNumber  ppbNumber 
)
inlinestatic

Enables two's complement capability in the PPB.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.

This function enables two's complement in the post-processing block specified by the ppbNumber parameter. When enabled, a two's complement will be performed on the output of the offset subtraction before it is stored in the appropriate PPB result register. In other words, the PPB result will be the reference offset value minus the the ADC result value (ADCPPBxRESULT = ADCSOCxOFFREF - ADCRESULTx).

Returns
None

◆ ADC_disablePPBTwosComplement()

static void ADC_disablePPBTwosComplement ( uint32_t  base,
ADC_PPBNumber  ppbNumber 
)
inlinestatic

Disables two's complement capability in the PPB.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.

This function disables two's complement in the post-processing block specified by the ppbNumber parameter. When disabled, a two's complement will NOT be performed on the output of the offset subtraction before it is stored in the appropriate PPB result register. In other words, the PPB result will be the ADC result value minus the reference offset value (ADCPPBxRESULT = ADCRESULTx - ADCSOCxOFFREF).

Returns
None

◆ ADC_enablePPBEventCBCClear()

static void ADC_enablePPBEventCBCClear ( uint32_t  base,
uint32_t  ppbNumber 
)
inlinestatic

Enables cycle-by-cycle clear of ADC PPB event flags.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.

This function enables the automatic cycle-by-cycle clear of ADC PPB event flags. When enabled, the desired PPB event flags are automatically cleared on the next PPBxRESULT load, unless a set condition is also occurring at the same time, in which case the set takes precedence.

Returns
None.

◆ ADC_disablePPBEventCBCClear()

static void ADC_disablePPBEventCBCClear ( uint32_t  base,
uint32_t  ppbNumber 
)
inlinestatic

Disables cycle-by-cycle clear of ADC PPB event flags.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.

This function disables the cycle-by-cycle clear of ADC PPB event flags. When disabled, the desired PPB event flags are to be cleared explicitly in software inorder to generate next set of interrupts/events.

Returns
None.

◆ ADC_enableInterrupt()

static void ADC_enableInterrupt ( uint32_t  base,
ADC_IntNumber  adcIntNum 
)
inlinestatic

Enables an ADC interrupt source.

Parameters
baseis the base address of the ADC module.
adcIntNumis interrupt number within the ADC wrapper.

This function enables the indicated ADC interrupt source. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.

adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be enabled.

Returns
None.

◆ ADC_disableInterrupt()

static void ADC_disableInterrupt ( uint32_t  base,
ADC_IntNumber  adcIntNum 
)
inlinestatic

Disables an ADC interrupt source.

Parameters
baseis the base address of the ADC module.
adcIntNumis interrupt number within the ADC wrapper.

This function disables the indicated ADC interrupt source. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.

adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be disabled.

Returns
None.

◆ ADC_setInterruptSource()

static void ADC_setInterruptSource ( uint32_t  base,
ADC_IntNumber  adcIntNum,
ADC_SOCNumber  socNumber 
)
inlinestatic

Sets the source EOC for an analog-to-digital converter interrupt.

Parameters
baseis the base address of the ADC module.
adcIntNumis interrupt number within the ADC wrapper.
socNumberis the number of the start-of-conversion.

This function sets which conversion is the source of an ADC interrupt.

The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which EOC is to be configured on the ADC module specified by base.

adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module is being configured.

Returns
None.

◆ ADC_enableContinuousMode()

static void ADC_enableContinuousMode ( uint32_t  base,
ADC_IntNumber  adcIntNum 
)
inlinestatic

Enables continuous mode for an ADC interrupt.

Parameters
baseis the base address of the ADC.
adcIntNumis interrupt number within the ADC wrapper.

This function enables continuous mode for the ADC interrupt passed into adcIntNum. This means that pulses will be generated for the specified ADC interrupt whenever an EOC pulse is generated irrespective of whether or not the flag bit is set.

adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module is being configured.

Returns
None.

◆ ADC_disableContinuousMode()

static void ADC_disableContinuousMode ( uint32_t  base,
ADC_IntNumber  adcIntNum 
)
inlinestatic

Disables continuous mode for an ADC interrupt.

Parameters
baseis the base address of the ADC.
adcIntNumis interrupt number within the ADC wrapper.

This function disables continuous mode for the ADC interrupt passed into adcIntNum. This means that pulses will not be generated for the specified ADC interrupt until the corresponding interrupt flag for the previous interrupt occurrence has been cleared using ADC_clearInterruptStatus().

adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module is being configured.

Returns
None.

◆ ADC_setMode()

void ADC_setMode ( uint32_t  base,
ADC_Resolution  resolution,
ADC_SignalMode  signalMode 
)

Configures the analog-to-digital converter resolution and signal mode.

Parameters
baseis the base address of the ADC module.
resolutionis the resolution of the converter (12 bits).
signalModeis the input signal mode of the converter.

This function configures the ADC module's conversion resolution and input signal mode and ensures that the corresponding trims are loaded.

The resolution parameter specifies the resolution of the conversion. It can be 12-bit specified by ADC_RESOLUTION_12BIT

The signalMode parameter specifies the signal mode. In single-ended mode, which is indicated by ADC_MODE_SINGLE_ENDED, the input voltage is sampled on a single pin referenced to VREFLO. In differential mode, which is indicated by ADC_MODE_DIFFERENTIAL, the input voltage to the converter is sampled on a pair of input pins, a positive and a negative.

Returns
None.

◆ ADC_setPPBTripLimits()

void ADC_setPPBTripLimits ( uint32_t  base,
ADC_PPBNumber  ppbNumber,
int32_t  tripHiLimit,
int32_t  tripLoLimit 
)

Sets the windowed trip limits for a PPB.

Parameters
baseis the base address of the ADC module.
ppbNumberis the number of the post-processing block.
tripHiLimitis the value is the digital comparator trip high limit.
tripLoLimitis the value is the digital comparator trip low limit.

This function sets the windowed trip limits for a PPB. These values set the digital comparator so that when one of the values is exceeded, either a high or low trip event will occur.

The ppbNumber is a value ADC_PPB_NUMBERX where X is a value from 1 to 4 inclusive that identifies a PPB to be configured.

In 12-bit mode, only bits 12:0 will be compared against bits 12:0 of the PPB result.

Returns
None.