MSPM0C110X Driver Library  2.05.00.05
Modules | Data Structures | Macros | Enumerations | Functions
Analog to Digital Converter (ADC12)
Collaboration diagram for Analog to Digital Converter (ADC12):

Modules

 DL_ADC12_SEQ_END_ADDR
 
 DL_ADC12_SEQ_START_ADDR
 
 DL_ADC12_SAMP_MODE
 
 DL_ADC12_HW_AVG_NUM
 
 DL_ADC12_HW_AVG_DEN
 
 DL_ADC12_POWER_DOWN_MODE
 
 DL_ADC12_INPUT_CHAN
 
 DL_ADC12_REFERENCE_VOLTAGE
 
 DL_ADC12_SAMPLE_TIMER_SOURCE
 
 DL_ADC12_AVERAGING_MODE
 
 DL_ADC12_BURN_OUT_SOURCE
 
 DL_ADC12_TRIGGER_MODE
 
 DL_ADC12_WINDOWS_COMP_MODE
 
 DL_ADC12_STATUS_CONVERSION
 
 DL_ADC12_STATUS_REFERENCE
 
 DL_ADC12_INTERRUPTS
 
 DL_ADC12_EVENT
 
 DL_ADC12_DMA
 

Data Structures

struct  DL_ADC12_ClockConfig
 Configuration struct for DL_ADC12_setClockConfig. More...
 

Macros

#define DL_ADC12_SVT_OFFSET   ((uint32_t)0x555000 >> (uint32_t)2)
 This is an internal macro is used to resolve the offset to ADC12 SVT. More...
 

Enumerations

enum  DL_ADC12_MEM_IDX {
  DL_ADC12_MEM_IDX_0 = 0,
  DL_ADC12_MEM_IDX_1 = 1,
  DL_ADC12_MEM_IDX_2 = 2,
  DL_ADC12_MEM_IDX_3 = 3,
  DL_ADC12_MEM_IDX_4 = 4,
  DL_ADC12_MEM_IDX_5 = 5,
  DL_ADC12_MEM_IDX_6 = 6,
  DL_ADC12_MEM_IDX_7 = 7,
  DL_ADC12_MEM_IDX_8 = 8,
  DL_ADC12_MEM_IDX_9 = 9,
  DL_ADC12_MEM_IDX_10 = 10,
  DL_ADC12_MEM_IDX_11 = 11
}
 
enum  DL_ADC12_REPEAT_MODE {
  DL_ADC12_REPEAT_MODE_ENABLED = ADC12_CTL1_CONSEQ_REPEATSINGLE,
  DL_ADC12_REPEAT_MODE_DISABLED = ADC12_CTL1_CONSEQ_SINGLE
}
 
enum  DL_ADC12_SAMPLING_SOURCE {
  DL_ADC12_SAMPLING_SOURCE_AUTO = ADC12_CTL1_SAMPMODE_AUTO,
  DL_ADC12_SAMPLING_SOURCE_MANUAL = ADC12_CTL1_SAMPMODE_MANUAL
}
 
enum  DL_ADC12_TRIG_SRC {
  DL_ADC12_TRIG_SRC_SOFTWARE = ADC12_CTL1_TRIGSRC_SOFTWARE,
  DL_ADC12_TRIG_SRC_EVENT = ADC12_CTL1_TRIGSRC_EVENT
}
 
enum  DL_ADC12_SAMP_CONV_RES {
  DL_ADC12_SAMP_CONV_RES_12_BIT = ADC12_CTL2_RES_BIT_12,
  DL_ADC12_SAMP_CONV_RES_10_BIT = ADC12_CTL2_RES_BIT_10,
  DL_ADC12_SAMP_CONV_RES_8_BIT = ADC12_CTL2_RES_BIT_8
}
 
enum  DL_ADC12_SAMP_CONV_DATA_FORMAT {
  DL_ADC12_SAMP_CONV_DATA_FORMAT_UNSIGNED = ADC12_CTL2_DF_UNSIGNED,
  DL_ADC12_SAMP_CONV_DATA_FORMAT_SIGNED = ADC12_CTL2_DF_SIGNED
}
 
enum  DL_ADC12_IIDX {
  DL_ADC12_IIDX_OVERFLOW = ADC12_CPU_INT_IIDX_STAT_OVIFG,
  DL_ADC12_IIDX_TRIG_OVERFLOW = ADC12_CPU_INT_IIDX_STAT_TOVIFG,
  DL_ADC12_IIDX_WINDOW_COMP_HIGH = ADC12_CPU_INT_IIDX_STAT_HIGHIFG,
  DL_ADC12_IIDX_WINDOW_COMP_LOW = ADC12_CPU_INT_IIDX_STAT_LOWIFG,
  DL_ADC12_IIDX_INIFG = ADC12_CPU_INT_IIDX_STAT_INIFG,
  DL_ADC12_IIDX_DMA_DONE = ADC12_CPU_INT_IIDX_STAT_DMADONE,
  DL_ADC12_IIDX_UNDERFLOW = ADC12_CPU_INT_IIDX_STAT_UVIFG,
  DL_ADC12_IIDX_MEM0_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG0,
  DL_ADC12_IIDX_MEM1_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG1,
  DL_ADC12_IIDX_MEM2_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG2,
  DL_ADC12_IIDX_MEM3_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG3,
  DL_ADC12_IIDX_MEM4_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG4,
  DL_ADC12_IIDX_MEM5_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG5,
  DL_ADC12_IIDX_MEM6_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG6,
  DL_ADC12_IIDX_MEM7_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG7,
  DL_ADC12_IIDX_MEM8_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG8,
  DL_ADC12_IIDX_MEM9_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG9,
  DL_ADC12_IIDX_MEM10_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG10,
  DL_ADC12_IIDX_MEM11_RESULT_LOADED = ADC12_CPU_INT_IIDX_STAT_MEMRESIFG11
}
 
enum  DL_ADC12_CLOCK {
  DL_ADC12_CLOCK_SYSOSC = ADC12_CLKCFG_SAMPCLK_SYSOSC,
  DL_ADC12_CLOCK_ULPCLK = ADC12_CLKCFG_SAMPCLK_ULPCLK,
  DL_ADC12_CLOCK_HFCLK = ADC12_CLKCFG_SAMPCLK_HFCLK
}
 
enum  DL_ADC12_CLOCK_DIVIDE {
  DL_ADC12_CLOCK_DIVIDE_1 = ADC12_CTL0_SCLKDIV_DIV_BY_1,
  DL_ADC12_CLOCK_DIVIDE_2 = ADC12_CTL0_SCLKDIV_DIV_BY_2,
  DL_ADC12_CLOCK_DIVIDE_4 = ADC12_CTL0_SCLKDIV_DIV_BY_4,
  DL_ADC12_CLOCK_DIVIDE_8 = ADC12_CTL0_SCLKDIV_DIV_BY_8,
  DL_ADC12_CLOCK_DIVIDE_16 = ADC12_CTL0_SCLKDIV_DIV_BY_16,
  DL_ADC12_CLOCK_DIVIDE_24 = ADC12_CTL0_SCLKDIV_DIV_BY_24,
  DL_ADC12_CLOCK_DIVIDE_32 = ADC12_CTL0_SCLKDIV_DIV_BY_32,
  DL_ADC12_CLOCK_DIVIDE_48 = ADC12_CTL0_SCLKDIV_DIV_BY_48
}
 
