Driverlib ADC API

Module: Driverlib (AM13E232X) APIs

Structures

Name

struct

DL_ADC_CoreConfig
Analog Core configuration structure.

struct

DL_ADC_SeqNConfig
Sequencer N’s configuration structure.

struct

DL_ADC_SeqConfig
Sequencer configuration structure.

struct

DL_ADC_SocConfig
SOC configurations structure.

struct

DL_ADC_PpbConfig
PPB configuration structure.

struct

DL_ADC_IntNConfig
Interrupt block configuration structure.

struct

DL_ADC_IntConfig
Interrupt configuration structure.

struct

DL_ADC_Config
Main configuration structure for the ADC.

Types

Name

enum

DL_ADC_INT_PULSE_POS { DL_ADC_PULSE_END_OF_ACQ_WIN = 0, DL_ADC_PULSE_END_OF_CONV = 1}
Interrupt pulse position.

enum

DL_ADC_CLK_PRESCALE { DL_ADC_CLOCK_DIVIDE_1_0 = 0U, DL_ADC_CLOCK_DIVIDE_1_5 = 1U, DL_ADC_CLOCK_DIVIDE_2_0 = 2U, DL_ADC_CLOCK_DIVIDE_2_5 = 3U, DL_ADC_CLOCK_DIVIDE_3_0 = 4U, DL_ADC_CLOCK_DIVIDE_3_5 = 5U, DL_ADC_CLOCK_DIVIDE_4_0 = 6U, DL_ADC_CLOCK_DIVIDE_4_5 = 7U, DL_ADC_CLOCK_DIVIDE_5_0 = 8U, DL_ADC_CLOCK_DIVIDE_5_5 = 9U, DL_ADC_CLOCK_DIVIDE_6_0 = 10U, DL_ADC_CLOCK_DIVIDE_6_5 = 11U, DL_ADC_CLOCK_DIVIDE_7_0 = 12U, DL_ADC_CLOCK_DIVIDE_7_5 = 13U, DL_ADC_CLOCK_DIVIDE_8_0 = 14U, DL_ADC_CLOCK_DIVIDE_8_5 = 15U}
ADC clock divider. ADCCLK = (input clock) / divider.

enum

DL_ADC_SOC_NUMBER { DL_ADC_SOC_NUMBER0 = 0U, DL_ADC_SOC_NUMBER1 = 1U, DL_ADC_SOC_NUMBER2 = 2U, DL_ADC_SOC_NUMBER3 = 3U, DL_ADC_SOC_NUMBER4 = 4U, DL_ADC_SOC_NUMBER5 = 5U, DL_ADC_SOC_NUMBER6 = 6U, DL_ADC_SOC_NUMBER7 = 7U, DL_ADC_SOC_NUMBER8 = 8U, DL_ADC_SOC_NUMBER9 = 9U, DL_ADC_SOC_NUMBER10 = 10U, DL_ADC_SOC_NUMBER11 = 11U, DL_ADC_SOC_NUMBER12 = 12U, DL_ADC_SOC_NUMBER13 = 13U, DL_ADC_SOC_NUMBER14 = 14U, DL_ADC_SOC_NUMBER15 = 15U}
SOC/EOC number.

enum

DL_ADC_INT_NUMBER { DL_ADC_INT_NUMBER1 = 0U, DL_ADC_INT_NUMBER2 = 1U, DL_ADC_INT_NUMBER3 = 2U, DL_ADC_INT_NUMBER4 = 3U}
ADC Interrupt number.

enum

DL_ADC_DMAINT_NUMBER { DL_ADC_DMAINT_NUMBER1 = 0U, DL_ADC_DMAINT_NUMBER2 = 1U, DL_ADC_DMAINT_NUMBER3 = 2U, DL_ADC_DMAINT_NUMBER4 = 3U}
ADC DMA Interrupt number.

enum

DL_ADC_CHANNEL { DL_ADC_CH_ADCIN0 = 0U, DL_ADC_CH_ADCIN1 = 1U, DL_ADC_CH_ADCIN2 = 2U, DL_ADC_CH_ADCIN3 = 3U, DL_ADC_CH_ADCIN4 = 4U, DL_ADC_CH_ADCIN5 = 5U, DL_ADC_CH_ADCIN6 = 6U, DL_ADC_CH_ADCIN7 = 7U, DL_ADC_CH_ADCIN8 = 8U, DL_ADC_CH_ADCIN9 = 9U, DL_ADC_CH_ADCIN10 = 10U, DL_ADC_CH_ADCIN11 = 11U, DL_ADC_CH_ADCIN12 = 12U, DL_ADC_CH_ADCIN13 = 13U, DL_ADC_CH_ADCIN14 = 14U, DL_ADC_CH_ADCIN15 = 15U, DL_ADC_CH_ADCIN16 = 16U, DL_ADC_CH_ADCIN17 = 17U, DL_ADC_CH_ADCIN18 = 18U, DL_ADC_CH_ADCIN19 = 19U, DL_ADC_CH_ADCIN20 = 20U, DL_ADC_CH_ADCIN21 = 21U, DL_ADC_CH_ADCIN22 = 22U, DL_ADC_CH_ADCIN23 = 23U, DL_ADC_CH_ADCIN24 = 24U, DL_ADC_CH_ADCIN25 = 25U, DL_ADC_CH_ADCIN26 = 26U, DL_ADC_CH_ADCIN27 = 27U, DL_ADC_CH_ADCIN28 = 28U, DL_ADC_CH_ADCIN29 = 29U, DL_ADC_CH_ADCIN30 = 30U, DL_ADC_CH_ADCIN31 = 31U}
ADC Channel.

enum

DL_ADC_SEQ_NUMBER { DL_ADC_SEQ_NUMBER1 = 0U, DL_ADC_SEQ_NUMBER2 = 1U, DL_ADC_SEQ_NUMBER3 = 2U, DL_ADC_SEQ_NUMBER4 = 3U}
SEQ number.

enum

DL_ADC_PPB_NUMBER { DL_ADC_PPB_NUMBER1 = 0U, DL_ADC_PPB_NUMBER2 = 1U, DL_ADC_PPB_NUMBER3 = 2U, DL_ADC_PPB_NUMBER4 = 3U}
PPB number.

enum

DL_ADC_PPB_LIMIT { DL_ADC_PPB_LIMIT_NIL = 0U, DL_ADC_PPB_LIMIT_2 = 1U, DL_ADC_PPB_LIMIT_4 = 2U, DL_ADC_PPB_LIMIT_8 = 3U}
PPB Oversampling limit.

enum

DL_ADC_PPB_SHIFT { DL_ADC_PPB_SHIFT_0 = 0U, DL_ADC_PPB_SHIFT_1 = 1U, DL_ADC_PPB_SHIFT_2 = 2U, DL_ADC_PPB_SHIFT_3 = 3U, DL_ADC_PPB_SHIFT_4 = 4U, DL_ADC_PPB_SHIFT_5 = 5U, DL_ADC_PPB_SHIFT_6 = 6U, DL_ADC_PPB_SHIFT_7 = 7U}
PPB PSUM shift value.

enum

DL_ADC_PPB_COMPSOURCE { DL_ADC_PPB_COMPSOURCE_RESULT = 0U, DL_ADC_PPB_COMPSOURCE_SUM = 1U}
PPB Compare source select.

enum

DL_ADC_PPB_SYNC_INPUT { DL_ADC_SYNCIN_DISABLE = 0U, DL_ADC_SYNCIN_INPUTXBAR5 = 1U, DL_ADC_SYNCIN_INPUTXBAR6 = 2U, DL_ADC_SYNCIN_ECAP0_SYNCOUT = 3U, DL_ADC_SYNCIN_ECAP1_SYNCOUT = 4U, DL_ADC_SYNCIN_MCPWM0_SYNCPER = 5U, DL_ADC_SYNCIN_MCPWM1_SYNCPER = 6U, DL_ADC_SYNCIN_MCPWM2_SYNCPER = 7U, DL_ADC_SYNCIN_ECAP2_SYNCOUT = 10U, DL_ADC_SYNCIN_EPWM0_SYNCPER = 11U, DL_ADC_SYNCIN_EPWM1_SYNCPER = 12U, DL_ADC_SYNCIN_EPWM2_SYNCPER = 13U, DL_ADC_SYNCIN_EPWM3_SYNCPER = 14U, DL_ADC_SYNCIN_EPWM4_SYNCPER = 15U, DL_ADC_SYNCIN_EPWM5_SYNCPER = 16U, DL_ADC_SYNCIN_ECAT_SYNC0 = 17U, DL_ADC_SYNCIN_ECAT_SYNC1 = 18U}
PPB sync input.

enum

DL_ADC_SEQ_PREEMPT { DL_ADC_SEQ_PREEMPT_DISABLE = 0, DL_ADC_SEQ_PREEMPT_ENABLE_NORESTART = 2, DL_ADC_SEQ_PREEMPT_ENABLE_RESTART = 3}
ADC SOC Seqeunce preemt.

enum

DL_ADC_TRIGGER { DL_ADC_TRIGGER_SOFTWARE = 0, DL_ADC_TRIGGER_TIMG4_0_GEN_EVENT0 = 1, DL_ADC_TRIGGER_TIMG12_0_GEN_EVENT0 = 2, DL_ADC_TRIGGER_INPUTXBAR5 = 3, DL_ADC_TRIGGER_MCPWM0_SOCA = 4, DL_ADC_TRIGGER_MCPWM0_SOCB = 5, DL_ADC_TRIGGER_MCPWM0_SOCC = 6, DL_ADC_TRIGGER_MCPWM0_SOCD = 7, DL_ADC_TRIGGER_MCPWM1_SOCA = 8, DL_ADC_TRIGGER_MCPWM1_SOCB = 9, DL_ADC_TRIGGER_MCPWM1_SOCC = 10, DL_ADC_TRIGGER_MCPWM1_SOCD = 11, DL_ADC_TRIGGER_MCPWM2_SOCA = 12, DL_ADC_TRIGGER_MCPWM2_SOCB = 13, DL_ADC_TRIGGER_MCPWM2_SOCC = 14, DL_ADC_TRIGGER_MCPWM2_SOCD = 15, DL_ADC_TRIGGER_ADC0_INT1 = 16, DL_ADC_TRIGGER_ADC1_INT1 = 17, DL_ADC_TRIGGER_ADC2_INT1 = 18, DL_ADC_TRIGGER_EPWM0_SOCA = 19, DL_ADC_TRIGGER_EPWM0_SOCB = 20, DL_ADC_TRIGGER_EPWM1_SOCA = 21, DL_ADC_TRIGGER_EPWM1_SOCB = 22, DL_ADC_TRIGGER_EPWM2_SOCA = 23, DL_ADC_TRIGGER_EPWM2_SOCB = 24, DL_ADC_TRIGGER_EPWM3_SOCA = 25, DL_ADC_TRIGGER_EPWM3_SOCB = 26, DL_ADC_TRIGGER_EPWM4_SOCA = 27, DL_ADC_TRIGGER_EPWM4_SOCB = 28, DL_ADC_TRIGGER_EPWM5_SOCA = 29, DL_ADC_TRIGGER_EPWM5_SOCB = 30}
ADC Triggers.