enum  DL_ADC12_CLOCK_FREQ_RANGE {
  DL_ADC12_CLOCK_FREQ_RANGE_1_TO_4 = ADC12_CLKFREQ_FRANGE_RANGE1TO4,
  DL_ADC12_CLOCK_FREQ_RANGE_4_TO_8 = ADC12_CLKFREQ_FRANGE_RANGE4TO8,
  DL_ADC12_CLOCK_FREQ_RANGE_8_TO_16 = ADC12_CLKFREQ_FRANGE_RANGE8TO16,
  DL_ADC12_CLOCK_FREQ_RANGE_16_TO_20 = ADC12_CLKFREQ_FRANGE_RANGE16TO20,
  DL_ADC12_CLOCK_FREQ_RANGE_20_TO_24 = ADC12_CLKFREQ_FRANGE_RANGE20TO24,
  DL_ADC12_CLOCK_FREQ_RANGE_24_TO_32 = ADC12_CLKFREQ_FRANGE_RANGE24TO32,
  DL_ADC12_CLOCK_FREQ_RANGE_32_TO_40 = ADC12_CLKFREQ_FRANGE_RANGE32TO40,
  DL_ADC12_CLOCK_FREQ_RANGE_40_TO_48 = ADC12_CLKFREQ_FRANGE_RANGE40TO48
}
 

Functions

__STATIC_INLINE void DL_ADC12_enablePower (ADC12_Regs *adc12)
 Enables the Peripheral Write Enable (PWREN) register for the ADC12. More...
 
__STATIC_INLINE void DL_ADC12_disablePower (ADC12_Regs *adc12)
 Disables the Peripheral Write Enable (PWREN) register for the ADC12. More...
 
__STATIC_INLINE bool DL_ADC12_isPowerEnabled (const ADC12_Regs *adc12)
 Returns if the Peripheral Write Enable (PWREN) register for the ADC12 is enabled. More...
 
__STATIC_INLINE void DL_ADC12_reset (ADC12_Regs *adc12)
 Resets adc12 peripheral. More...
 
__STATIC_INLINE bool DL_ADC12_isReset (const ADC12_Regs *adc12)
 Returns if adc12 peripheral was reset. More...
 
__STATIC_INLINE void DL_ADC12_initSingleSample (ADC12_Regs *adc12, uint32_t repeatMode, uint32_t sampleMode, uint32_t trigSrc, uint32_t resolution, uint32_t dataFormat)
 Initializes ADC12 for single sampling mode operation. This initialization configures MEMCTL0 as the default memory control register for the conversion. If the conversion needs use a different memory control register the user can call DL_ADC12_setStartAddress to specify a different control register. More...
 
__STATIC_INLINE void DL_ADC12_setStartAddress (ADC12_Regs *adc12, uint32_t startAdd)
 Sets the start address for ADC conversion. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getStartAddress (const ADC12_Regs *adc12)
 Gets start address for ADC conversion. More...
 
__STATIC_INLINE void DL_ADC12_setEndAddress (ADC12_Regs *adc12, uint32_t endAdd)
 Sets the end address for ADC conversion. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getEndAddress (const ADC12_Regs *adc12)
 Gets end address for ADC conversion. More...
 
__STATIC_INLINE void DL_ADC12_initSeqSample (ADC12_Regs *adc12, uint32_t repeatMode, uint32_t sampleMode, uint32_t trigSrc, uint32_t startAdd, uint32_t endAdd, uint32_t resolution, uint32_t dataFormat)
 Initializes ADC12 for sequence sampling mode operation. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getResolution (const ADC12_Regs *adc12)
 Returns ADC12 resolution. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getDataFormat (const ADC12_Regs *adc12)
 Returns ADC12 data format. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getSamplingSource (const ADC12_Regs *adc12)
 Returns ADC12 sampling source. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getSampleMode (const ADC12_Regs *adc12)
 Returns ADC12 sampling mode. More...
 
__STATIC_INLINE DL_ADC12_TRIG_SRC DL_ADC12_getTriggerSource (const ADC12_Regs *adc12)
 Returns ADC12 trigger mode. More...
 
__STATIC_INLINE void DL_ADC12_startConversion (ADC12_Regs *adc12)
 Start ADC12 conversion. More...
 
__STATIC_INLINE void DL_ADC12_stopConversion (ADC12_Regs *adc12)
 Stop ADC12 conversion. More...
 
__STATIC_INLINE bool DL_ADC12_isConversionStarted (const ADC12_Regs *adc12)
 Check if ADC12 conversion is started. More...
 
__STATIC_INLINE void DL_ADC12_enableDMA (ADC12_Regs *adc12)
 Enables DMA for data transfer. More...
 
__STATIC_INLINE void DL_ADC12_disableDMA (ADC12_Regs *adc12)
 Disables DMA for data transfer. More...
 
__STATIC_INLINE bool DL_ADC12_isDMAEnabled (const ADC12_Regs *adc12)
 Check if DMA is enabled. More...
 
__STATIC_INLINE void DL_ADC12_setDMASamplesCnt (ADC12_Regs *adc12, uint8_t sampCnt)
 Set number of ADC results to be transfer on a DMA trigger. More...
 
__STATIC_INLINE uint8_t DL_ADC12_getDMASampleCnt (const ADC12_Regs *adc12)
 Get number of ADC results to be transfer on a DMA trigger. More...
 
__STATIC_INLINE void DL_ADC12_enableFIFO (ADC12_Regs *adc12)
 Enables FIFO mode. More...
 
__STATIC_INLINE void DL_ADC12_disableFIFO (ADC12_Regs *adc12)
 Disables FIFO mode. More...
 
__STATIC_INLINE bool DL_ADC12_isFIFOEnabled (const ADC12_Regs *adc12)
 Checks if FIFO mode is enabled. More...
 
void DL_ADC12_setClockConfig (ADC12_Regs *adc12, const DL_ADC12_ClockConfig *config)
 Configures ADC12 sample clock divider and sample clock frequency range. More...
 
void DL_ADC12_getClockConfig (const ADC12_Regs *adc12, DL_ADC12_ClockConfig *config)
 Returns ADC12 sample clock configuration. More...
 
__STATIC_INLINE void DL_ADC12_setPowerDownMode (ADC12_Regs *adc12, uint32_t powerDownMode)
 Configures ADC12 power down mode. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getPowerDownMode (const ADC12_Regs *adc12)
 Returns ADC power down mode. More...
 
__STATIC_INLINE void DL_ADC12_enableConversions (ADC12_Regs *adc12)
 Enable ADC12 conversion. More...
 
__STATIC_INLINE void DL_ADC12_disableConversions (ADC12_Regs *adc12)
 Disable ADC12 conversion. More...
 
__STATIC_INLINE bool DL_ADC12_isConversionsEnabled (const ADC12_Regs *adc12)
 Check if ADC12 conversion is enabled. More...
 
__STATIC_INLINE void DL_ADC12_configHwAverage (ADC12_Regs *adc12, uint32_t numerator, uint32_t denominator)
 Configure ADC12 hardware average. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getHwAverageConfig (const ADC12_Regs *adc12)
 Return the hardware average configuration. More...
 
__STATIC_INLINE void DL_ADC12_setSampleTime0 (ADC12_Regs *adc12, uint16_t adcclks)
 Set sample time 0. More...
 
__STATIC_INLINE uint16_t DL_ADC12_getSampleTime0 (const ADC12_Regs *adc12)
 Get sample time 0. More...
 
__STATIC_INLINE void DL_ADC12_setSampleTime1 (ADC12_Regs *adc12, uint16_t adcclks)
 Set sample time 1. More...
 
__STATIC_INLINE uint16_t DL_ADC12_getSampleTime1 (const ADC12_Regs *adc12)
 Get sample time 1. More...
 
__STATIC_INLINE void DL_ADC12_configWinCompLowThld (ADC12_Regs *adc12, uint16_t threshold)
 Configures window comparator low threshold. More...
 
__STATIC_INLINE void DL_ADC12_configWinCompHighThld (ADC12_Regs *adc12, uint16_t threshold)
 Configures window comparator high threshold. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getFIFOData (const ADC12_Regs *adc12)
 Returns the data from the top of FIFO. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getFIFOAddress (const ADC12_Regs *adc12)
 Returns the address of FIFO data register. More...
 
__STATIC_INLINE void DL_ADC12_configConversionMem (ADC12_Regs *adc12, DL_ADC12_MEM_IDX idx, uint32_t chansel, uint32_t vref, uint32_t stime, uint32_t avgen, uint32_t bcsen, uint32_t trig, uint32_t wincomp)
 Configures conversion memory. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getConversionMemConfig (const ADC12_Regs *adc12, DL_ADC12_MEM_IDX idx)
 Returns conversion memory configuration. More...
 
__STATIC_INLINE uint16_t DL_ADC12_getMemResult (const ADC12_Regs *adc12, DL_ADC12_MEM_IDX idx)
 Returns the conversion result for the selected memory index. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getMemResultAddress (const ADC12_Regs *adc12, DL_ADC12_MEM_IDX idx)
 Returns the conversion result memory address. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getStatus (const ADC12_Regs *adc12)
 Returns ADC12 status. More...
 
__STATIC_INLINE void DL_ADC12_disableForcingSYSOSCOnInRunMode (ADC12_Regs *adc12)
 Allows SYSOSC to not run at base frequency when device is in RUN mode. More...
 
__STATIC_INLINE void DL_ADC12_forceSYSOSCOnInRunMode (ADC12_Regs *adc12)
 Forces SYSOSC to run at base frequency when device is in RUN mode. More...
 
__STATIC_INLINE void DL_ADC12_disableForcingSYSOSCOnInStopMode (ADC12_Regs *adc12)
 Allows SYSOSC to not run at base frequency when device is in STOP mode. More...
 
__STATIC_INLINE void DL_ADC12_forceSYSOSCOnInStopMode (ADC12_Regs *adc12)
 Forces SYSOSC to run at base frequency when device is in STOP mode. More...
 
__STATIC_INLINE void DL_ADC12_enableInterrupt (ADC12_Regs *adc12, uint32_t interruptMask)
 Enable ADC12 interrupt. More...
 
__STATIC_INLINE void DL_ADC12_disableInterrupt (ADC12_Regs *adc12, uint32_t interruptMask)
 Disable ADC12 interrupt. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getEnabledInterrupts (const ADC12_Regs *adc12, uint32_t interruptMask)
 Check which ADC12 interrupts are enabled. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getEnabledInterruptStatus (const ADC12_Regs *adc12, uint32_t interruptMask)
 Check interrupt flag of enabled ADC12 interrupt. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getRawInterruptStatus (const ADC12_Regs *adc12, uint32_t interruptMask)
 Check interrupt flag of any ADC12 interrupt. More...
 
__STATIC_INLINE DL_ADC12_IIDX DL_ADC12_getPendingInterrupt (const ADC12_Regs *adc12)
 Get highest priority pending ADC12 interrupt. More...
 
__STATIC_INLINE void DL_ADC12_clearInterruptStatus (ADC12_Regs *adc12, uint32_t interruptMask)
 Clear pending ADC12 interrupt. More...
 
__STATIC_INLINE void DL_ADC12_setPublisherChanID (ADC12_Regs *adc12, uint8_t chanID)
 Sets the event publisher channel id. More...
 
__STATIC_INLINE uint8_t DL_ADC12_getPublisherChanID (const ADC12_Regs *adc12)
 Gets the event publisher channel id. More...
 
__STATIC_INLINE void DL_ADC12_setSubscriberChanID (ADC12_Regs *adc12, uint8_t chanID)
 Sets the event subscriber channel id. More...
 
__STATIC_INLINE uint8_t DL_ADC12_getSubscriberChanID (const ADC12_Regs *adc12)
 Gets the event subscriber channel id. More...
 
__STATIC_INLINE void DL_ADC12_enableEvent (ADC12_Regs *adc12, uint32_t eventMask)
 Enable ADC12 event. More...
 
__STATIC_INLINE void DL_ADC12_disableEvent (ADC12_Regs *adc12, uint32_t eventMask)
 Disable ADC12 event. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getEnabledEvents (const ADC12_Regs *adc12, uint32_t eventMask)
 Check which adc12 dma triggers are enabled. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getEnabledEventStatus (const ADC12_Regs *adc12, uint32_t eventMask)
 Check event flag of enabled adc12 event. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getRawEventsStatus (const ADC12_Regs *adc12, uint32_t eventMask)
 Check event flag of any adc12 event. More...
 
__STATIC_INLINE void DL_ADC12_clearEventsStatus (ADC12_Regs *adc12, uint32_t eventMask)
 Clear pending adc12 events. More...
 
__STATIC_INLINE void DL_ADC12_enableDMATrigger (ADC12_Regs *adc12, uint32_t dmaMask)
 Enable ADC12 DMA triggers. More...
 
__STATIC_INLINE void DL_ADC12_disableDMATrigger (ADC12_Regs *adc12, uint32_t dmaMask)
 Disable ADC12 DMA triggers. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getEnabledDMATrigger (const ADC12_Regs *adc12, uint32_t dmaMask)
 Check which adc12 DMA triggers are enabled. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getEnabledDMATriggerStatus (const ADC12_Regs *adc12, uint32_t dmaMask)
 Check event flag of enabled adc12 DMA triggers. More...
 
__STATIC_INLINE uint32_t DL_ADC12_getRawDMATriggerStatus (const ADC12_Regs *adc12, uint32_t dmaMask)
 Check DMA triggers flag of any adc12 dma trigger. More...
 
__STATIC_INLINE void DL_ADC12_clearDMATriggerStatus (ADC12_Regs *adc12, uint32_t dmaMask)
 Clear pending adc12 DMA triggers. More...
 
__STATIC_INLINE int16_t DL_ADC12_getADCOffsetCalibration (float userRef)
 Get calibration ADC offset value. More...
 

Detailed Description

Overview

The Analog to Digital Converter Driver Library allows full configuration of the MSPM0 ADC module. The ADC is a high-performance successive-approximation-register (SAR) analog-to-digital converter.


Macro Definition Documentation

§ DL_ADC12_SVT_OFFSET

#define DL_ADC12_SVT_OFFSET   ((uint32_t)0x555000 >> (uint32_t)2)

This is an internal macro is used to resolve the offset to ADC12 SVT.