enum

DL_ADC_SAMPLE_CAP_RESET_SELECT { DL_ADC_SAMPLE_CAP_RESET_SELECT_VREFLO = 0, DL_ADC_SAMPLE_CAP_RESET_SELECT_VREFHIBY2 = 1}
Sample capacitor reset to either vrefhi/2 or vreflo.

Functions

Name

__STATIC_INLINE void

DL_ADC_enablePower(ADC_Regs * adc)
Enables power for the ADC module.

__STATIC_INLINE void

DL_ADC_disablePower(ADC_Regs * adc)
Disables power for the ADC module.

__STATIC_INLINE bool

DL_ADC_isPowerEnabled(ADC_Regs * adc)
Returns if power enable (PWREN) register for the ADC is enabled.

__STATIC_INLINE void

DL_ADC_reset(ADC_Regs * adc)
Resets ADC peripheral.

__STATIC_INLINE bool

DL_ADC_isReset(ADC_Regs * adc)
Returns if ADC peripheral was reset.

__STATIC_INLINE bool

DL_ADC_isBusy(ADC_Regs * adc)
Returns if ADC is busy and cannot sample another channel.

__STATIC_INLINE uint32_t

DL_ADC_lastBusyChannel(ADC_Regs * adc)
Returns the current processing SOC or last converted SOC.

__STATIC_INLINE void

DL_ADC_powerUp(ADC_Regs * adc)
Powers up the analog-to-digital converter core.

__STATIC_INLINE void

DL_ADC_powerDown(ADC_Regs * adc)
Powers down the analog-to-digital converter core.

__STATIC_INLINE void

DL_ADC_setInterruptPulseMode(ADC_Regs * adc, DL_ADC_INT_PULSE_POS pulseMode)
Sets interrupt pulse position.

__STATIC_INLINE void

DL_ADC_setPrescaler(ADC_Regs * adc, DL_ADC_CLK_PRESCALE clkPrescale)
Sets clock prescaler value or clock divide ratio value.

__STATIC_INLINE void