The offset from ADC12 base to ADC12 SVT is 0x556000. However the FIFODATA and MEMRES registers within SVT are offset by an additional 0x1000. For example, the FIFODATA register from ADC12 base has offset 0x1160. The same register in ADC12 SVT has offset 0x0160.

This 0x1000 difference is taken in to consideration by DL_ADC12_SVT_OFFSET. Formula: (ADC12 SVT - ADC12 BASE) - 0x1000

Used by the following APIs: DL_ADC12_getFIFOData DL_ADC12_getFIFOAddress DL_ADC12_getMemResult DL_ADC12_getMemResultAddress

Referenced by DL_ADC12_getFIFOAddress(), DL_ADC12_getFIFOData(), DL_ADC12_getMemResult(), and DL_ADC12_getMemResultAddress().

Enumeration Type Documentation

§ DL_ADC12_MEM_IDX

Enumerator
DL_ADC12_MEM_IDX_0 

ADC12 Memory conversion index 0

DL_ADC12_MEM_IDX_1 

ADC12 Memory conversion index 1

DL_ADC12_MEM_IDX_2 

ADC12 Memory conversion index 2

DL_ADC12_MEM_IDX_3 

ADC12 Memory conversion index 3

DL_ADC12_MEM_IDX_4 

ADC12 Memory conversion index 4

DL_ADC12_MEM_IDX_5 

ADC12 Memory conversion index 5

DL_ADC12_MEM_IDX_6 

ADC12 Memory conversion index 6

DL_ADC12_MEM_IDX_7 

ADC12 Memory conversion index 7

DL_ADC12_MEM_IDX_8 

ADC12 Memory conversion index 8

DL_ADC12_MEM_IDX_9 

ADC12 Memory conversion index 9

DL_ADC12_MEM_IDX_10 

ADC12 Memory conversion index 10

DL_ADC12_MEM_IDX_11 

ADC12 Memory conversion index 11

§ DL_ADC12_REPEAT_MODE

Enumerator
DL_ADC12_REPEAT_MODE_ENABLED 

Sequence mode single repeat

DL_ADC12_REPEAT_MODE_DISABLED 

Sequence mode single

§ DL_ADC12_SAMPLING_SOURCE

Enumerator
DL_ADC12_SAMPLING_SOURCE_AUTO 

Timer high phase is used as source of the sample signal

DL_ADC12_SAMPLING_SOURCE_MANUAL 

External or software trigger is used as source of the sample signal

§ DL_ADC12_TRIG_SRC

Enumerator
DL_ADC12_TRIG_SRC_SOFTWARE 

Conversion is triggered by software.

DL_ADC12_TRIG_SRC_EVENT 

Conversion is triggered by hardware

§ DL_ADC12_SAMP_CONV_RES

Enumerator
DL_ADC12_SAMP_CONV_RES_12_BIT 

12-bits resolution

DL_ADC12_SAMP_CONV_RES_10_BIT 

10-bits resolution

DL_ADC12_SAMP_CONV_RES_8_BIT 

8-bits resolution

§ DL_ADC12_SAMP_CONV_DATA_FORMAT

Enumerator
DL_ADC12_SAMP_CONV_DATA_FORMAT_UNSIGNED 

Results are read as binary unsigned, right aligned.

DL_ADC12_SAMP_CONV_DATA_FORMAT_SIGNED 

Result are read as signed binary (2s complement), left aligned.

§ DL_ADC12_IIDX

Enumerator
DL_ADC12_IIDX_OVERFLOW 

ADC12 interrupt index for MEMRESX overflow

DL_ADC12_IIDX_TRIG_OVERFLOW 

ADC12 interrupt index for sequence conversion trigger overflow

DL_ADC12_IIDX_WINDOW_COMP_HIGH 

ADC12 interrupt index for MEMRESx result higher than window comparator high threshold

DL_ADC12_IIDX_WINDOW_COMP_LOW 

ADC12 interrupt index for MEMRESx result lower than window comparator low threshold

DL_ADC12_IIDX_INIFG 

ADC12 interrupt index for result in range

DL_ADC12_IIDX_DMA_DONE 

ADC12 interrupt index for DMA done

DL_ADC12_IIDX_UNDERFLOW 

ADC12 interrupt index for MEMRESX underflow

DL_ADC12_IIDX_MEM0_RESULT_LOADED 

ADC12 interrupt index for MEM0 result loaded interrupt

DL_ADC12_IIDX_MEM1_RESULT_LOADED 

ADC12 interrupt index for MEM1 result loaded interrupt

DL_ADC12_IIDX_MEM2_RESULT_LOADED 

ADC12 interrupt index for MEM2 result loaded interrupt

DL_ADC12_IIDX_MEM3_RESULT_LOADED 

ADC12 interrupt index for MEM3 result loaded interrupt

DL_ADC12_IIDX_MEM4_RESULT_LOADED 

ADC12 interrupt index for MEM4 result loaded interrupt

DL_ADC12_IIDX_MEM5_RESULT_LOADED 

ADC12 interrupt index for MEM5 result loaded interrupt

DL_ADC12_IIDX_MEM6_RESULT_LOADED 

ADC12 interrupt index for MEM6 result loaded interrupt

DL_ADC12_IIDX_MEM7_RESULT_LOADED 

ADC12 interrupt index for MEM7 result loaded interrupt

DL_ADC12_IIDX_MEM8_RESULT_LOADED 

ADC12 interrupt index for MEM8 result loaded interrupt

DL_ADC12_IIDX_MEM9_RESULT_LOADED 

ADC12 interrupt index for MEM9 result loaded interrupt

DL_ADC12_IIDX_MEM10_RESULT_LOADED 

ADC12 interrupt index for MEM10 result loaded interrupt

DL_ADC12_IIDX_MEM11_RESULT_LOADED 

ADC12 interrupt index for MEM10 result loaded interrupt

§ DL_ADC12_CLOCK

Enumerator
DL_ADC12_CLOCK_SYSOSC 

SYSOSC is the source of ADC sample clock

DL_ADC12_CLOCK_ULPCLK 

ULPCLK is the source of ADC sample clock

DL_ADC12_CLOCK_HFCLK 

HFCLK is the source of ADC sample clock

§ DL_ADC12_CLOCK_DIVIDE

Enumerator
DL_ADC12_CLOCK_DIVIDE_1 

Divide sample clock source by 1

DL_ADC12_CLOCK_DIVIDE_2 

Divide sample clock source by 2

DL_ADC12_CLOCK_DIVIDE_4 

Divide sample clock source by 4

DL_ADC12_CLOCK_DIVIDE_8 

Divide sample clock source by 8

DL_ADC12_CLOCK_DIVIDE_16 

Divide sample clock source by 16

DL_ADC12_CLOCK_DIVIDE_24 

Divide sample clock source by 24

DL_ADC12_CLOCK_DIVIDE_32 

Divide sample clock source by 32

DL_ADC12_CLOCK_DIVIDE_48 

Divide sample clock source by 48

§ DL_ADC12_CLOCK_FREQ_RANGE

Enumerator
DL_ADC12_CLOCK_FREQ_RANGE_1_TO_4 

Specifies ADC clock (ADCCLK) frequency range is from 1 MHz to 4 MHz

DL_ADC12_CLOCK_FREQ_RANGE_4_TO_8 

Specifies ADC clock (ADCCLK) frequency range is from 4 MHz to 8 MHz

DL_ADC12_CLOCK_FREQ_RANGE_8_TO_16 

Specifies ADC clock (ADCCLK) frequency range is from 8 MHz to 16 MHz

DL_ADC12_CLOCK_FREQ_RANGE_16_TO_20 

Specifies ADC clock (ADCCLK) frequency range is from 16 MHz to 20 MHz

DL_ADC12_CLOCK_FREQ_RANGE_20_TO_24 

Specifies ADC clock (ADCCLK) frequency range is from 20 MHz to 24 MHz

DL_ADC12_CLOCK_FREQ_RANGE_24_TO_32 

Specifies ADC clock (ADCCLK) frequency range is from 24 MHz to 32 MHz

DL_ADC12_CLOCK_FREQ_RANGE_32_TO_40 

Specifies ADC clock (ADCCLK) frequency range is from 32 MHz to 40 MHz

DL_ADC12_CLOCK_FREQ_RANGE_40_TO_48 

Specifies ADC clock (ADCCLK) frequency range is from 40 MHz to 48 MHz

Function Documentation

§ DL_ADC12_enablePower()

__STATIC_INLINE void DL_ADC12_enablePower ( ADC12_Regs *  adc12)

Enables the Peripheral Write Enable (PWREN) register for the ADC12.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

Note
For power savings, please refer to DL_ADC12_setPowerDownMode
Parameters
adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_disablePower()

__STATIC_INLINE void DL_ADC12_disablePower ( ADC12_Regs *  adc12)

Disables the Peripheral Write Enable (PWREN) register for the ADC12.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Note
This API does not provide large power savings. For power savings please refer to DL_ADC12_setPowerDownMode
Parameters
adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_isPowerEnabled()

__STATIC_INLINE bool DL_ADC12_isPowerEnabled ( const ADC12_Regs *  adc12)

Returns if the Peripheral Write Enable (PWREN) register for the ADC12 is enabled.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Parameters
adc12Pointer to the register overlay for the peripheral
Returns
true if peripheral register access is enabled
false if peripheral register access is disabled

§ DL_ADC12_reset()

__STATIC_INLINE void DL_ADC12_reset ( ADC12_Regs *  adc12)

Resets adc12 peripheral.

Parameters
adc12Pointer to the register overlay for the ADC12 peripheral

§ DL_ADC12_isReset()

__STATIC_INLINE bool DL_ADC12_isReset ( const ADC12_Regs *  adc12)

Returns if adc12 peripheral was reset.

Parameters
adc12Pointer to the register overlay for the ADC12 peripheral
Returns
true if peripheral was reset
false if peripheral wasn't reset

§ DL_ADC12_initSingleSample()

__STATIC_INLINE void DL_ADC12_initSingleSample ( ADC12_Regs *  adc12,
uint32_t  repeatMode,
uint32_t  sampleMode,
uint32_t  trigSrc,
uint32_t  resolution,
uint32_t  dataFormat 
)

Initializes ADC12 for single sampling mode operation. This initialization configures MEMCTL0 as the default memory control register for the conversion. If the conversion needs use a different memory control register the user can call DL_ADC12_setStartAddress to specify a different control register.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]repeatModeSpecifies repeat configuration. One of DL_ADC12_REPEAT_MODE
[in]sampleModeSpecifies source of the sampling signal. One of DL_ADC12_SAMPLING_SOURCE
[in]trigSrcSpecifies sampling trigger source. One of DL_ADC12_TRIG_SRC
[in]resolutionSpecifies sample conversion resolution. One of DL_ADC12_SAMP_CONV_RES
[in]dataFormatSpecifies sample conversion data format. One of DL_ADC12_SAMP_CONV_DATA_FORMAT

References DL_Common_updateReg().

§ DL_ADC12_setStartAddress()

__STATIC_INLINE void DL_ADC12_setStartAddress ( ADC12_Regs *  adc12,
uint32_t  startAdd 
)

Sets the start address for ADC conversion.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]startAddIf ADC has been initialized in Single Sample mode, startAdd specifies the memory control register to be used during conversion. If ADC is initialized in sequence sampling mode, it specifies the first memory control register in the sequence. One of DL_ADC12_SEQ_START_ADDR

References DL_Common_updateReg().

§ DL_ADC12_getStartAddress()

__STATIC_INLINE uint32_t DL_ADC12_getStartAddress ( const ADC12_Regs *  adc12)

Gets start address for ADC conversion.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
One of DL_ADC12_SEQ_END_ADDR

§ DL_ADC12_setEndAddress()

__STATIC_INLINE void DL_ADC12_setEndAddress ( ADC12_Regs *  adc12,
uint32_t  endAdd 
)

Sets the end address for ADC conversion.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]endAddWhen ADC is initialized in sequence sampling mode it specifies the last memory control register in the sequence. One of DL_ADC12_SEQ_END_ADDR

References DL_Common_updateReg().

§ DL_ADC12_getEndAddress()

__STATIC_INLINE uint32_t DL_ADC12_getEndAddress ( const ADC12_Regs *  adc12)

Gets end address for ADC conversion.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
One of DL_ADC12_SEQ_END_ADDR

§ DL_ADC12_initSeqSample()

__STATIC_INLINE void DL_ADC12_initSeqSample ( ADC12_Regs *  adc12,
uint32_t  repeatMode,
uint32_t  sampleMode,
uint32_t  trigSrc,
uint32_t  startAdd,
uint32_t  endAdd,
uint32_t  resolution,
uint32_t  dataFormat 
)

Initializes ADC12 for sequence sampling mode operation.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]repeatModeSpecifies repeat configuration. One of DL_ADC12_REPEAT_MODE
[in]sampleModeSpecifies source of the sampling signal. One of DL_ADC12_SAMPLING_SOURCE
[in]trigSrcSpecifies sampling trigger source. One of DL_ADC12_TRIG_SRC
[in]startAddSpecifies the starting address to sequence conversion. One of DL_ADC12_SEQ_START_ADDR
[in]endAddSpecifies the ending address to sequence conversion. One of DL_ADC12_SEQ_END_ADDR
[in]resolutionSpecifies sample conversion resolution. One of DL_ADC12_SAMP_CONV_RES
[in]dataFormatSpecifies sample conversion data format. One of DL_ADC12_SAMP_CONV_DATA_FORMAT

References DL_Common_updateReg().

§ DL_ADC12_getResolution()

__STATIC_INLINE uint32_t DL_ADC12_getResolution ( const ADC12_Regs *  adc12)

Returns ADC12 resolution.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
One of DL_ADC12_SAMP_CONV_RES

§ DL_ADC12_getDataFormat()

__STATIC_INLINE uint32_t DL_ADC12_getDataFormat ( const ADC12_Regs *  adc12)

Returns ADC12 data format.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
One of DL_ADC12_SAMP_CONV_DATA_FORMAT

§ DL_ADC12_getSamplingSource()

__STATIC_INLINE uint32_t DL_ADC12_getSamplingSource ( const ADC12_Regs *  adc12)

Returns ADC12 sampling source.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
One of DL_ADC12_SAMPLING_SOURCE

§ DL_ADC12_getSampleMode()

__STATIC_INLINE uint32_t DL_ADC12_getSampleMode ( const ADC12_Regs *  adc12)

Returns ADC12 sampling mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
One of DL_ADC12_SAMP_MODE

§ DL_ADC12_getTriggerSource()