DL_ADC_enableContinuousMode(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Enables continue mode for an ADC interrupt.

__STATIC_INLINE void

DL_ADC_disableContinuousMode(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Disables continue mode for an ADC interrupt.

__STATIC_INLINE void

DL_ADC_enableInterrupt(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Enables an ADC interrupt source.

__STATIC_INLINE void

DL_ADC_disableInterrupt(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Disables an ADC interrupt source.

__STATIC_INLINE void

DL_ADC_setInterruptSource(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum, DL_ADC_SOC_NUMBER intTrigger)
Selects which EOC to be selected as a source for the interrupt.

__STATIC_INLINE void

DL_ADC_enableDMAContinuousMode(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Enables continue mode for an ADC interrupt for DMA.

__STATIC_INLINE void

DL_ADC_disableDMAContinuousMode(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Disables continue mode for an ADC interrupt for DMA.

__STATIC_INLINE void

DL_ADC_enableDMAInterrupt(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Enables an ADC interrupt for DMA.

__STATIC_INLINE void

DL_ADC_disableDMAInterrupt(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Disables an ADC interrupt for DMA.

__STATIC_INLINE void

DL_ADC_setDMAInterruptSource(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum, DL_ADC_SOC_NUMBER intTrigger)
Selects which EOC to be selected as a source for the DMA interrupt.

__STATIC_INLINE bool

DL_ADC_getRawInterruptStatus(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Returns the Raw ADC interrupt status.

__STATIC_INLINE bool

DL_ADC_getRawDMAInterruptStatus(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Returns the Raw ADC DMA interrupt status.

__STATIC_INLINE bool

DL_ADC_getInterruptStatus(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Returns the current ADC interrupt status.

__STATIC_INLINE bool

DL_ADC_getInterruptResultReadyStatus(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Returns the result ready Flag Status for ADC interrupt.

__STATIC_INLINE bool

DL_ADC_getDMAInterruptStatus(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Returns the current ADC DMA Interrupt Flag status.

__STATIC_INLINE void

DL_ADC_forceInterruptStatus(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Force ADC interrupt flags status.

__STATIC_INLINE void

DL_ADC_forceDMAInterruptStatus(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Force ADC DMA interrupt flag status.

__STATIC_INLINE void

DL_ADC_clearInterruptStatus(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Clears ADC interrupt flag status.

__STATIC_INLINE void

DL_ADC_clearDMAInterruptStatus(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Clears ADC DMA interrupt flag status This API clears the specified ADC DMA interrupt status in ADCINTFLG, ADCRAWINTFLG registers so that they no longer assert. If software sets the clear bit on the same cycle that hardware is trying to set the flag it, then hardware has priority and the overflow bit will not be set.

__STATIC_INLINE bool

DL_ADC_getInterruptOverflowStatus(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Returns Interrupt Overflow status.

__STATIC_INLINE bool

DL_ADC_getDMAInterruptOverflowStatus(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Returns DMA Interrupt Overflow status.

__STATIC_INLINE void

DL_ADC_clearInterruptOverflowStatus(ADC_Regs * adc, DL_ADC_INT_NUMBER adcIntNum)
Clears ADC interrupt overflow status flag.

__STATIC_INLINE void

DL_ADC_clearDMAInterruptOverflowStatus(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER adcIntNum)
Clears ADC DMA interrupt overflow status flag.

__STATIC_INLINE bool

DL_ADC_getSOCStatus(ADC_Regs * adc, DL_ADC_SOC_NUMBER socNumber)
Returns Start of Conversion Status.

__STATIC_INLINE bool

DL_ADC_getSOCOverflowStatus(ADC_Regs * adc, DL_ADC_SOC_NUMBER socNumber)
Returns Start of Conversion Overflow Status.

__STATIC_INLINE void

DL_ADC_clearSOCOverflowStatus(ADC_Regs * adc, DL_ADC_SOC_NUMBER socNumber)
Clears Start of Conversion Overflow flag.

__STATIC_INLINE void

DL_ADC_selectSOCChannel(ADC_Regs * adc, DL_ADC_SOC_NUMBER socNumber, DL_ADC_CHANNEL channel)
Selects the channel to be converted.

__STATIC_INLINE void

DL_ADC_enableSOCComparator(ADC_Regs * adc, DL_ADC_SOC_NUMBER socNumber)
Enables SOC thrashold comparator.

__STATIC_INLINE void

DL_ADC_disableSOCComparator(ADC_Regs * adc, DL_ADC_SOC_NUMBER socNumber)
Disables SOC thrashold comparator.

__STATIC_INLINE bool

DL_ADC_getPPBTripHighStatus(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber)
Returns PPB TRIP high status.

__STATIC_INLINE bool

DL_ADC_getPPBTripLowStatus(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber)
Returns PPB TRIP low status.

__STATIC_INLINE bool

DL_ADC_getPPBTripLimitStatus(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber)
Returns PPB TRIP limit status.

__STATIC_INLINE void

DL_ADC_clearPPBEventStatus(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, uint32_t evtFlags)

__STATIC_INLINE void

DL_ADC_enablePPBEvent(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, uint32_t evtFlags)
Enables individual ADC PPB event sources.

__STATIC_INLINE void

DL_ADC_disablePPBEvent(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, uint32_t evtFlags)
Disables individual ADC PPB event sources.

__STATIC_INLINE void

DL_ADC_enablePPBEventInterrupt(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, uint32_t intFlags)
Enables individual ADC PPB event interrupt sources.

__STATIC_INLINE void

DL_ADC_disablePPBEventInterrupt(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, uint32_t intFlags)
Disables individual ADC PPB event interrupt sources.

__STATIC_INLINE uint32_t

DL_ADC_getADCType(ADC_Regs * adc)
Returns ADC Type.

__STATIC_INLINE uint32_t

DL_ADC_getADCRevision(ADC_Regs * adc)
Returns ADC Revision.

__STATIC_INLINE void

DL_ADC_enablePPBEventCBCClear(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber)
Enables cycle-by-cycle clear of ADC PPB event flags.

__STATIC_INLINE void

DL_ADC_disablePPBEventCBCClear(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber)
Disables cycle-by-cycle clear of ADC PPB event flags.

__STATIC_INLINE void

DL_ADC_setPPBTripHighLimit(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, uint16_t tripHiLimit)
Sets the digital comparator trip high limit.

__STATIC_INLINE void

DL_ADC_setPPBTripLowLimit(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, uint16_t tripLoLimit)
Sets the digital comparator trip low limit.

__STATIC_INLINE void

DL_ADC_setInterruptCycleDelay(ADC_Regs * adc, uint8_t cycleDelay)
Sets the timing of early interrupt generation.

__STATIC_INLINE uint32_t

DL_ADC_getADCWrapperType(ADC_Regs * adc)
Returns the ADC wrapper type.

__STATIC_INLINE uint32_t

DL_ADC_getADCWrapperRevision(ADC_Regs * adc)
Returns the ADC wrapper revision.

__STATIC_INLINE void

DL_ADC_setPPBOversamplingLimit(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, DL_ADC_PPB_LIMIT limit)
Sets the oversampling limit.

__STATIC_INLINE uint32_t

DL_ADC_readPPBPCount(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber)
Reads the oversampling partial count.

__STATIC_INLINE void

DL_ADC_setPPBShiftValue(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, DL_ADC_PPB_SHIFT shiftVal)
Sets PPB shift value.

__STATIC_INLINE void

DL_ADC_selectPPBCompareSource(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, DL_ADC_PPB_COMPSOURCE compSrc)
Configures PPB compare source.

__STATIC_INLINE void

DL_ADC_selectPPBSyncSource(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, DL_ADC_PPB_SYNC_INPUT syncInSrc)
Configures PPB Sync source.

__STATIC_INLINE uint32_t

DL_ADC_readPPBPSum(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber)
Reads the oversampled partial sum from the PPB.

__STATIC_INLINE void

DL_ADC_setSeqEndSOC(ADC_Regs * adc, DL_ADC_SOC_NUMBER socNumber)
Sets end SOC number of last enabled sequence.

__STATIC_INLINE void

DL_ADC_setSeqPreemptMode(ADC_Regs * adc, DL_ADC_SEQ_PREEMPT seqPreempt)
Sets SOC sequence preempt and restart setting.

__STATIC_INLINE void

DL_ADC_setupSequencer(ADC_Regs * adc, DL_ADC_SEQ_NUMBER seqNumber, uint32_t sampleWindow, DL_ADC_TRIGGER trigger, DL_ADC_SOC_NUMBER socStartNumber)
Sets up the sequencer configurations.

__STATIC_INLINE void

DL_ADC_enableSequencer(ADC_Regs * adc, DL_ADC_SEQ_NUMBER seqNumber)
Enables the sequencer.

__STATIC_INLINE void

DL_ADC_disableSequencer(ADC_Regs * adc, DL_ADC_SEQ_NUMBER seqNumber)
Disables the sequencer.

__STATIC_INLINE void

DL_ADC_enableSampleCapReset(ADC_Regs * adc, DL_ADC_SEQ_NUMBER seqNumber)
Enables the sample capacitor reset.

__STATIC_INLINE void

DL_ADC_disableSampleCapReset(ADC_Regs * adc, DL_ADC_SEQ_NUMBER seqNumber)
Disables the sample capacitor reset.

__STATIC_INLINE void

DL_ADC_selectSampleCAPResetValue(ADC_Regs * adc, DL_ADC_SEQ_NUMBER seqNumber, DL_ADC_SAMPLE_CAP_RESET_SELECT capResetVal)
Selects the sample capacitor reset value.

__STATIC_INLINE void

DL_ADC_forceSequencer(ADC_Regs * adc, DL_ADC_SEQ_NUMBER seqNumber)
Forces a trigger to sequencer.

__STATIC_INLINE uint16_t

DL_ADC_readResult(ADC_RESULT_Regs * adcResult, DL_ADC_SOC_NUMBER socNumber)
Reads the 12-bit ADC result.

__STATIC_INLINE uint32_t

DL_ADC_readPPBResult(ADC_RESULT_Regs * adcResult, DL_ADC_PPB_NUMBER ppbNumber)
Reads the processed conversion result from the PPB.

__STATIC_INLINE uint32_t

DL_ADC_readPPBSum(ADC_RESULT_Regs * adcResult, DL_ADC_PPB_NUMBER ppbNumber)
Returns the oversampling final sum result.

__STATIC_INLINE uint32_t

DL_ADC_readPPBCount(ADC_RESULT_Regs * adcResult, DL_ADC_PPB_NUMBER ppbNumber)
Returns the oversampling final count.

__STATIC_INLINE uint32_t

DL_ADC_readSeqFIFOResult(ADC_RESULT_Regs * adcResult, DL_ADC_SEQ_NUMBER seqNumber)
Returns 32-bit FIFO result containing a pair of conversion results.

__STATIC_INLINE bool

DL_ADC_isSeqFIFOValid(ADC_RESULT_Regs * adcResult, DL_ADC_SEQ_NUMBER seqNumber)
Returns the status of FIFO conversions for a given sequencer.

__STATIC_INLINE uint32_t

DL_ADC_getPendingReads(ADC_RESULT_Regs * adcResult, DL_ADC_SEQ_NUMBER seqNumber)
Returns the number of pending reads in the FIFO.

void

DL_ADC_initParamsSetDefault(DL_ADC_Config * config)
Initializes the ADC configuration parameters.

void

DL_ADC_init(ADC_Regs * adc, DL_ADC_Config * config)
Initializes the ADC module.

void

DL_ADC_socInit(ADC_Regs * adc, DL_ADC_SOC_NUMBER socNumber, DL_ADC_SocConfig * socConfig)
Initializes the SOC submodule of ADC.

void

DL_ADC_ppbInit(ADC_Regs * adc, DL_ADC_PPB_NUMBER ppbNumber, DL_ADC_PpbConfig * ppbConfig)
Initializes the PPB submodule of ADC.

void

DL_ADC_interruptInit(ADC_Regs * adc, DL_ADC_INT_NUMBER intNumber, DL_ADC_IntNConfig * intNConfig)
Initializes the interrupt block submodule of ADC.

void

DL_ADC_dmaInterruptInit(ADC_Regs * adc, DL_ADC_DMAINT_NUMBER dmaIntNumber, DL_ADC_IntNConfig * dmaIntNConfig)
Initializes the DMA interrupt block submodule of ADC.

void

DL_ADC_sequencerInit(ADC_Regs * adc, DL_ADC_SEQ_NUMBER seqNumber, DL_ADC_SeqNConfig * seqNConfig)
Initializes the sequencer submodule of ADC.

Defines

Name

DL_ADC_EVT_TRIPHI
ADC PPB Trip High Event.

DL_ADC_EVT_TRIPLO
ADC PPB Trip Low Event.

DL_ADC_EVT_NLIMIT
ADC PPB Within Trip limit Event.

DL_ADCSOCCTL_STEP
Step size between SOCxCTL registers.

DL_ADCPPBCONFIG_STEP
Step size between ADCPPBxCONFIG registers.

DL_ADCPPBLIMIT_STEP
Step size between ADCPPBxLIMIT registers.

DL_ADCPPBPCOUNT_STEP
Step size between ADCPPBxPCOUNT registers.

DL_ADCPPBCONFIG2_STEP
Step size between ADCPPBxCONFIG2 registers.

DL_ADCPPBPSUM_STEP
Step size between ADCPPBxPSUM registers.

DL_ADCSEQCONFIG_STEP
Step size between ADCSEQxCONFIG registers.

DL_ADCRESULT_STEP
Step size between ADCRESULTx registers.

DL_ADCPPBRESULT_STEP
Step size between ADCPPBxRESULT registers.

DL_ADCPPBSUM_STEP
Step size between ADCPPBxSUM registers.

DL_ADCPPBCOUNT_STEP
Step size between ADCPPBxCOUNT registers.

DL_ADCSEQ_FIFORESULT_STEP
Step size between ADCSEQx FIFO Result registers.

DL_ADCSEQ_FIFOSTATUS_STEP
Step size between ADCSEQx FIFO Status registers.

DL_SAMPLEWINDOW_MAX
maximum value of sample window

DL_SAMPLEWINDOW_MIN
minimum value of sample window

DL_CYCLE_DELAY_MAX
maximum value of delay for early interrupt generation

Types Documentation

enum DL_ADC_INT_PULSE_POS

Enumerator

Value

Description

DL_ADC_PULSE_END_OF_ACQ_WIN

0

End of acquisition window. Set Interrupt pulse position for pulse generation to occur when ADC begins conversion + a number of sysclk cycles controlled by DL_ADC_setEarlyInterruptGenerationDelay

DL_ADC_PULSE_END_OF_CONV

1

End of conversion. Set Interrupt pulse position for pulse generation to occur at the end of conversion 1 cycle prior to the ADC result latching into its result register

Interrupt pulse position.

enum DL_ADC_CLK_PRESCALE

Enumerator

Value

Description

DL_ADC_CLOCK_DIVIDE_1_0

0U

ADCCLK = (input clock) / 1.0

DL_ADC_CLOCK_DIVIDE_1_5

1U

ADCCLK = (input clock) / 1.5

DL_ADC_CLOCK_DIVIDE_2_0

2U

ADCCLK = (input clock) / 2.0

DL_ADC_CLOCK_DIVIDE_2_5

3U

ADCCLK = (input clock) / 2.5

DL_ADC_CLOCK_DIVIDE_3_0

4U

ADCCLK = (input clock) / 3.0

DL_ADC_CLOCK_DIVIDE_3_5

5U

ADCCLK = (input clock) / 3.5

DL_ADC_CLOCK_DIVIDE_4_0

6U

ADCCLK = (input clock) / 4.0

DL_ADC_CLOCK_DIVIDE_4_5

7U

ADCCLK = (input clock) / 4.5

DL_ADC_CLOCK_DIVIDE_5_0

8U

ADCCLK = (input clock) / 5.0

DL_ADC_CLOCK_DIVIDE_5_5

9U

ADCCLK = (input clock) / 5.5

DL_ADC_CLOCK_DIVIDE_6_0

10U

ADCCLK = (input clock) / 6.0

DL_ADC_CLOCK_DIVIDE_6_5

11U

ADCCLK = (input clock) / 6.5

DL_ADC_CLOCK_DIVIDE_7_0

12U

ADCCLK = (input clock) / 7.0

DL_ADC_CLOCK_DIVIDE_7_5

13U

ADCCLK = (input clock) / 7.5

DL_ADC_CLOCK_DIVIDE_8_0

14U

ADCCLK = (input clock) / 8.0

DL_ADC_CLOCK_DIVIDE_8_5

15U

ADCCLK = (input clock) / 8.5

ADC clock divider. ADCCLK = (input clock) / divider.

enum DL_ADC_SOC_NUMBER

Enumerator

Value

Description

DL_ADC_SOC_NUMBER0

0U

SOC/EOC number 0

DL_ADC_SOC_NUMBER1

1U

SOC/EOC number 1

DL_ADC_SOC_NUMBER2

2U

SOC/EOC number 2

DL_ADC_SOC_NUMBER3

3U

SOC/EOC number 3

DL_ADC_SOC_NUMBER4

4U

SOC/EOC number 4

DL_ADC_SOC_NUMBER5

5U

SOC/EOC number 5

DL_ADC_SOC_NUMBER6

6U

SOC/EOC number 6

DL_ADC_SOC_NUMBER7

7U

SOC/EOC number 7

DL_ADC_SOC_NUMBER8

8U

SOC/EOC number 8

DL_ADC_SOC_NUMBER9

9U

SOC/EOC number 9

DL_ADC_SOC_NUMBER10

10U

SOC/EOC number 10

DL_ADC_SOC_NUMBER11

11U

SOC/EOC number 11

DL_ADC_SOC_NUMBER12

12U

SOC/EOC number 12

DL_ADC_SOC_NUMBER13

13U

SOC/EOC number 13

DL_ADC_SOC_NUMBER14

14U

SOC/EOC number 14

DL_ADC_SOC_NUMBER15

15U

SOC/EOC number 15

SOC/EOC number.

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).

enum DL_ADC_INT_NUMBER

Enumerator

Value

Description

DL_ADC_INT_NUMBER1

0U

ADCINT1 Interrupt

DL_ADC_INT_NUMBER2

1U

ADCINT2 Interrupt

DL_ADC_INT_NUMBER3

2U

ADCINT3 Interrupt

DL_ADC_INT_NUMBER4

3U

ADCINT4 Interrupt

ADC Interrupt number.

enum DL_ADC_DMAINT_NUMBER

Enumerator

Value

Description

DL_ADC_DMAINT_NUMBER1

0U

ADCDMAINT1 Interrupt

DL_ADC_DMAINT_NUMBER2

1U

ADCDMAINT2 Interrupt

DL_ADC_DMAINT_NUMBER3

2U

ADCDMAINT3 Interrupt

DL_ADC_DMAINT_NUMBER4

3U

ADCDMAINT4 Interrupt

ADC DMA Interrupt number.

enum DL_ADC_CHANNEL

Enumerator

Value

Description

DL_ADC_CH_ADCIN0

0U

single-ended, ADCIN0 is converted

DL_ADC_CH_ADCIN1

1U

single-ended, ADCIN1 is converted

DL_ADC_CH_ADCIN2

2U

single-ended, ADCIN2 is converted

DL_ADC_CH_ADCIN3

3U

single-ended, ADCIN3 is converted

DL_ADC_CH_ADCIN4

4U

single-ended, ADCIN4 is converted

DL_ADC_CH_ADCIN5

5U

single-ended, ADCIN5 is converted

DL_ADC_CH_ADCIN6

6U

single-ended, ADCIN6 is converted

DL_ADC_CH_ADCIN7

7U

single-ended, ADCIN7 is converted

DL_ADC_CH_ADCIN8

8U

single-ended, ADCIN8 is converted

DL_ADC_CH_ADCIN9

9U

single-ended, ADCIN9 is converted

DL_ADC_CH_ADCIN10

10U

single-ended, ADCIN10 is converted

DL_ADC_CH_ADCIN11

11U

single-ended, ADCIN11 is converted

DL_ADC_CH_ADCIN12

12U

single-ended, ADCIN12 is converted

DL_ADC_CH_ADCIN13

13U

single-ended, ADCIN13 is converted

DL_ADC_CH_ADCIN14

14U

single-ended, ADCIN14 is converted

DL_ADC_CH_ADCIN15

15U

single-ended, ADCIN15 is converted

DL_ADC_CH_ADCIN16

16U

single-ended, ADCIN16 is converted

DL_ADC_CH_ADCIN17

17U

single-ended, ADCIN17 is converted

DL_ADC_CH_ADCIN18

18U

single-ended, ADCIN18 is converted

DL_ADC_CH_ADCIN19

19U

single-ended, ADCIN19 is converted

DL_ADC_CH_ADCIN20

20U

single-ended, ADCIN20 is converted

DL_ADC_CH_ADCIN21

21U

single-ended, ADCIN21 is converted

DL_ADC_CH_ADCIN22

22U

single-ended, ADCIN22 is converted

DL_ADC_CH_ADCIN23

23U

single-ended, ADCIN23 is converted

DL_ADC_CH_ADCIN24

24U

single-ended, ADCIN24 is converted

DL_ADC_CH_ADCIN25

25U

single-ended, ADCIN25 is converted

DL_ADC_CH_ADCIN26

26U

single-ended, ADCIN26 is converted

DL_ADC_CH_ADCIN27

27U

single-ended, ADCIN27 is converted

DL_ADC_CH_ADCIN28

28U

single-ended, ADCIN28 is converted

DL_ADC_CH_ADCIN29

29U

single-ended, ADCIN29 is converted

DL_ADC_CH_ADCIN30

30U

single-ended, ADCIN30 is converted

DL_ADC_CH_ADCIN31

31U

single-ended, ADCIN31 is converted

ADC Channel.

This is the input pin on which the signal to be converted is located.

enum DL_ADC_SEQ_NUMBER

Enumerator

Value

Description

DL_ADC_SEQ_NUMBER1

0U

Sequencer number 1

DL_ADC_SEQ_NUMBER2

1U

Sequencer number 2

DL_ADC_SEQ_NUMBER3

2U

Sequencer number 3

DL_ADC_SEQ_NUMBER4

3U

Sequencer number 4

SEQ number.

enum DL_ADC_PPB_NUMBER

Enumerator

Value

Description

DL_ADC_PPB_NUMBER1

0U

Post-processing block 1

DL_ADC_PPB_NUMBER2

1U

Post-processing block 2

DL_ADC_PPB_NUMBER3

2U

Post-processing block 3

DL_ADC_PPB_NUMBER4

3U

Post-processing block 4

PPB number.

enum DL_ADC_PPB_LIMIT

Enumerator

Value

Description

DL_ADC_PPB_LIMIT_NIL

0U

No conversion is accumulated

DL_ADC_PPB_LIMIT_2

1U

2 conversions are accumulated

DL_ADC_PPB_LIMIT_4

2U

4 conversions are accumulated

DL_ADC_PPB_LIMIT_8

3U

8 conversions are accumulated

PPB Oversampling limit.

enum DL_ADC_PPB_SHIFT

Enumerator

Value

Description

DL_ADC_PPB_SHIFT_0

0U

No Right shift

DL_ADC_PPB_SHIFT_1

1U

PSUM is right shifted to 1. SUM = PSUM >> 1

DL_ADC_PPB_SHIFT_2

2U

PSUM is right shifted to 2. SUM = PSUM >> 2

DL_ADC_PPB_SHIFT_3

3U

PSUM is right shifted to 3. SUM = PSUM >> 3

DL_ADC_PPB_SHIFT_4

4U

PSUM is right shifted to 4. SUM = PSUM >> 4

DL_ADC_PPB_SHIFT_5

5U

PSUM is right shifted to 5. SUM = PSUM >> 5

DL_ADC_PPB_SHIFT_6

6U

PSUM is right shifted to 6. SUM = PSUM >> 6

DL_ADC_PPB_SHIFT_7

7U

PSUM is right shifted to 7. SUM = PSUM >> 7

PPB PSUM shift value.

enum DL_ADC_PPB_COMPSOURCE

Enumerator

Value

Description

DL_ADC_PPB_COMPSOURCE_RESULT

0U

PPB compare source is PPBRESULT

DL_ADC_PPB_COMPSOURCE_SUM

1U

PPB compare source is PPBSUM

PPB Compare source select.

enum DL_ADC_PPB_SYNC_INPUT

Enumerator

Value

Description

DL_ADC_SYNCIN_DISABLE

0U

ADC Syncin is DISABLE

DL_ADC_SYNCIN_INPUTXBAR5

1U

ADC Syncin is INPUTXBAR5

DL_ADC_SYNCIN_INPUTXBAR6

2U

ADC Syncin is INPUTXBAR6

DL_ADC_SYNCIN_ECAP0_SYNCOUT

3U

ADC Syncin is ECAP0_SYNCOUT

DL_ADC_SYNCIN_ECAP1_SYNCOUT

4U

ADC Syncin is ECAP1_SYNCOUT

DL_ADC_SYNCIN_MCPWM0_SYNCPER

5U

ADC Syncin is MCPWM0_SYNCPER

DL_ADC_SYNCIN_MCPWM1_SYNCPER

6U

ADC Syncin is MCPWM1_SYNCPER

DL_ADC_SYNCIN_MCPWM2_SYNCPER

7U

ADC Syncin is MCPWM2_SYNCPER

DL_ADC_SYNCIN_ECAP2_SYNCOUT

10U

ADC Syncin is ECAP2_SYNCOUT

DL_ADC_SYNCIN_EPWM0_SYNCPER

11U

ADC Syncin is EPWM0_SYNCPER

DL_ADC_SYNCIN_EPWM1_SYNCPER

12U

ADC Syncin is EPWM1_SYNCPER

DL_ADC_SYNCIN_EPWM2_SYNCPER

13U

ADC Syncin is EPWM2_SYNCPER

DL_ADC_SYNCIN_EPWM3_SYNCPER

14U

ADC Syncin is EPWM3_SYNCPER

DL_ADC_SYNCIN_EPWM4_SYNCPER

15U

ADC Syncin is EPWM4_SYNCPER

DL_ADC_SYNCIN_EPWM5_SYNCPER

16U

ADC Syncin is EPWM5_SYNCPER

DL_ADC_SYNCIN_ECAT_SYNC0

17U

ADC Syncin is ECAT_SYNC0

DL_ADC_SYNCIN_ECAT_SYNC1

18U

ADC Syncin is ECAT_SYNC1

PPB sync input.

enum DL_ADC_SEQ_PREEMPT

Enumerator

Value

Description

DL_ADC_SEQ_PREEMPT_DISABLE

0

SOC Sequence preempt is disabled

DL_ADC_SEQ_PREEMPT_ENABLE_NORESTART

2

SOC Sequence preempt is enabled but will not restart aborted sequence

DL_ADC_SEQ_PREEMPT_ENABLE_RESTART

3

SOC Sequence preempt is enabled and will restart aborted sequence

ADC SOC Seqeunce preemt.

enum DL_ADC_TRIGGER

Enumerator

Value

Description

DL_ADC_TRIGGER_SOFTWARE

0

DL_ADC_TRIGGER_TIMG4_0_GEN_EVENT0

1

DL_ADC_TRIGGER_TIMG12_0_GEN_EVENT0

2

DL_ADC_TRIGGER_INPUTXBAR5

3

DL_ADC_TRIGGER_MCPWM0_SOCA

4

DL_ADC_TRIGGER_MCPWM0_SOCB

5

DL_ADC_TRIGGER_MCPWM0_SOCC

6

DL_ADC_TRIGGER_MCPWM0_SOCD

7

DL_ADC_TRIGGER_MCPWM1_SOCA

8

DL_ADC_TRIGGER_MCPWM1_SOCB

9

DL_ADC_TRIGGER_MCPWM1_SOCC

10

DL_ADC_TRIGGER_MCPWM1_SOCD

11

DL_ADC_TRIGGER_MCPWM2_SOCA

12

DL_ADC_TRIGGER_MCPWM2_SOCB

13

DL_ADC_TRIGGER_MCPWM2_SOCC

14

DL_ADC_TRIGGER_MCPWM2_SOCD

15

DL_ADC_TRIGGER_ADC0_INT1

16

DL_ADC_TRIGGER_ADC1_INT1

17

DL_ADC_TRIGGER_ADC2_INT1

18

DL_ADC_TRIGGER_EPWM0_SOCA

19

DL_ADC_TRIGGER_EPWM0_SOCB

20

DL_ADC_TRIGGER_EPWM1_SOCA

21

DL_ADC_TRIGGER_EPWM1_SOCB

22

DL_ADC_TRIGGER_EPWM2_SOCA

23

DL_ADC_TRIGGER_EPWM2_SOCB

24

DL_ADC_TRIGGER_EPWM3_SOCA

25

DL_ADC_TRIGGER_EPWM3_SOCB

26

DL_ADC_TRIGGER_EPWM4_SOCA

27

DL_ADC_TRIGGER_EPWM4_SOCB

28

DL_ADC_TRIGGER_EPWM5_SOCA

29

DL_ADC_TRIGGER_EPWM5_SOCB

30

ADC Triggers.

This specifies the event that will trigger a conversion to start.

enum DL_ADC_SAMPLE_CAP_RESET_SELECT

Enumerator

Value

Description

DL_ADC_SAMPLE_CAP_RESET_SELECT_VREFLO

0

Sample Capacitor reset to Vreflo

DL_ADC_SAMPLE_CAP_RESET_SELECT_VREFHIBY2

1

Sample Capacitor reset to Vrefhi/2

Sample capacitor reset to either vrefhi/2 or vreflo.

Functions Documentation

function DL_ADC_enablePower

__STATIC_INLINE void DL_ADC_enablePower(
    ADC_Regs * adc
)

Enables power for the ADC module.

Parameters:

  • adc Pointer to the register overlay for the peripheral

The API enables the ADC module. To configure any ADC register, the ADC module should be enabled by setting the PWREN register with an appropriate KEY value.

function DL_ADC_disablePower

__STATIC_INLINE void DL_ADC_disablePower(
    ADC_Regs * adc
)

Disables power for the ADC module.

Parameters:

  • adc Pointer to the register overlay for the peripheral

The API disables the ADC module. This means that the ADC registers are not accessible for read/write operations.

function DL_ADC_isPowerEnabled

__STATIC_INLINE bool DL_ADC_isPowerEnabled(
    ADC_Regs * adc
)

Returns if power enable (PWREN) register for the ADC is enabled.

Parameters:

  • adc Pointer to the register overlay for the peripheral

Return:

  • true if power is enabled

  • false if power is disabled

function DL_ADC_reset

__STATIC_INLINE void DL_ADC_reset(
    ADC_Regs * adc
)

Resets ADC peripheral.

Parameters:

  • adc Pointer to the register overlay for the peripheral

function DL_ADC_isReset

__STATIC_INLINE bool DL_ADC_isReset(
    ADC_Regs * adc
)

Returns if ADC peripheral was reset.

Parameters:

  • adc Pointer to the register overlay for the peripheral

Return:

  • true if peripheral was reset

  • false if peripheral was not reset

function DL_ADC_isBusy

__STATIC_INLINE bool DL_ADC_isBusy(
    ADC_Regs * adc
)

Returns if ADC is busy and cannot sample another channel.

Parameters:

  • adc Pointer to the register overlay for the peripheral

Return:

  • true if ADC is busy sampling

  • false if all samples are complete and available to sample another channel

function DL_ADC_lastBusyChannel

__STATIC_INLINE uint32_t DL_ADC_lastBusyChannel(
    ADC_Regs * adc
)

Returns the current processing SOC or last converted SOC.

Parameters:

  • adc Pointer to the register overlay for the peripheral

Return: SOC number of the last busy or current processing channel (4 bit value)

function DL_ADC_powerUp

__STATIC_INLINE void DL_ADC_powerUp(
    ADC_Regs * adc
)

Powers up the analog-to-digital converter core.

Parameters:

  • adc Pointer to the register overlay for the peripheral

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.

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

function DL_ADC_powerDown

__STATIC_INLINE void DL_ADC_powerDown(
    ADC_Regs * adc
)

Powers down the analog-to-digital converter core.

Parameters:

  • adc Pointer to the register overlay for the peripheral

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

function DL_ADC_setInterruptPulseMode

__STATIC_INLINE void DL_ADC_setInterruptPulseMode(
    ADC_Regs * adc,
    DL_ADC_INT_PULSE_POS pulseMode
)

Sets interrupt pulse position.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • pulseMode is the pulse position you want to set, can be 0 or 1

This API 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 DL_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 DL_ADC_PULSE_END_OF_CONV into pulseMode).

function DL_ADC_setPrescaler

__STATIC_INLINE void DL_ADC_setPrescaler(
    ADC_Regs * adc,
    DL_ADC_CLK_PRESCALE clkPrescale
)

Sets clock prescaler value or clock divide ratio value.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • clkPrescale is the valid clock prescaler value you want to set to make the ADCCLK. DL_ADC_CLK_PRESCALE

function DL_ADC_enableContinuousMode

__STATIC_INLINE void DL_ADC_enableContinuousMode(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Enables continue mode for an ADC interrupt.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

The ADCINT 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.

function DL_ADC_disableContinuousMode

__STATIC_INLINE void DL_ADC_disableContinuousMode(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Disables continue mode for an ADC interrupt.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

The ADCINT pulses will not be generated for the specified ADC interrupt until the corresponding interrupt flag for the previous interrupt occurrence has been cleared using DL_ADC_clearInterruptStatus().

function DL_ADC_enableInterrupt

__STATIC_INLINE void DL_ADC_enableInterrupt(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Enables an ADC interrupt source.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

function DL_ADC_disableInterrupt

__STATIC_INLINE void DL_ADC_disableInterrupt(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Disables an ADC interrupt source.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

function DL_ADC_setInterruptSource

__STATIC_INLINE void DL_ADC_setInterruptSource(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum,
    DL_ADC_SOC_NUMBER intTrigger
)

Selects which EOC to be selected as a source for the interrupt.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

  • intTrigger is the interrupt trigger to be configured

function DL_ADC_enableDMAContinuousMode

__STATIC_INLINE void DL_ADC_enableDMAContinuousMode(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Enables continue mode for an ADC interrupt for DMA.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

The ADCDMAINT pulses will be generated for the specified ADC interrupt for DMA whenever an EOC pulse is generated irrespective of whether or not the flag bit is set.

function DL_ADC_disableDMAContinuousMode

__STATIC_INLINE void DL_ADC_disableDMAContinuousMode(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Disables continue mode for an ADC interrupt for DMA.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

The ADCDMAINT pulses will not be generated for the specified ADC interrupt for DMA until the corresponding interrupt flag for the previous interrupt occurrence has been cleared using DL_ADC_clearDMAInterruptStatus().

function DL_ADC_enableDMAInterrupt

__STATIC_INLINE void DL_ADC_enableDMAInterrupt(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Enables an ADC interrupt for DMA.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

function DL_ADC_disableDMAInterrupt

__STATIC_INLINE void DL_ADC_disableDMAInterrupt(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Disables an ADC interrupt for DMA.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

function DL_ADC_setDMAInterruptSource

__STATIC_INLINE void DL_ADC_setDMAInterruptSource(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum,
    DL_ADC_SOC_NUMBER intTrigger
)

Selects which EOC to be selected as a source for the DMA interrupt.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

  • intTrigger is the interrupt trigger to be configured

function DL_ADC_getRawInterruptStatus

__STATIC_INLINE bool DL_ADC_getRawInterruptStatus(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Returns the Raw ADC interrupt status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

Return:

  • true if Selected EOC event occured

  • false if Selected EOC event did not occur

This API returns the raw ADC interrupt status which indicates if the associated interrupt condition occured. This flag will be set irrespective of corresponding interrupt enable settings.

function DL_ADC_getRawDMAInterruptStatus

__STATIC_INLINE bool DL_ADC_getRawDMAInterruptStatus(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Returns the Raw ADC DMA interrupt status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

Return:

  • true if Selected EOC event occured

  • false if Selected EOC event did not occur

This API returns the raw ADC DMA interrupt status which indicates if the associated interrupt condition occured. This flag will be set irrespective of corresponding DMA interrupt enable settings.

function DL_ADC_getInterruptStatus

__STATIC_INLINE bool DL_ADC_getInterruptStatus(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Returns the current ADC interrupt status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

Return:

  • true if ADCINT pulse generated

  • false if ADCINT pulse not generated

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

function DL_ADC_getInterruptResultReadyStatus

__STATIC_INLINE bool DL_ADC_getInterruptResultReadyStatus(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Returns the result ready Flag Status for ADC interrupt.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

Return:

  • true if conversion results have latched

  • false if conversion results have not latched

The result ready flag is set when the conversion results associated with ADCINTx latch into the corresponding results register. This flag can be used in an ISR that is entered in early interrupt mode to ensure that the corresponding results are ready before proceeding to read the result register.

function DL_ADC_getDMAInterruptStatus

__STATIC_INLINE bool DL_ADC_getDMAInterruptStatus(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Returns the current ADC DMA Interrupt Flag status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

Return:

  • true if ADCDMAINT pulse generated

  • false if ADCDMAINT pulse not generated

function DL_ADC_forceInterruptStatus

__STATIC_INLINE void DL_ADC_forceInterruptStatus(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Force ADC interrupt flags status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

This API forces ADCINT flags in the ADCINTFLG and ADCRAWINTFLG registers.

function DL_ADC_forceDMAInterruptStatus

__STATIC_INLINE void DL_ADC_forceDMAInterruptStatus(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Force ADC DMA interrupt flag status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

This API forces ADCDMAINT flags in the ADCINTFLG and ADCRAWINTFLG registers.

function DL_ADC_clearInterruptStatus

__STATIC_INLINE void DL_ADC_clearInterruptStatus(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Clears ADC interrupt flag status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

This API clears the specified ADC interrupt status in ADCINTFLG, ADCRAWINTFLG registers so that they no longer assert. If not in continuous mode, this function must be called before any further interrupt pulses may occur. If software sets the clear bit on the same cycle that hardware is trying to set the flag it, then hardware has priority and the overflow bit will not be set.

function DL_ADC_clearDMAInterruptStatus

__STATIC_INLINE void DL_ADC_clearDMAInterruptStatus(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Clears ADC DMA interrupt flag status This API clears the specified ADC DMA interrupt status in ADCINTFLG, ADCRAWINTFLG registers so that they no longer assert. If software sets the clear bit on the same cycle that hardware is trying to set the flag it, then hardware has priority and the overflow bit will not be set.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

function DL_ADC_getInterruptOverflowStatus

__STATIC_INLINE bool DL_ADC_getInterruptOverflowStatus(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Returns Interrupt Overflow status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

Return:

  • true if ADC interrupt overflow flag for the specified interrupt is set

  • false if No ADC interrupt overflow flag is set

The interrupt overflow flag is set if an overflow occurred when generating ADCINT pulses. If the respective ADCINTFLG bit is set and a selected additional EOC trigger is generated, then an overflow condition occurs.

function DL_ADC_getDMAInterruptOverflowStatus

__STATIC_INLINE bool DL_ADC_getDMAInterruptOverflowStatus(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Returns DMA Interrupt Overflow status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

Return:

  • true if ADC DMA interrupt overflow flag for the specified interrupt is set

  • false if No ADC DMA interrupt overflow flag is set

The DMA interrupt overflow flag is set if an overflow occurred when generating ADCINT pulses. If the respective ADCINTFLG bit is set and a selected additional EOC trigger is generated, then an overflow condition occurs.

function DL_ADC_clearInterruptOverflowStatus

__STATIC_INLINE void DL_ADC_clearInterruptOverflowStatus(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER adcIntNum
)

Clears ADC interrupt overflow status flag.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

If software tries to clear the overflow in the same cycle that hardware tries to set the overflow, then hardware has priority.

function DL_ADC_clearDMAInterruptOverflowStatus

__STATIC_INLINE void DL_ADC_clearDMAInterruptOverflowStatus(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER adcIntNum
)

Clears ADC DMA interrupt overflow status flag.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • adcIntNum The interrupt number to be used

If software tries to clear the overflow in the same cycle that hardware tries to set the overflow, then hardware has priority.

function DL_ADC_getSOCStatus

__STATIC_INLINE bool DL_ADC_getSOCStatus(
    ADC_Regs * adc,
    DL_ADC_SOC_NUMBER socNumber
)

Returns Start of Conversion Status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • socNumber is the number of the start-of-conversion

Return:

  • true if no sample pending for SOC

  • false if trigger has been received and sample is pending for SOC

This Flag is set when Trigger has been received and sample is pending for SOCx. The Flag will be automatically cleared when the SOCx conversion is started where x is the soc number.

function DL_ADC_getSOCOverflowStatus

__STATIC_INLINE bool DL_ADC_getSOCOverflowStatus(
    ADC_Regs * adc,
    DL_ADC_SOC_NUMBER socNumber
)

Returns Start of Conversion Overflow Status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • socNumber is the number of the start-of-conversion

Return:

  • true if no SOC event overflow has occured

  • false if SOC event overflow has occured

This Flag is set, if an SOCx event was generated in hardware while an existing SOCx event was already penidng, where x is the soc number.

function DL_ADC_clearSOCOverflowStatus

__STATIC_INLINE void DL_ADC_clearSOCOverflowStatus(
    ADC_Regs * adc,
    DL_ADC_SOC_NUMBER socNumber
)

Clears Start of Conversion Overflow flag.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • socNumber is the number of the start-of-conversion

This API clears SOCx overflow flag. If software tries to set this bit on the same clock cycle that hardware tries to set the overflow bit in the register, then hardware has the priority and the register will be set.

function DL_ADC_selectSOCChannel

__STATIC_INLINE void DL_ADC_selectSOCChannel(
    ADC_Regs * adc,
    DL_ADC_SOC_NUMBER socNumber,
    DL_ADC_CHANNEL channel
)

Selects the channel to be converted.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • socNumber is the number of the start-of-conversion

  • channel is the number associated with the input signal.

This API slects the channel to be converted when the SOCx event is recieved by the ADC, where x is the soc number.

function DL_ADC_enableSOCComparator

__STATIC_INLINE void DL_ADC_enableSOCComparator(
    ADC_Regs * adc,
    DL_ADC_SOC_NUMBER socNumber
)

Enables SOC thrashold comparator.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • socNumber is the number of the start-of-conversion

function DL_ADC_disableSOCComparator

__STATIC_INLINE void DL_ADC_disableSOCComparator(
    ADC_Regs * adc,
    DL_ADC_SOC_NUMBER socNumber
)

Disables SOC thrashold comparator.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • socNumber is the number of the start-of-conversion

function DL_ADC_getPPBTripHighStatus

__STATIC_INLINE bool DL_ADC_getPPBTripHighStatus(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber
)

Returns PPB TRIP high status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

Return:

  • true if trip high event has occurred

  • false if trip high event has not occurred

The Flag is set, if the digital compare trip high event has occurred for PPBx, where x is the ppb number.

function DL_ADC_getPPBTripLowStatus

__STATIC_INLINE bool DL_ADC_getPPBTripLowStatus(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber
)

Returns PPB TRIP low status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

Return:

  • true if trip low event has occurred

  • false if trip low event has not occurred

The Flag is set, if the digital compare trip low event has occurred for PPBx, where x is the ppb number.

function DL_ADC_getPPBTripLimitStatus

__STATIC_INLINE bool DL_ADC_getPPBTripLimitStatus(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber
)

Returns PPB TRIP limit status.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

Return:

  • true if trip limit event has occurred

  • false if trip limit event has not occurred

The Flag is set, if the digital compare trip limit event has occurred in PPBx, where x is the ppb number.

function DL_ADC_clearPPBEventStatus

__STATIC_INLINE void DL_ADC_clearPPBEventStatus(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    uint32_t evtFlags
)

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • evtFlags Bit mask of the event source to be cleared. [DL_ADC_EVT].

@ brief Clears the corresponding PPB events in the ADCEVTSTAT register

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

function DL_ADC_enablePPBEvent

__STATIC_INLINE void DL_ADC_enablePPBEvent(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    uint32_t evtFlags
)

Enables individual ADC PPB event sources.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • evtFlags Bit mask of the event source to be enabled. [DL_ADC_EVT].

This API allows the specified PPB events to activate the event signal to the PWM blocks. The flag must be cleared before it can produce additional events to the PWM blocks.

function DL_ADC_disablePPBEvent

__STATIC_INLINE void DL_ADC_disablePPBEvent(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    uint32_t evtFlags
)

Disables individual ADC PPB event sources.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • evtFlags Bit mask of the event source to be disabled. [DL_ADC_EVT].

This API disables the specified PPB events from propagating to other modules.

function DL_ADC_enablePPBEventInterrupt

__STATIC_INLINE void DL_ADC_enablePPBEventInterrupt(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    uint32_t intFlags
)

Enables individual ADC PPB event interrupt sources.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • intFlags Bit mask of the event interrupt source to be enabled. [DL_ADC_EVT].

This API allows the specified PPB events to activate the event interrupt signal to the PIE. The flag must be cleared before it can produce additional interrupts to the PIE.

function DL_ADC_disablePPBEventInterrupt

__STATIC_INLINE void DL_ADC_disablePPBEventInterrupt(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    uint32_t intFlags
)

Disables individual ADC PPB event interrupt sources.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • intFlags Bit mask of the event interrupt source to be disabled. [DL_ADC_EVT].

This API allows the specified PPB events to activate the event interrupt signal to the PIE. The flag must be cleared before it can produce additional interrupts to the PIE.

function DL_ADC_getADCType

__STATIC_INLINE uint32_t DL_ADC_getADCType(
    ADC_Regs * adc
)

Returns ADC Type.

Parameters:

  • adc Pointer to the register overlay for the peripheral

Return: ADC Type number (8 bit value)

It is always set to 6 for ADC-12b.

function DL_ADC_getADCRevision

__STATIC_INLINE uint32_t DL_ADC_getADCRevision(
    ADC_Regs * adc
)

Returns ADC Revision.

Parameters:

  • adc Pointer to the register overlay for the peripheral

Return: ADC Revision number (24 bit value)

function DL_ADC_enablePPBEventCBCClear

__STATIC_INLINE void DL_ADC_enablePPBEventCBCClear(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber
)

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

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

This API enables automatic cycle-by-cycle clear of ADC PPB event flags. When enabled, the desired PPB event flags (ADCEVTSTAT) 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.

function DL_ADC_disablePPBEventCBCClear

__STATIC_INLINE void DL_ADC_disablePPBEventCBCClear(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber
)

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

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

This API 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.

function DL_ADC_setPPBTripHighLimit

__STATIC_INLINE void DL_ADC_setPPBTripHighLimit(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    uint16_t tripHiLimit
)

Sets the digital comparator trip high limit.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • tripHiLimit is the value of the digital comparator trip high limit.

This API sets the windowed trip high limits for a PPB. This value set the digital comparator so that when the value is exceeded, a high event will occur. When comparing to an ADCPPBxRESULT register, the upper bits TRIPHI[15:13] will be ignored.

function DL_ADC_setPPBTripLowLimit

__STATIC_INLINE void DL_ADC_setPPBTripLowLimit(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    uint16_t tripLoLimit
)

Sets the digital comparator trip low limit.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • tripLoLimit is the value of the digital comparator trip low limit.

This API sets the windowed trip low limits for a PPB if ADCPPB{#}TRIPLO.LIMITLO2EN = 1. This value set the digital comparator so that when the value is exceeded, a low event will occur. When comparing to an ADCPPBxRESULT register, the upper bits TRIPHI[15:13] will be ignored.

function DL_ADC_setInterruptCycleDelay

__STATIC_INLINE void DL_ADC_setInterruptCycleDelay(
    ADC_Regs * adc,
    uint8_t cycleDelay
)

Sets the timing of early interrupt generation.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • cycleDelay is the delay in terms of system clock cycles

This API configures the cycle delay between the negative edge of a sample pulse and an early interrupt pulse being generated. It only applies when early interrupt generation is enabled. That means the DL_ADC_setInterruptPulseMode() API’s pulseMode parameter is configured as DL_ADC_PULSE_END_OF_ACQ_WIN.

function DL_ADC_getADCWrapperType

__STATIC_INLINE uint32_t DL_ADC_getADCWrapperType(
    ADC_Regs * adc
)

Returns the ADC wrapper type.

Parameters:

  • adc Pointer to the register overlay for the peripheral

Return: ADC Wrapper Type (8 bit value)

It is always set to 6 for this ADC.

function DL_ADC_getADCWrapperRevision

__STATIC_INLINE uint32_t DL_ADC_getADCWrapperRevision(
    ADC_Regs * adc
)

Returns the ADC wrapper revision.

Parameters:

  • adc Pointer to the register overlay for the peripheral

Return: ADC Wrapper Revision version (24 bit value)

function DL_ADC_setPPBOversamplingLimit

__STATIC_INLINE void DL_ADC_setPPBOversamplingLimit(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    DL_ADC_PPB_LIMIT limit
)

Sets the oversampling limit.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • limit is the oversampling limit

This API configures the PPB oversampling count limit which defines the number of ADC conversions to accumulate before partial sum is automatically loaded to the sum registes.

function DL_ADC_readPPBPCount

__STATIC_INLINE uint32_t DL_ADC_readPPBPCount(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber
)

Reads the oversampling partial count.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

Return: Oversampled Partial Count (3 bit value)

The API returns the oversampled partial count. Each time a new result propagates through the PPB signal chain and accumulates into ADCPPB{#}PSUM, PPB{#}PCOUNT register is incremented by 1. The partial count result is available 1 SYSCLK cycle after the associated ADCPPB{#}RESULT is available. That means it will be 2 SYSCLK cycles after the associated ADCRESULT is available, unless multiple PPBs point to the same SOC.

function DL_ADC_setPPBShiftValue

__STATIC_INLINE void DL_ADC_setPPBShiftValue(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    DL_ADC_PPB_SHIFT shiftVal
)

Sets PPB shift value.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • shiftVal is the number of bits to right shift PPB PSUM

This API configures the shift value required to right shift the PPB PSUM before loading into the final PPB SUM.

function DL_ADC_selectPPBCompareSource

__STATIC_INLINE void DL_ADC_selectPPBCompareSource(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    DL_ADC_PPB_COMPSOURCE compSrc
)

Configures PPB compare source.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • compSrc is the desired source to be used for threshold compare.

This API configures the desired source to be used for threshold compare.

function DL_ADC_selectPPBSyncSource

__STATIC_INLINE void DL_ADC_selectPPBSyncSource(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    DL_ADC_PPB_SYNC_INPUT syncInSrc
)

Configures PPB Sync source.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

  • syncInSrc is the desired sync source to be used for PPB.

This API configures the desired sync source to be used for PPB.

function DL_ADC_readPPBPSum

__STATIC_INLINE uint32_t DL_ADC_readPPBPSum(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber
)

Reads the oversampled partial sum from the PPB.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

Return: Oversampling Partial Sum (16 bit value)

Each time a new result propagates through the PPB signal chain and latches into ADCPPB{#}RESULT, the result is subsequently accumulated into ADCPPB{#}PSUM register. This register is reset when either a count-match event occurs (PCOUNT = LIMIT) or PPB{#} receives a sync event.

function DL_ADC_setSeqEndSOC

__STATIC_INLINE void DL_ADC_setSeqEndSOC(
    ADC_Regs * adc,
    DL_ADC_SOC_NUMBER socNumber
)

Sets end SOC number of last enabled sequence.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • socNumber is the end SOC number of last enabled sequencer

function DL_ADC_setSeqPreemptMode

__STATIC_INLINE void DL_ADC_setSeqPreemptMode(
    ADC_Regs * adc,
    DL_ADC_SEQ_PREEMPT seqPreempt
)

Sets SOC sequence preempt and restart setting.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • seqPreempt selects whether to preempt and restart aborted Seqeunce or not

This API selects the sequencer whether to preempt and restart aborted Seqeunce.

function DL_ADC_setupSequencer

__STATIC_INLINE void DL_ADC_setupSequencer(
    ADC_Regs * adc,
    DL_ADC_SEQ_NUMBER seqNumber,
    uint32_t sampleWindow,
    DL_ADC_TRIGGER trigger,
    DL_ADC_SOC_NUMBER socStartNumber
)

Sets up the sequencer configurations.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

  • sampleWindow is acquisition window duration

  • trigger the source that will cause the SOC

  • socStartNumber is the beginning SOC of the sequencer

This API configures the sample window, trigger source and beginning SOC number of the sequencer.

The sample window is the acquisition window duration in SYSCLK cycles. 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. The sample window value is calculated based on the combination of ACQPS[7:6] and ACQPS[5:0], where ACQPS[7:6] determines scale and ACQPS[7:6] determines offset. If ACQPS[7:6] value is: “00” -> sample window = ACQPS[5:0] + 1 sysclk cycles “01” -> sample window = 64 + ((ACQPS[5:0] +1) * 2) sysclk cycles “10” -> sample window = 192 + ((ACQPS[5:0] +1) * 4) sysclk cycles “11” -> sample window = 448 + ((ACQPS[5:0] +1) * 16) sysclk cycles Based on the sampleWindow corresponding ACQPS value will be calculated and configured in ADCSOCxCTL register.

The trigger source specifies the event that causes the SOC such as software, a timer interrupt, an MCPWM event or an ADC interrupt. Based on the trigger, the SOCx flag in the ADCSOCFLG1 register will be set to initiate a conversion to start once priority is given to it.

The socStartNumber parameter specifies the which SOC number is the beginning SOC of the sequencer.

function DL_ADC_enableSequencer

__STATIC_INLINE void DL_ADC_enableSequencer(
    ADC_Regs * adc,
    DL_ADC_SEQ_NUMBER seqNumber
)

Enables the sequencer.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

function DL_ADC_disableSequencer

__STATIC_INLINE void DL_ADC_disableSequencer(
    ADC_Regs * adc,
    DL_ADC_SEQ_NUMBER seqNumber
)

Disables the sequencer.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

function DL_ADC_enableSampleCapReset

__STATIC_INLINE void DL_ADC_enableSampleCapReset(
    ADC_Regs * adc,
    DL_ADC_SEQ_NUMBER seqNumber
)

Enables the sample capacitor reset.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

This API enables the sample capacitor reset after each conversion.

function DL_ADC_disableSampleCapReset

__STATIC_INLINE void DL_ADC_disableSampleCapReset(
    ADC_Regs * adc,
    DL_ADC_SEQ_NUMBER seqNumber
)

Disables the sample capacitor reset.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

This API disables the sample capacitor reset after each conversion

function DL_ADC_selectSampleCAPResetValue

__STATIC_INLINE void DL_ADC_selectSampleCAPResetValue(
    ADC_Regs * adc,
    DL_ADC_SEQ_NUMBER seqNumber,
    DL_ADC_SAMPLE_CAP_RESET_SELECT capResetVal
)

Selects the sample capacitor reset value.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

  • capResetVal is used to select sample cap reset to either vrefhi/2 or vreflo

This API sets the sample capacitor to reset to either Vrefhi/2 or Vreflo after each conversion.

function DL_ADC_forceSequencer

__STATIC_INLINE void DL_ADC_forceSequencer(
    ADC_Regs * adc,
    DL_ADC_SEQ_NUMBER seqNumber
)

Forces a trigger to sequencer.

Parameters:

  • adc Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

This API forces a trigger to sequencer regardless of the value of hardware trigger.

function DL_ADC_readResult

__STATIC_INLINE uint16_t DL_ADC_readResult(
    ADC_RESULT_Regs * adcResult,
    DL_ADC_SOC_NUMBER socNumber
)

Reads the 12-bit ADC result.

Parameters:

  • adcResult Pointer to the register overlay for the peripheral

  • socNumber is the SOC number of the result

Return: ADC conversion result (16 bit value)

This API returns the ADC conversion result. If the oversampling is enabled, the API will returns the Final SUM of the specified number of samples.

function DL_ADC_readPPBResult

__STATIC_INLINE uint32_t DL_ADC_readPPBResult(
    ADC_RESULT_Regs * adcResult,
    DL_ADC_PPB_NUMBER ppbNumber
)

Reads the processed conversion result from the PPB.

Parameters:

  • adcResult Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

Return: The signed 13-bit PPB result

This API returns the processed conversion result. The results are available 1 SYSCLK cycle after the associated ADCRESULT is available, unless multiple PPBs point to the same SOC. In the case of multiple PPBs associated with the same SOC, the lowest numbered PPB’s result will be availble 1 SYSCLK cycle after the associated ADCRESULT and subsequent results (in order from lowest numbered PPB to highest) will each become available every 2-3 SYSCLK cycles.

function DL_ADC_readPPBSum

__STATIC_INLINE uint32_t DL_ADC_readPPBSum(
    ADC_RESULT_Regs * adcResult,
    DL_ADC_PPB_NUMBER ppbNumber
)

Returns the oversampling final sum result.

Parameters:

  • adcResult Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

Return: The signed 16-bit final oversampling sum result

This API returns the processed sum of results. The result is available 1 SYSCLK cycle after the associated ADCPPBRESULT is available. This will be 2 SYSCLK cycles after the associated ADCRESULT is available, unless multiple PPBs point to the same SOC.

function DL_ADC_readPPBCount

__STATIC_INLINE uint32_t DL_ADC_readPPBCount(
    ADC_RESULT_Regs * adcResult,
    DL_ADC_PPB_NUMBER ppbNumber
)

Returns the oversampling final count.

Parameters:

  • adcResult Pointer to the register overlay for the peripheral

  • ppbNumber is the number of the post-processing block

Return: The signed 4-bit final oversampling count value

This API returns the processed final count value. The result is available 1 SYSCLK cycle after the associated ADCPPBRESULT is available. This will be 2 SYSCLK cycles after the associated ADCRESULT is available, unless multiple PPBs point to the same SOC.

function DL_ADC_readSeqFIFOResult

__STATIC_INLINE uint32_t DL_ADC_readSeqFIFOResult(
    ADC_RESULT_Regs * adcResult,
    DL_ADC_SEQ_NUMBER seqNumber
)

Returns 32-bit FIFO result containing a pair of conversion results.

Parameters:

  • adcResult Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

Return: FIFO result consisting of 2 consequtive conversion results (32 bit value)

This API returns the conversion result of all SOCs associated with the sequencer in a sequential manner through FIFO mode. Since the Result registers are maximum 16-bits wide, every read will return RESULT corresponding to 2 consecutive SOCs. LSB 16-bits [15:0] will contain odd results {1,3,5,7…}, and MSB 16-bits [31:16] will contain even results {2,4,6,8…}. If odd number of SOCs are associated with a sequencer, final read will have 16’h0 in the MSB 16-bits [31:16]. For Example, if SEQ1 – Start: SOC0, End: SOC2 First read will return SOC0’s result in LSB 16-bits [15:0] and soc1’s result in MSB 16-bits [31:16] Second read will return SOC2’s result in LSB 16-bits [15:0] and 16’h0 in MSB 16-bits [31:16].

function DL_ADC_isSeqFIFOValid

__STATIC_INLINE bool DL_ADC_isSeqFIFOValid(
    ADC_RESULT_Regs * adcResult,
    DL_ADC_SEQ_NUMBER seqNumber
)

Returns the status of FIFO conversions for a given sequencer.

Parameters:

  • adcResult Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

Return:

  • true if conversion from all the SOCs associated with the Sequencer are complete and result is available to be read

  • false if all conversions associated with the current Sequencer are NOT complete.

This API can be used to check if conversion from all the SOCs associated with the Sequencer are complete and result is available to be read.

function DL_ADC_getPendingReads

__STATIC_INLINE uint32_t DL_ADC_getPendingReads(
    ADC_RESULT_Regs * adcResult,
    DL_ADC_SEQ_NUMBER seqNumber
)

Returns the number of pending reads in the FIFO.

Parameters:

  • adcResult Pointer to the register overlay for the peripheral

  • seqNumber is the sequencer number

Return: number of pending reads (4 bit value)

Note: -This field is only updated when after the last byte of ADCSEQ{#}FIFORESULT is read. -The Pending read information will not be updated for debug reads. -Once all the data in the FIFO has been read, FIFO will wrap back. Subsequent reads will read from the beginning of the FIFO.

function DL_ADC_initParamsSetDefault

void DL_ADC_initParamsSetDefault(
    DL_ADC_Config * config
)

Initializes the ADC configuration parameters.

Parameters:

  • config Pointer to the ADC configuration structure.

This function initializes all the parameters of the ADC configuration structure to their default values.

function DL_ADC_init

void DL_ADC_init(
    ADC_Regs * adc,
    DL_ADC_Config * config
)

Initializes the ADC module.

Parameters:

  • adc Pointer to the ADC register overlay

  • config Pointer to the ADC configuration structure

This function configures the ADC module according to the provided configuration.

function DL_ADC_socInit

void DL_ADC_socInit(
    ADC_Regs * adc,
    DL_ADC_SOC_NUMBER socNumber,
    DL_ADC_SocConfig * socConfig
)

Initializes the SOC submodule of ADC.

Parameters:

  • adc Pointer to the ADC register overlay

  • socNumber SOC number

  • socConfig Pointer to the SOC configurations structure.

This function configures the SOC submodule according to the provided configuration.

function DL_ADC_ppbInit

void DL_ADC_ppbInit(
    ADC_Regs * adc,
    DL_ADC_PPB_NUMBER ppbNumber,
    DL_ADC_PpbConfig * ppbConfig
)

Initializes the PPB submodule of ADC.

Parameters:

  • adc Pointer to the ADC register overlay

  • ppbNumber PPB number

  • ppbConfig Pointer to the PPB configurations structure.

This function configures the PPB submodule according to the provided configuration.

function DL_ADC_interruptInit

void DL_ADC_interruptInit(
    ADC_Regs * adc,
    DL_ADC_INT_NUMBER intNumber,
    DL_ADC_IntNConfig * intNConfig
)

Initializes the interrupt block submodule of ADC.

Parameters:

  • adc Pointer to the ADC register overlay

  • intNumber Interrupt block number

  • intNConfig Pointer to the interrupt block configurations structure.

This function configures the interrupt block submodule according to the provided configuration.

function DL_ADC_dmaInterruptInit

void DL_ADC_dmaInterruptInit(
    ADC_Regs * adc,
    DL_ADC_DMAINT_NUMBER dmaIntNumber,
    DL_ADC_IntNConfig * dmaIntNConfig
)

Initializes the DMA interrupt block submodule of ADC.

Parameters:

  • adc Pointer to the ADC register overlay

  • dmaIntNumber DMA interrupt block number

  • dmaIntNConfig Pointer to the DMA interrupt block configurations structure.

This function configures the DMA interrupt block submodule according to the provided configuration.

function DL_ADC_sequencerInit

void DL_ADC_sequencerInit(
    ADC_Regs * adc,
    DL_ADC_SEQ_NUMBER seqNumber,
    DL_ADC_SeqNConfig * seqNConfig
)

Initializes the sequencer submodule of ADC.

Parameters:

  • adc Pointer to the ADC register overlay

  • seqNumber Sequencer number

  • seqNConfig Pointer to the sequencer configurations structure.

This function configures the sequencer submodule according to the provided configuration.

Macros Documentation

define DL_ADC_EVT_TRIPHI

#define DL_ADC_EVT_TRIPHI 1U

ADC PPB Trip High Event.

define DL_ADC_EVT_TRIPLO

#define DL_ADC_EVT_TRIPLO 2U

ADC PPB Trip Low Event.

define DL_ADC_EVT_NLIMIT

#define DL_ADC_EVT_NLIMIT 8U

ADC PPB Within Trip limit Event.

define DL_ADCSOCCTL_STEP

#define DL_ADCSOCCTL_STEP (ADC_ADCSOC1CTL - ADC_ADCSOC0CTL)

Step size between SOCxCTL registers.

define DL_ADCPPBCONFIG_STEP

#define DL_ADCPPBCONFIG_STEP (ADC_ADCPPB2CONFIG - ADC_ADCPPB1CONFIG)

Step size between ADCPPBxCONFIG registers.

define DL_ADCPPBLIMIT_STEP

#define DL_ADCPPBLIMIT_STEP (ADC_ADCPPB2LIMIT - ADC_ADCPPB1LIMIT)

Step size between ADCPPBxLIMIT registers.

define DL_ADCPPBPCOUNT_STEP

#define DL_ADCPPBPCOUNT_STEP (ADC_ADCPPB2PCOUNT - ADC_ADCPPB1PCOUNT)

Step size between ADCPPBxPCOUNT registers.

define DL_ADCPPBCONFIG2_STEP

#define DL_ADCPPBCONFIG2_STEP (ADC_ADCPPB2CONFIG2 - ADC_ADCPPB1CONFIG2)

Step size between ADCPPBxCONFIG2 registers.

define DL_ADCPPBPSUM_STEP

#define DL_ADCPPBPSUM_STEP (ADC_ADCPPB2PSUM - ADC_ADCPPB1PSUM)

Step size between ADCPPBxPSUM registers.

define DL_ADCSEQCONFIG_STEP

#define DL_ADCSEQCONFIG_STEP (ADC_ADCSEQ2CONFIG - ADC_ADCSEQ1CONFIG)

Step size between ADCSEQxCONFIG registers.

define DL_ADCRESULT_STEP

#define DL_ADCRESULT_STEP (ADC_ADCRESULT1 - ADC_ADCRESULT0)

Step size between ADCRESULTx registers.

define DL_ADCPPBRESULT_STEP

#define DL_ADCPPBRESULT_STEP (ADC_ADCPPB2RESULT - ADC_ADCPPB1RESULT)

Step size between ADCPPBxRESULT registers.

define DL_ADCPPBSUM_STEP

#define DL_ADCPPBSUM_STEP (ADC_ADCPPB2SUM - ADC_ADCPPB1SUM)

Step size between ADCPPBxSUM registers.

define DL_ADCPPBCOUNT_STEP

#define DL_ADCPPBCOUNT_STEP (ADC_ADCPPB2COUNT - ADC_ADCPPB1COUNT)

Step size between ADCPPBxCOUNT registers.

define DL_ADCSEQ_FIFORESULT_STEP

#define DL_ADCSEQ_FIFORESULT_STEP (ADC_ADCSEQ2FIFORESULT - ADC_ADCSEQ1FIFORESULT)

Step size between ADCSEQx FIFO Result registers.

define DL_ADCSEQ_FIFOSTATUS_STEP

#define DL_ADCSEQ_FIFOSTATUS_STEP (ADC_ADCSEQ2FIFOSTATUS - ADC_ADCSEQ1FIFOSTATUS)

Step size between ADCSEQx FIFO Status registers.

define DL_SAMPLEWINDOW_MAX

#define DL_SAMPLEWINDOW_MAX 1472

maximum value of sample window

define DL_SAMPLEWINDOW_MIN

#define DL_SAMPLEWINDOW_MIN 1

minimum value of sample window

define DL_CYCLE_DELAY_MAX

#define DL_CYCLE_DELAY_MAX 63

maximum value of delay for early interrupt generation