__STATIC_INLINE DL_ADC12_TRIG_SRC DL_ADC12_getTriggerSource ( const ADC12_Regs *  adc12)

Returns ADC12 trigger mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
One of DL_ADC12_TRIG_SRC

§ DL_ADC12_startConversion()

__STATIC_INLINE void DL_ADC12_startConversion ( ADC12_Regs *  adc12)

Start ADC12 conversion.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_stopConversion()

__STATIC_INLINE void DL_ADC12_stopConversion ( ADC12_Regs *  adc12)

Stop ADC12 conversion.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_isConversionStarted()

__STATIC_INLINE bool DL_ADC12_isConversionStarted ( const ADC12_Regs *  adc12)

Check if ADC12 conversion is started.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
If ADC12 conversion is started
Return values
trueADC12 conversion is started
falseADC12 conversion is stopped

§ DL_ADC12_enableDMA()

__STATIC_INLINE void DL_ADC12_enableDMA ( ADC12_Regs *  adc12)

Enables DMA for data transfer.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_disableDMA()

__STATIC_INLINE void DL_ADC12_disableDMA ( ADC12_Regs *  adc12)

Disables DMA for data transfer.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_isDMAEnabled()

__STATIC_INLINE bool DL_ADC12_isDMAEnabled ( const ADC12_Regs *  adc12)

Check if DMA is enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
If DMA is enabled
Return values
trueDMA is enabled
falseDMA is disabled

§ DL_ADC12_setDMASamplesCnt()

__STATIC_INLINE void DL_ADC12_setDMASamplesCnt ( ADC12_Regs *  adc12,
uint8_t  sampCnt 
)

Set number of ADC results to be transfer on a DMA trigger.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]sampCntNumber of ADC results to be transfer on a DMA trigger. Valid range 0 - 24.

References DL_Common_updateReg().

§ DL_ADC12_getDMASampleCnt()

__STATIC_INLINE uint8_t DL_ADC12_getDMASampleCnt ( const ADC12_Regs *  adc12)

Get number of ADC results to be transfer on a DMA trigger.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Number of ADC results to be transfer on a DMA trigger

§ DL_ADC12_enableFIFO()

__STATIC_INLINE void DL_ADC12_enableFIFO ( ADC12_Regs *  adc12)

Enables FIFO mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_disableFIFO()

__STATIC_INLINE void DL_ADC12_disableFIFO ( ADC12_Regs *  adc12)

Disables FIFO mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_isFIFOEnabled()

__STATIC_INLINE bool DL_ADC12_isFIFOEnabled ( const ADC12_Regs *  adc12)

Checks if FIFO mode is enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
If FIFO mode is enabled
Return values
trueFIFO mode is enabled
falseFIFO mode is disabled

References DL_ADC12_getClockConfig(), and DL_ADC12_setClockConfig().

§ DL_ADC12_setClockConfig()

void DL_ADC12_setClockConfig ( ADC12_Regs *  adc12,
const DL_ADC12_ClockConfig config 
)

Configures ADC12 sample clock divider and sample clock frequency range.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]configPointer to the clock configuration struct DL_ADC12_ClockConfig.

Referenced by DL_ADC12_isFIFOEnabled().

§ DL_ADC12_getClockConfig()

void DL_ADC12_getClockConfig ( const ADC12_Regs *  adc12,
DL_ADC12_ClockConfig config 
)

Returns ADC12 sample clock configuration.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]configPointer to the clock configuration struct DL_ADC12_ClockConfig.

Referenced by DL_ADC12_isFIFOEnabled().

§ DL_ADC12_setPowerDownMode()

__STATIC_INLINE void DL_ADC12_setPowerDownMode ( ADC12_Regs *  adc12,
uint32_t  powerDownMode 
)

Configures ADC12 power down mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]powerDownModeSpecifies the power down mode. One of DL_ADC12_POWER_DOWN_MODE.

References DL_Common_updateReg().

§ DL_ADC12_getPowerDownMode()

__STATIC_INLINE uint32_t DL_ADC12_getPowerDownMode ( const ADC12_Regs *  adc12)

Returns ADC power down mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
The current ADC12 power down mode
Return values
Oneof DL_ADC12_POWER_DOWN_MODE

§ DL_ADC12_enableConversions()

__STATIC_INLINE void DL_ADC12_enableConversions ( ADC12_Regs *  adc12)

Enable ADC12 conversion.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_disableConversions()

__STATIC_INLINE void DL_ADC12_disableConversions ( ADC12_Regs *  adc12)

Disable ADC12 conversion.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_isConversionsEnabled()

__STATIC_INLINE bool DL_ADC12_isConversionsEnabled ( const ADC12_Regs *  adc12)

Check if ADC12 conversion is enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
If the ADC12 conversion is enabled
Return values
trueThe ADC12 conversion is enabled
falseThe ADC12 conversion is disabled

§ DL_ADC12_configHwAverage()

__STATIC_INLINE void DL_ADC12_configHwAverage ( ADC12_Regs *  adc12,
uint32_t  numerator,
uint32_t  denominator 
)

Configure ADC12 hardware average.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]numeratorSpecifies the number of conversion to accumulate. One of DL_ADC12_HW_AVG_NUM
[in]denominatorSpecifies the number to divide the accumulated value by. One of DL_ADC12_HW_AVG_DEN

References DL_Common_updateReg().

§ DL_ADC12_getHwAverageConfig()

__STATIC_INLINE uint32_t DL_ADC12_getHwAverageConfig ( const ADC12_Regs *  adc12)

Return the hardware average configuration.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Bitwise OR of DL_ADC12_HW_AVG_NUM and DL_ADC12_HW_AVG_DEN

§ DL_ADC12_setSampleTime0()

__STATIC_INLINE void DL_ADC12_setSampleTime0 ( ADC12_Regs *  adc12,
uint16_t  adcclks 
)

Set sample time 0.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]adcclksSpecifies the sample time in number of ADCCLK cycles. Actual sample time is (adcclks + 1)

§ DL_ADC12_getSampleTime0()

__STATIC_INLINE uint16_t DL_ADC12_getSampleTime0 ( const ADC12_Regs *  adc12)

Get sample time 0.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Sample time 0 in ADCCLKS.

§ DL_ADC12_setSampleTime1()

__STATIC_INLINE void DL_ADC12_setSampleTime1 ( ADC12_Regs *  adc12,
uint16_t  adcclks 
)

Set sample time 1.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]adcclksSpecifies the sample time in number of ADCCLK cycles. Actual sample time is (adcclks + 1)

§ DL_ADC12_getSampleTime1()

__STATIC_INLINE uint16_t DL_ADC12_getSampleTime1 ( const ADC12_Regs *  adc12)

Get sample time 1.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Sample time 1 in ADCCLKS.

§ DL_ADC12_configWinCompLowThld()

__STATIC_INLINE void DL_ADC12_configWinCompLowThld ( ADC12_Regs *  adc12,
uint16_t  threshold 
)

Configures window comparator low threshold.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]thresholdWindow comparator low threshold value. Threshold value must take into account result data format and and resolution confugred via DL_ADC12_initSingleSample or DL_ADC12_initSeqSample

§ DL_ADC12_configWinCompHighThld()

__STATIC_INLINE void DL_ADC12_configWinCompHighThld ( ADC12_Regs *  adc12,
uint16_t  threshold 
)

Configures window comparator high threshold.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]thresholdWindow comparator high threshold value. Threshold value must take into account result data format and and resolution confugred via DL_ADC12_initSingleSample or DL_ADC12_initSeqSample

§ DL_ADC12_getFIFOData()

__STATIC_INLINE uint32_t DL_ADC12_getFIFOData ( const ADC12_Regs *  adc12)

Returns the data from the top of FIFO.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Data from the top of FIFO.

References DL_ADC12_SVT_OFFSET.

§ DL_ADC12_getFIFOAddress()

__STATIC_INLINE uint32_t DL_ADC12_getFIFOAddress ( const ADC12_Regs *  adc12)

Returns the address of FIFO data register.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Address of FIFO data register

References DL_ADC12_SVT_OFFSET.

§ DL_ADC12_configConversionMem()

__STATIC_INLINE void DL_ADC12_configConversionMem ( ADC12_Regs *  adc12,
DL_ADC12_MEM_IDX  idx,
uint32_t  chansel,
uint32_t  vref,
uint32_t  stime,
uint32_t  avgen,
uint32_t  bcsen,
uint32_t  trig,
uint32_t  wincomp 
)

Configures conversion memory.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]idxMemory conversion index. DL_ADC12_MEM_IDX.
[in]chanselSelects input channel. One of DL_ADC12_INPUT_CHAN
[in]vrefSelects reference voltage. One of DL_ADC12_REFERENCE_VOLTAGE
[in]stimeSelects source of sample adc12 period. One of DL_ADC12_SAMPLE_TIMER_SOURCE
[in]avgenSelects averaging mode. One of DL_ADC12_AVERAGING_MODE
[in]bcsenSelects burn out current source selection. One of DL_ADC12_BURN_OUT_SOURCE
[in]trigSelects trigger mode. One of DL_ADC12_TRIGGER_MODE
[in]wincompSelects window comparator mode. One of DL_ADC12_WINDOWS_COMP_MODE

§ DL_ADC12_getConversionMemConfig()

__STATIC_INLINE uint32_t DL_ADC12_getConversionMemConfig ( const ADC12_Regs *  adc12,
DL_ADC12_MEM_IDX  idx 
)

Returns conversion memory configuration.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]idxMemory conversion index. DL_ADC12_MEM_IDX.
Returns
Bitwise OR of DL_ADC12_INPUT_CHAN, DL_ADC12_REFERENCE_VOLTAGE, DL_ADC12_SAMPLE_TIMER_SOURCE, DL_ADC12_AVERAGING_MODE, DL_ADC12_BURN_OUT_SOURCE, DL_ADC12_TRIGGER_MODE, DL_ADC12_WINDOWS_COMP_MODE

§ DL_ADC12_getMemResult()

__STATIC_INLINE uint16_t DL_ADC12_getMemResult ( const ADC12_Regs *  adc12,
DL_ADC12_MEM_IDX  idx 
)

Returns the conversion result for the selected memory index.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]idxMemory conversion index. DL_ADC12_MEM_IDX.
Returns
Conversion result

References DL_ADC12_SVT_OFFSET.

§ DL_ADC12_getMemResultAddress()

__STATIC_INLINE uint32_t DL_ADC12_getMemResultAddress ( const ADC12_Regs *  adc12,
DL_ADC12_MEM_IDX  idx 
)

Returns the conversion result memory address.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]idxMemory conversion index. DL_ADC12_MEM_IDX.
Returns
Conversion result memory address

References DL_ADC12_SVT_OFFSET.

§ DL_ADC12_getStatus()

__STATIC_INLINE uint32_t DL_ADC12_getStatus ( const ADC12_Regs *  adc12)

Returns ADC12 status.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Bitwise OR of DL_ADC12_STATUS_CONVERSION and DL_ADC12_STATUS_REFERENCE

§ DL_ADC12_disableForcingSYSOSCOnInRunMode()

__STATIC_INLINE void DL_ADC12_disableForcingSYSOSCOnInRunMode ( ADC12_Regs *  adc12)

Allows SYSOSC to not run at base frequency when device is in RUN mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

References DL_Common_updateReg().

§ DL_ADC12_forceSYSOSCOnInRunMode()

__STATIC_INLINE void DL_ADC12_forceSYSOSCOnInRunMode ( ADC12_Regs *  adc12)

Forces SYSOSC to run at base frequency when device is in RUN mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_disableForcingSYSOSCOnInStopMode()

__STATIC_INLINE void DL_ADC12_disableForcingSYSOSCOnInStopMode ( ADC12_Regs *  adc12)

Allows SYSOSC to not run at base frequency when device is in STOP mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

References DL_Common_updateReg().

§ DL_ADC12_forceSYSOSCOnInStopMode()

__STATIC_INLINE void DL_ADC12_forceSYSOSCOnInStopMode ( ADC12_Regs *  adc12)

Forces SYSOSC to run at base frequency when device is in STOP mode.

Parameters
[in]adc12Pointer to the register overlay for the peripheral

§ DL_ADC12_enableInterrupt()

__STATIC_INLINE void DL_ADC12_enableInterrupt ( ADC12_Regs *  adc12,
uint32_t  interruptMask 
)

Enable ADC12 interrupt.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_ADC12_INTERRUPTS.

§ DL_ADC12_disableInterrupt()

__STATIC_INLINE void DL_ADC12_disableInterrupt ( ADC12_Regs *  adc12,
uint32_t  interruptMask 
)

Disable ADC12 interrupt.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_ADC12_INTERRUPTS.

§ DL_ADC12_getEnabledInterrupts()

__STATIC_INLINE uint32_t DL_ADC12_getEnabledInterrupts ( const ADC12_Regs *  adc12,
uint32_t  interruptMask 
)

Check which ADC12 interrupts are enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_ADC12_INTERRUPTS.
Returns
Which of the requested ADC12 interrupts are enabled
Return values
BitwiseOR of DL_ADC12_INTERRUPTS values

§ DL_ADC12_getEnabledInterruptStatus()

__STATIC_INLINE uint32_t DL_ADC12_getEnabledInterruptStatus ( const ADC12_Regs *  adc12,
uint32_t  interruptMask 
)

Check interrupt flag of enabled ADC12 interrupt.

Checks if the ADC12 interrupt that was previously enabled is pending.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_ADC12_INTERRUPTS.
Returns
If the enabled ADC12 interrupt is pending
See also
DL_ADC12_enableInterrupt

§ DL_ADC12_getRawInterruptStatus()

__STATIC_INLINE uint32_t DL_ADC12_getRawInterruptStatus ( const ADC12_Regs *  adc12,
uint32_t  interruptMask 
)

Check interrupt flag of any ADC12 interrupt.

Checks if the ADC12 interrupt is pending. Interrupt does not have to be previously enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_ADC12_INTERRUPTS.
Returns
If the ADC12 interrupt is pending

§ DL_ADC12_getPendingInterrupt()

__STATIC_INLINE DL_ADC12_IIDX DL_ADC12_getPendingInterrupt ( const ADC12_Regs *  adc12)

Get highest priority pending ADC12 interrupt.

Checks if any of the ADC12 interrupts are pending. Interrupts do not have to be previously enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
The highest priority pending ADC12 interrupt
Return values
Oneof DL_ADC12_IIDX

§ DL_ADC12_clearInterruptStatus()

__STATIC_INLINE void DL_ADC12_clearInterruptStatus ( ADC12_Regs *  adc12,
uint32_t  interruptMask 
)

Clear pending ADC12 interrupt.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]interruptMaskBit mask of interrupts to check. Bitwise OR of DL_ADC12_INTERRUPTS.

§ DL_ADC12_setPublisherChanID()

__STATIC_INLINE void DL_ADC12_setPublisherChanID ( ADC12_Regs *  adc12,
uint8_t  chanID 
)

Sets the event publisher channel id.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]chanIDChannel ID number. Valid range 0-15. If ChanID == 0 publisher is disconnected.

§ DL_ADC12_getPublisherChanID()

__STATIC_INLINE uint8_t DL_ADC12_getPublisherChanID ( const ADC12_Regs *  adc12)

Gets the event publisher channel id.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Event publisher channel ID

§ DL_ADC12_setSubscriberChanID()

__STATIC_INLINE void DL_ADC12_setSubscriberChanID ( ADC12_Regs *  adc12,
uint8_t  chanID 
)

Sets the event subscriber channel id.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]chanIDChannel ID number. Valid range 0-15. If ChanID == 0 subscriber is disconnected.

§ DL_ADC12_getSubscriberChanID()

__STATIC_INLINE uint8_t DL_ADC12_getSubscriberChanID ( const ADC12_Regs *  adc12)

Gets the event subscriber channel id.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
Returns
Event subscriber channel ID

§ DL_ADC12_enableEvent()

__STATIC_INLINE void DL_ADC12_enableEvent ( ADC12_Regs *  adc12,
uint32_t  eventMask 
)

Enable ADC12 event.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]eventMaskBit mask of events to enable. Bitwise OR of DL_ADC12_EVENT.

§ DL_ADC12_disableEvent()

__STATIC_INLINE void DL_ADC12_disableEvent ( ADC12_Regs *  adc12,
uint32_t  eventMask 
)

Disable ADC12 event.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]eventMaskBit mask of events to enable. Bitwise OR of DL_ADC12_EVENT.

§ DL_ADC12_getEnabledEvents()

__STATIC_INLINE uint32_t DL_ADC12_getEnabledEvents ( const ADC12_Regs *  adc12,
uint32_t  eventMask 
)

Check which adc12 dma triggers are enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]eventMaskBit mask of events to check. Bitwise OR of DL_ADC12_EVENT.
Returns
Which of the requested adc12 events are enabled
Return values
BitwiseOR of DL_ADC12_EVENT values

§ DL_ADC12_getEnabledEventStatus()

__STATIC_INLINE uint32_t DL_ADC12_getEnabledEventStatus ( const ADC12_Regs *  adc12,
uint32_t  eventMask 
)

Check event flag of enabled adc12 event.

Checks if any of the adc12 events that were previously enabled are pending.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]eventMaskBit mask of events to check. Bitwise OR of DL_ADC12_EVENT.
Returns
Which of the requested adc12 eventes are pending
Return values
BitwiseOR of DL_ADC12_EVENT values
See also
DL_ADC12_enableEvent

§ DL_ADC12_getRawEventsStatus()

__STATIC_INLINE uint32_t DL_ADC12_getRawEventsStatus ( const ADC12_Regs *  adc12,
uint32_t  eventMask 
)

Check event flag of any adc12 event.

Checks if any events are pending. Events do not have to be previously enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]eventMaskBit mask of event to check. Bitwise OR of DL_ADC12_EVENT.
Returns
Which of the requested adc12 event are pending
Return values
BitwiseOR of DL_ADC12_EVENT values

§ DL_ADC12_clearEventsStatus()

__STATIC_INLINE void DL_ADC12_clearEventsStatus ( ADC12_Regs *  adc12,
uint32_t  eventMask 
)

Clear pending adc12 events.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]eventMaskBit mask of events to clear. Bitwise OR of DL_ADC12_EVENT.

§ DL_ADC12_enableDMATrigger()

__STATIC_INLINE void DL_ADC12_enableDMATrigger ( ADC12_Regs *  adc12,
uint32_t  dmaMask 
)

Enable ADC12 DMA triggers.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]dmaMaskBit mask of DMA triggers to enable. Bitwise OR of DL_ADC12_DMA.

§ DL_ADC12_disableDMATrigger()

__STATIC_INLINE void DL_ADC12_disableDMATrigger ( ADC12_Regs *  adc12,
uint32_t  dmaMask 
)

Disable ADC12 DMA triggers.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]dmaMaskBit mask of DMA triggers to enable. Bitwise OR of DL_ADC12_DMA.

§ DL_ADC12_getEnabledDMATrigger()

__STATIC_INLINE uint32_t DL_ADC12_getEnabledDMATrigger ( const ADC12_Regs *  adc12,
uint32_t  dmaMask 
)

Check which adc12 DMA triggers are enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]dmaMaskBit mask of DMA triggers to check. Bitwise OR of DL_ADC12_DMA.
Returns
Which of the requested adc12 DMA triggers are enabled
Return values
BitwiseOR of DL_ADC12_DMA values

§ DL_ADC12_getEnabledDMATriggerStatus()

__STATIC_INLINE uint32_t DL_ADC12_getEnabledDMATriggerStatus ( const ADC12_Regs *  adc12,
uint32_t  dmaMask 
)

Check event flag of enabled adc12 DMA triggers.

Checks if any of the adc12 DMA triggers that were previously enabled are pending.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]dmaMaskBit mask of DMA triggers to check. Bitwise OR of DL_ADC12_DMA.
Returns
Which of the requested adc12 eventes are pending
Return values
BitwiseOR of DL_ADC12_DMA values
See also
DL_ADC12_enableDMATrigger

§ DL_ADC12_getRawDMATriggerStatus()

__STATIC_INLINE uint32_t DL_ADC12_getRawDMATriggerStatus ( const ADC12_Regs *  adc12,
uint32_t  dmaMask 
)

Check DMA triggers flag of any adc12 dma trigger.

Checks if any dma trigger are pending. DMA triggers do not have to be previously enabled.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]dmaMaskBit mask of DMA triggers to check. Bitwise OR of DL_ADC12_DMA.
Returns
Which of the requested adc12 dma triggers are pending
Return values
BitwiseOR of DL_ADC12_DMA values

§ DL_ADC12_clearDMATriggerStatus()

__STATIC_INLINE void DL_ADC12_clearDMATriggerStatus ( ADC12_Regs *  adc12,
uint32_t  dmaMask 
)

Clear pending adc12 DMA triggers.

Parameters
[in]adc12Pointer to the register overlay for the peripheral
[in]dmaMaskBit mask of DMA triggers to clear. Bitwise OR of DL_ADC12_DMA.

§ DL_ADC12_getADCOffsetCalibration()

__STATIC_INLINE int16_t DL_ADC12_getADCOffsetCalibration ( float  userRef)

Get calibration ADC offset value.

Workaround for errata on MSPM0C110x devices: ADC_ERR_06

Offset needs to be calibrated each time DL_ADC12_configConversionMem is configured with a new voltage reference.

User needs to add calibrated offset to the result of DL_ADC12_getMemResult to get correct ADC value.

Parameters
[in]userRefReference voltage
Returns
Calibrated ADC offset value

References DL_FactoryRegion_getADCOffset().

© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale