ADC - Analog to Digital Converter

Description

Analog to Digital Converter (ADC) Peripheral API.

This module contains functions to control the ADC peripheral of Silicon Labs 32-bit MCUs and SoCs. The ADC is used to convert analog signals into a digital representation.

Data Structures

struct ADC_Init_TypeDef
ADC initialization structure, common for single conversion and scan sequence.
struct ADC_InitScanInput_TypeDef
Scan input configuration.
struct ADC_InitScan_TypeDef
Scan sequence initialization structure.
struct ADC_InitSingle_TypeDef
Single conversion initialization structure.

Functions

uint32_t ADC_DataSingleGet (ADC_TypeDef *adc)
Get a single conversion result.
uint32_t ADC_DataSinglePeek (ADC_TypeDef *adc)
Peek single conversion result.
uint32_t ADC_DataScanGet (ADC_TypeDef *adc)
Get a scan result.
uint32_t ADC_DataScanPeek (ADC_TypeDef *adc)
Peek scan result.
uint32_t ADC_DataIdScanGet (ADC_TypeDef *adc, uint32_t *scanId)
Get a scan result and scan select ID.
void ADC_Init (ADC_TypeDef *adc, const ADC_Init_TypeDef *init)
Initialize ADC.
void ADC_Reset (ADC_TypeDef *adc)
Reset ADC to a state that it was in after a hardware reset.
void ADC_InitScan (ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init)
Initialize the ADC scan sequence.
void ADC_ScanInputClear ( ADC_InitScan_TypeDef *scanInit)
Clear ADC scan input configuration.
uint32_t ADC_ScanSingleEndedInputAdd ( ADC_InitScan_TypeDef *scanInit, ADC_ScanInputGroup_TypeDef inputGroup, ADC_PosSel_TypeDef singleEndedSel)
Initialize ADC scan single-ended input configuration.
uint32_t ADC_ScanDifferentialInputAdd ( ADC_InitScan_TypeDef *scanInit, ADC_ScanInputGroup_TypeDef inputGroup, ADC_PosSel_TypeDef posSel, ADC_ScanNegInput_TypeDef negInput)
Initialize the ADC scan differential input configuration.
void ADC_InitSingle (ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init)
Initialize the single ADC sample conversion.
uint8_t ADC_TimebaseCalc (uint32_t hfperFreq)
Calculate a timebase value to get a timebase providing at least 1 us.
uint8_t ADC_PrescaleCalc (uint32_t adcFreq, uint32_t hfperFreq)
Calculate the prescaler value used to determine the ADC clock.
void ADC_IntClear (ADC_TypeDef *adc, uint32_t flags)
Clear one or more pending ADC interrupts.
void ADC_IntDisable (ADC_TypeDef *adc, uint32_t flags)
Disable one or more ADC interrupts.
void ADC_IntEnable (ADC_TypeDef *adc, uint32_t flags)
Enable one or more ADC interrupts.
uint32_t ADC_IntGet (ADC_TypeDef *adc)
Get pending ADC interrupt flags.
uint32_t ADC_IntGetEnabled (ADC_TypeDef *adc)
Get enabled and pending ADC interrupt flags.
void ADC_IntSet (ADC_TypeDef *adc, uint32_t flags)
Set one or more pending ADC interrupts from software.
void ADC_Start (ADC_TypeDef *adc, ADC_Start_TypeDef cmd)
Start scan sequence and/or single conversion.

Macros

#define ADC_CTRLX_VREFSEL_REG 0x80UL
Single and scan mode voltage references.
#define ADC_SCANINPUTSEL_GROUP_NONE 0xFFU
Define none selected group for ADC_SCANINPUTSEL.
#define ADC_SCANINPUTSEL_NONE
Define none selected for ADC_SCANINPUTSEL.
#define ADC_INIT_DEFAULT
Default configuration for ADC initialization structure.
#define ADC_INITSCAN_DEFAULT
Default configuration for ADC scan initialization structure.
#define ADC_INITSINGLE_DEFAULT
Default configuration for ADC single conversion initialization structure.

Enumerations

enum ADC_AcqTime_TypeDef {
adcAcqTime1 = _ADC_SINGLECTRL_AT_1CYCLE,
adcAcqTime2 = _ADC_SINGLECTRL_AT_2CYCLES,
adcAcqTime4 = _ADC_SINGLECTRL_AT_4CYCLES,
adcAcqTime8 = _ADC_SINGLECTRL_AT_8CYCLES,
adcAcqTime16 = _ADC_SINGLECTRL_AT_16CYCLES,
adcAcqTime32 = _ADC_SINGLECTRL_AT_32CYCLES,
adcAcqTime64 = _ADC_SINGLECTRL_AT_64CYCLES,
adcAcqTime128 = _ADC_SINGLECTRL_AT_128CYCLES,
adcAcqTime256 = _ADC_SINGLECTRL_AT_256CYCLES
}
Acquisition time (in ADC clock cycles).
enum ADC_OvsRateSel_TypeDef {
adcOvsRateSel2 = _ADC_CTRL_OVSRSEL_X2,
adcOvsRateSel4 = _ADC_CTRL_OVSRSEL_X4,
adcOvsRateSel8 = _ADC_CTRL_OVSRSEL_X8,
adcOvsRateSel16 = _ADC_CTRL_OVSRSEL_X16,
adcOvsRateSel32 = _ADC_CTRL_OVSRSEL_X32,
adcOvsRateSel64 = _ADC_CTRL_OVSRSEL_X64,
adcOvsRateSel128 = _ADC_CTRL_OVSRSEL_X128,
adcOvsRateSel256 = _ADC_CTRL_OVSRSEL_X256,
adcOvsRateSel512 = _ADC_CTRL_OVSRSEL_X512,
adcOvsRateSel1024 = _ADC_CTRL_OVSRSEL_X1024,
adcOvsRateSel2048 = _ADC_CTRL_OVSRSEL_X2048,
adcOvsRateSel4096 = _ADC_CTRL_OVSRSEL_X4096
}
Oversample rate select.
enum ADC_PRSSEL_TypeDef {
adcPRSSELCh0 = _ADC_SINGLECTRLX_PRSSEL_PRSCH0,
adcPRSSELCh1 = _ADC_SINGLECTRLX_PRSSEL_PRSCH1,
adcPRSSELCh2 = _ADC_SINGLECTRLX_PRSSEL_PRSCH2,
adcPRSSELCh3 = _ADC_SINGLECTRLX_PRSSEL_PRSCH3,
adcPRSSELCh4 = _ADC_SINGLECTRLX_PRSSEL_PRSCH4,
adcPRSSELCh5 = _ADC_SINGLECTRLX_PRSSEL_PRSCH5,
adcPRSSELCh6 = _ADC_SINGLECTRLX_PRSSEL_PRSCH6,
adcPRSSELCh7 = _ADC_SINGLECTRLX_PRSSEL_PRSCH7,
adcPRSSELCh8 = _ADC_SINGLECTRLX_PRSSEL_PRSCH8,
adcPRSSELCh9 = _ADC_SINGLECTRLX_PRSSEL_PRSCH9,
adcPRSSELCh10 = _ADC_SINGLECTRLX_PRSSEL_PRSCH10,
adcPRSSELCh11 = _ADC_SINGLECTRLX_PRSSEL_PRSCH11,
adcPRSSELCh12 = _ADC_SINGLECTRLX_PRSSEL_PRSCH12,
adcPRSSELCh13 = _ADC_SINGLECTRLX_PRSSEL_PRSCH13,
adcPRSSELCh14 = _ADC_SINGLECTRLX_PRSSEL_PRSCH14,
adcPRSSELCh15 = _ADC_SINGLECTRLX_PRSSEL_PRSCH15
}
Peripheral Reflex System signal used to trigger a single sample.
enum ADC_Ref_TypeDef {
adcRef1V25 = _ADC_SINGLECTRL_REF_1V25,
adcRef2V5 = _ADC_SINGLECTRL_REF_2V5,
adcRefVDD = _ADC_SINGLECTRL_REF_VDD,
adcRef5V = _ADC_SINGLECTRL_REF_5V,
adcRefExtSingle = _ADC_SINGLECTRL_REF_EXTSINGLE,
adcRef2xExtDiff = _ADC_SINGLECTRL_REF_2XEXTDIFF,
adcRef2xVDD = _ADC_SINGLECTRL_REF_2XVDD,
adcRefVBGR = _ADC_SINGLECTRLX_VREFSEL_VBGR | ADC_CTRLX_VREFSEL_REG,
adcRefVddxAtt = _ADC_SINGLECTRLX_VREFSEL_VDDXWATT | ADC_CTRLX_VREFSEL_REG,
adcRefVPxAtt = _ADC_SINGLECTRLX_VREFSEL_VREFPWATT | ADC_CTRLX_VREFSEL_REG,
adcRefP = _ADC_SINGLECTRLX_VREFSEL_VREFP | ADC_CTRLX_VREFSEL_REG,
adcRefVEntropy = _ADC_SINGLECTRLX_VREFSEL_VENTROPY | ADC_CTRLX_VREFSEL_REG,
adcRefVPNxAtt = _ADC_SINGLECTRLX_VREFSEL_VREFPNWATT | ADC_CTRLX_VREFSEL_REG,
adcRefPN = _ADC_SINGLECTRLX_VREFSEL_VREFPN | ADC_CTRLX_VREFSEL_REG
}
ADC Reference.
enum ADC_Res_TypeDef {
adcRes12Bit = _ADC_SINGLECTRL_RES_12BIT,
adcRes8Bit = _ADC_SINGLECTRL_RES_8BIT,
adcRes6Bit = _ADC_SINGLECTRL_RES_6BIT,
adcResOVS = _ADC_SINGLECTRL_RES_OVS
}
Sample resolution.
enum ADC_PosSel_TypeDef {
adcPosSelAPORT0XCH0 = _ADC_SINGLECTRL_POSSEL_APORT0XCH0,
adcPosSelAPORT0XCH1 = _ADC_SINGLECTRL_POSSEL_APORT0XCH1,
adcPosSelAPORT0XCH2 = _ADC_SINGLECTRL_POSSEL_APORT0XCH2,
adcPosSelAPORT0XCH3 = _ADC_SINGLECTRL_POSSEL_APORT0XCH3,
adcPosSelAPORT0XCH4 = _ADC_SINGLECTRL_POSSEL_APORT0XCH4,
adcPosSelAPORT0XCH5 = _ADC_SINGLECTRL_POSSEL_APORT0XCH5,
adcPosSelAPORT0XCH6 = _ADC_SINGLECTRL_POSSEL_APORT0XCH6,
adcPosSelAPORT0XCH7 = _ADC_SINGLECTRL_POSSEL_APORT0XCH7,
adcPosSelAPORT0XCH8 = _ADC_SINGLECTRL_POSSEL_APORT0XCH8,
adcPosSelAPORT0XCH9 = _ADC_SINGLECTRL_POSSEL_APORT0XCH9,
adcPosSelAPORT0XCH10 = _ADC_SINGLECTRL_POSSEL_APORT0XCH10,
adcPosSelAPORT0XCH11 = _ADC_SINGLECTRL_POSSEL_APORT0XCH11,
adcPosSelAPORT0XCH12 = _ADC_SINGLECTRL_POSSEL_APORT0XCH12,
adcPosSelAPORT0XCH13 = _ADC_SINGLECTRL_POSSEL_APORT0XCH13,
adcPosSelAPORT0XCH14 = _ADC_SINGLECTRL_POSSEL_APORT0XCH14,
adcPosSelAPORT0XCH15 = _ADC_SINGLECTRL_POSSEL_APORT0XCH15,
adcPosSelAPORT0YCH0 = _ADC_SINGLECTRL_POSSEL_APORT0YCH0,
adcPosSelAPORT0YCH1 = _ADC_SINGLECTRL_POSSEL_APORT0YCH1,
adcPosSelAPORT0YCH2 = _ADC_SINGLECTRL_POSSEL_APORT0YCH2,
adcPosSelAPORT0YCH3 = _ADC_SINGLECTRL_POSSEL_APORT0YCH3,
adcPosSelAPORT0YCH4 = _ADC_SINGLECTRL_POSSEL_APORT0YCH4,
adcPosSelAPORT0YCH5 = _ADC_SINGLECTRL_POSSEL_APORT0YCH5,
adcPosSelAPORT0YCH6 = _ADC_SINGLECTRL_POSSEL_APORT0YCH6,
adcPosSelAPORT0YCH7 = _ADC_SINGLECTRL_POSSEL_APORT0YCH7,
adcPosSelAPORT0YCH8 = _ADC_SINGLECTRL_POSSEL_APORT0YCH8,
adcPosSelAPORT0YCH9 = _ADC_SINGLECTRL_POSSEL_APORT0YCH9,
adcPosSelAPORT0YCH10 = _ADC_SINGLECTRL_POSSEL_APORT0YCH10,
adcPosSelAPORT0YCH11 = _ADC_SINGLECTRL_POSSEL_APORT0YCH11,
adcPosSelAPORT0YCH12 = _ADC_SINGLECTRL_POSSEL_APORT0YCH12,
adcPosSelAPORT0YCH13 = _ADC_SINGLECTRL_POSSEL_APORT0YCH13,
adcPosSelAPORT0YCH14 = _ADC_SINGLECTRL_POSSEL_APORT0YCH14,
adcPosSelAPORT0YCH15 = _ADC_SINGLECTRL_POSSEL_APORT0YCH15,
adcPosSelAPORT1XCH0 = _ADC_SINGLECTRL_POSSEL_APORT1XCH0,
adcPosSelAPORT1YCH1 = _ADC_SINGLECTRL_POSSEL_APORT1YCH1,
adcPosSelAPORT1XCH2 = _ADC_SINGLECTRL_POSSEL_APORT1XCH2,
adcPosSelAPORT1YCH3 = _ADC_SINGLECTRL_POSSEL_APORT1YCH3,
adcPosSelAPORT1XCH4 = _ADC_SINGLECTRL_POSSEL_APORT1XCH4,
adcPosSelAPORT1YCH5 = _ADC_SINGLECTRL_POSSEL_APORT1YCH5,
adcPosSelAPORT1XCH6 = _ADC_SINGLECTRL_POSSEL_APORT1XCH6,
adcPosSelAPORT1YCH7 = _ADC_SINGLECTRL_POSSEL_APORT1YCH7,
adcPosSelAPORT1XCH8 = _ADC_SINGLECTRL_POSSEL_APORT1XCH8,
adcPosSelAPORT1YCH9 = _ADC_SINGLECTRL_POSSEL_APORT1YCH9,
adcPosSelAPORT1XCH10 = _ADC_SINGLECTRL_POSSEL_APORT1XCH10,
adcPosSelAPORT1YCH11 = _ADC_SINGLECTRL_POSSEL_APORT1YCH11,
adcPosSelAPORT1XCH12 = _ADC_SINGLECTRL_POSSEL_APORT1XCH12,
adcPosSelAPORT1YCH13 = _ADC_SINGLECTRL_POSSEL_APORT1YCH13,
adcPosSelAPORT1XCH14 = _ADC_SINGLECTRL_POSSEL_APORT1XCH14,
adcPosSelAPORT1YCH15 = _ADC_SINGLECTRL_POSSEL_APORT1YCH15,
adcPosSelAPORT1XCH16 = _ADC_SINGLECTRL_POSSEL_APORT1XCH16,
adcPosSelAPORT1YCH17 = _ADC_SINGLECTRL_POSSEL_APORT1YCH17,
adcPosSelAPORT1XCH18 = _ADC_SINGLECTRL_POSSEL_APORT1XCH18,
adcPosSelAPORT1YCH19 = _ADC_SINGLECTRL_POSSEL_APORT1YCH19,
adcPosSelAPORT1XCH20 = _ADC_SINGLECTRL_POSSEL_APORT1XCH20,
adcPosSelAPORT1YCH21 = _ADC_SINGLECTRL_POSSEL_APORT1YCH21,
adcPosSelAPORT1XCH22 = _ADC_SINGLECTRL_POSSEL_APORT1XCH22,
adcPosSelAPORT1YCH23 = _ADC_SINGLECTRL_POSSEL_APORT1YCH23,
adcPosSelAPORT1XCH24 = _ADC_SINGLECTRL_POSSEL_APORT1XCH24,
adcPosSelAPORT1YCH25 = _ADC_SINGLECTRL_POSSEL_APORT1YCH25,
adcPosSelAPORT1XCH26 = _ADC_SINGLECTRL_POSSEL_APORT1XCH26,
adcPosSelAPORT1YCH27 = _ADC_SINGLECTRL_POSSEL_APORT1YCH27,
adcPosSelAPORT1XCH28 = _ADC_SINGLECTRL_POSSEL_APORT1XCH28,
adcPosSelAPORT1YCH29 = _ADC_SINGLECTRL_POSSEL_APORT1YCH29,
adcPosSelAPORT1XCH30 = _ADC_SINGLECTRL_POSSEL_APORT1XCH30,
adcPosSelAPORT1YCH31 = _ADC_SINGLECTRL_POSSEL_APORT1YCH31,
adcPosSelAPORT2YCH0 = _ADC_SINGLECTRL_POSSEL_APORT2YCH0,
adcPosSelAPORT2XCH1 = _ADC_SINGLECTRL_POSSEL_APORT2XCH1,
adcPosSelAPORT2YCH2 = _ADC_SINGLECTRL_POSSEL_APORT2YCH2,
adcPosSelAPORT2XCH3 = _ADC_SINGLECTRL_POSSEL_APORT2XCH3,
adcPosSelAPORT2YCH4 = _ADC_SINGLECTRL_POSSEL_APORT2YCH4,
adcPosSelAPORT2XCH5 = _ADC_SINGLECTRL_POSSEL_APORT2XCH5,
adcPosSelAPORT2YCH6 = _ADC_SINGLECTRL_POSSEL_APORT2YCH6,
adcPosSelAPORT2XCH7 = _ADC_SINGLECTRL_POSSEL_APORT2XCH7,
adcPosSelAPORT2YCH8 = _ADC_SINGLECTRL_POSSEL_APORT2YCH8,
adcPosSelAPORT2XCH9 = _ADC_SINGLECTRL_POSSEL_APORT2XCH9,
adcPosSelAPORT2YCH10 = _ADC_SINGLECTRL_POSSEL_APORT2YCH10,
adcPosSelAPORT2XCH11 = _ADC_SINGLECTRL_POSSEL_APORT2XCH11,
adcPosSelAPORT2YCH12 = _ADC_SINGLECTRL_POSSEL_APORT2YCH12,
adcPosSelAPORT2XCH13 = _ADC_SINGLECTRL_POSSEL_APORT2XCH13,
adcPosSelAPORT2YCH14 = _ADC_SINGLECTRL_POSSEL_APORT2YCH14,
adcPosSelAPORT2XCH15 = _ADC_SINGLECTRL_POSSEL_APORT2XCH15,
adcPosSelAPORT2YCH16 = _ADC_SINGLECTRL_POSSEL_APORT2YCH16,
adcPosSelAPORT2XCH17 = _ADC_SINGLECTRL_POSSEL_APORT2XCH17,
adcPosSelAPORT2YCH18 = _ADC_SINGLECTRL_POSSEL_APORT2YCH18,
adcPosSelAPORT2XCH19 = _ADC_SINGLECTRL_POSSEL_APORT2XCH19,
adcPosSelAPORT2YCH20 = _ADC_SINGLECTRL_POSSEL_APORT2YCH20,
adcPosSelAPORT2XCH21 = _ADC_SINGLECTRL_POSSEL_APORT2XCH21,
adcPosSelAPORT2YCH22 = _ADC_SINGLECTRL_POSSEL_APORT2YCH22,
adcPosSelAPORT2XCH23 = _ADC_SINGLECTRL_POSSEL_APORT2XCH23,
adcPosSelAPORT2YCH24 = _ADC_SINGLECTRL_POSSEL_APORT2YCH24,
adcPosSelAPORT2XCH25 = _ADC_SINGLECTRL_POSSEL_APORT2XCH25,
adcPosSelAPORT2YCH26 = _ADC_SINGLECTRL_POSSEL_APORT2YCH26,
adcPosSelAPORT2XCH27 = _ADC_SINGLECTRL_POSSEL_APORT2XCH27,
adcPosSelAPORT2YCH28 = _ADC_SINGLECTRL_POSSEL_APORT2YCH28,
adcPosSelAPORT2XCH29 = _ADC_SINGLECTRL_POSSEL_APORT2XCH29,
adcPosSelAPORT2YCH30 = _ADC_SINGLECTRL_POSSEL_APORT2YCH30,
adcPosSelAPORT2XCH31 = _ADC_SINGLECTRL_POSSEL_APORT2XCH31,
adcPosSelAPORT3XCH0 = _ADC_SINGLECTRL_POSSEL_APORT3XCH0,
adcPosSelAPORT3YCH1 = _ADC_SINGLECTRL_POSSEL_APORT3YCH1,
adcPosSelAPORT3XCH2 = _ADC_SINGLECTRL_POSSEL_APORT3XCH2,
adcPosSelAPORT3YCH3 = _ADC_SINGLECTRL_POSSEL_APORT3YCH3,
adcPosSelAPORT3XCH4 = _ADC_SINGLECTRL_POSSEL_APORT3XCH4,
adcPosSelAPORT3YCH5 = _ADC_SINGLECTRL_POSSEL_APORT3YCH5,
adcPosSelAPORT3XCH6 = _ADC_SINGLECTRL_POSSEL_APORT3XCH6,
adcPosSelAPORT3YCH7 = _ADC_SINGLECTRL_POSSEL_APORT3YCH7,
adcPosSelAPORT3XCH8 = _ADC_SINGLECTRL_POSSEL_APORT3XCH8,
adcPosSelAPORT3YCH9 = _ADC_SINGLECTRL_POSSEL_APORT3YCH9,
adcPosSelAPORT3XCH10 = _ADC_SINGLECTRL_POSSEL_APORT3XCH10,
adcPosSelAPORT3YCH11 = _ADC_SINGLECTRL_POSSEL_APORT3YCH11,
adcPosSelAPORT3XCH12 = _ADC_SINGLECTRL_POSSEL_APORT3XCH12,
adcPosSelAPORT3YCH13 = _ADC_SINGLECTRL_POSSEL_APORT3YCH13,
adcPosSelAPORT3XCH14 = _ADC_SINGLECTRL_POSSEL_APORT3XCH14,
adcPosSelAPORT3YCH15 = _ADC_SINGLECTRL_POSSEL_APORT3YCH15,
adcPosSelAPORT3XCH16 = _ADC_SINGLECTRL_POSSEL_APORT3XCH16,
adcPosSelAPORT3YCH17 = _ADC_SINGLECTRL_POSSEL_APORT3YCH17,
adcPosSelAPORT3XCH18 = _ADC_SINGLECTRL_POSSEL_APORT3XCH18,
adcPosSelAPORT3YCH19 = _ADC_SINGLECTRL_POSSEL_APORT3YCH19,
adcPosSelAPORT3XCH20 = _ADC_SINGLECTRL_POSSEL_APORT3XCH20,
adcPosSelAPORT3YCH21 = _ADC_SINGLECTRL_POSSEL_APORT3YCH21,
adcPosSelAPORT3XCH22 = _ADC_SINGLECTRL_POSSEL_APORT3XCH22,
adcPosSelAPORT3YCH23 = _ADC_SINGLECTRL_POSSEL_APORT3YCH23,
adcPosSelAPORT3XCH24 = _ADC_SINGLECTRL_POSSEL_APORT3XCH24,
adcPosSelAPORT3YCH25 = _ADC_SINGLECTRL_POSSEL_APORT3YCH25,
adcPosSelAPORT3XCH26 = _ADC_SINGLECTRL_POSSEL_APORT3XCH26,
adcPosSelAPORT3YCH27 = _ADC_SINGLECTRL_POSSEL_APORT3YCH27,
adcPosSelAPORT3XCH28 = _ADC_SINGLECTRL_POSSEL_APORT3XCH28,
adcPosSelAPORT3YCH29 = _ADC_SINGLECTRL_POSSEL_APORT3YCH29,
adcPosSelAPORT3XCH30 = _ADC_SINGLECTRL_POSSEL_APORT3XCH30,
adcPosSelAPORT3YCH31 = _ADC_SINGLECTRL_POSSEL_APORT3YCH31,
adcPosSelAPORT4YCH0 = _ADC_SINGLECTRL_POSSEL_APORT4YCH0,
adcPosSelAPORT4XCH1 = _ADC_SINGLECTRL_POSSEL_APORT4XCH1,
adcPosSelAPORT4YCH2 = _ADC_SINGLECTRL_POSSEL_APORT4YCH2,
adcPosSelAPORT4XCH3 = _ADC_SINGLECTRL_POSSEL_APORT4XCH3,
adcPosSelAPORT4YCH4 = _ADC_SINGLECTRL_POSSEL_APORT4YCH4,
adcPosSelAPORT4XCH5 = _ADC_SINGLECTRL_POSSEL_APORT4XCH5,
adcPosSelAPORT4YCH6 = _ADC_SINGLECTRL_POSSEL_APORT4YCH6,
adcPosSelAPORT4XCH7 = _ADC_SINGLECTRL_POSSEL_APORT4XCH7,
adcPosSelAPORT4YCH8 = _ADC_SINGLECTRL_POSSEL_APORT4YCH8,
adcPosSelAPORT4XCH9 = _ADC_SINGLECTRL_POSSEL_APORT4XCH9,
adcPosSelAPORT4YCH10 = _ADC_SINGLECTRL_POSSEL_APORT4YCH10,
adcPosSelAPORT4XCH11 = _ADC_SINGLECTRL_POSSEL_APORT4XCH11,
adcPosSelAPORT4YCH12 = _ADC_SINGLECTRL_POSSEL_APORT4YCH12,
adcPosSelAPORT4XCH13 = _ADC_SINGLECTRL_POSSEL_APORT4XCH13,
adcPosSelAPORT4YCH14 = _ADC_SINGLECTRL_POSSEL_APORT4YCH14,
adcPosSelAPORT4XCH15 = _ADC_SINGLECTRL_POSSEL_APORT4XCH15,
adcPosSelAPORT4YCH16 = _ADC_SINGLECTRL_POSSEL_APORT4YCH16,
adcPosSelAPORT4XCH17 = _ADC_SINGLECTRL_POSSEL_APORT4XCH17,
adcPosSelAPORT4YCH18 = _ADC_SINGLECTRL_POSSEL_APORT4YCH18,
adcPosSelAPORT4XCH19 = _ADC_SINGLECTRL_POSSEL_APORT4XCH19,
adcPosSelAPORT4YCH20 = _ADC_SINGLECTRL_POSSEL_APORT4YCH20,
adcPosSelAPORT4XCH21 = _ADC_SINGLECTRL_POSSEL_APORT4XCH21,
adcPosSelAPORT4YCH22 = _ADC_SINGLECTRL_POSSEL_APORT4YCH22,
adcPosSelAPORT4XCH23 = _ADC_SINGLECTRL_POSSEL_APORT4XCH23,
adcPosSelAPORT4YCH24 = _ADC_SINGLECTRL_POSSEL_APORT4YCH24,
adcPosSelAPORT4XCH25 = _ADC_SINGLECTRL_POSSEL_APORT4XCH25,
adcPosSelAPORT4YCH26 = _ADC_SINGLECTRL_POSSEL_APORT4YCH26,
adcPosSelAPORT4XCH27 = _ADC_SINGLECTRL_POSSEL_APORT4XCH27,
adcPosSelAPORT4YCH28 = _ADC_SINGLECTRL_POSSEL_APORT4YCH28,
adcPosSelAPORT4XCH29 = _ADC_SINGLECTRL_POSSEL_APORT4XCH29,
adcPosSelAPORT4YCH30 = _ADC_SINGLECTRL_POSSEL_APORT4YCH30,
adcPosSelAPORT4XCH31 = _ADC_SINGLECTRL_POSSEL_APORT4XCH31,
adcPosSelAVDD = _ADC_SINGLECTRL_POSSEL_AVDD,
adcPosSelBUVDD = _ADC_SINGLECTRL_POSSEL_BUVDD,
adcPosSelDVDD = _ADC_SINGLECTRL_POSSEL_DVDD,
adcPosSelPAVDD = _ADC_SINGLECTRL_POSSEL_PAVDD,
adcPosSelDECOUPLE = _ADC_SINGLECTRL_POSSEL_DECOUPLE,
adcPosSelIOVDD = _ADC_SINGLECTRL_POSSEL_IOVDD,
adcPosSelIOVDD1 = _ADC_SINGLECTRL_POSSEL_IOVDD1,
adcPosSelVSP = _ADC_SINGLECTRL_POSSEL_VSP,
adcPosSelOPA2 = _ADC_SINGLECTRL_POSSEL_OPA2,
adcPosSelTEMP = _ADC_SINGLECTRL_POSSEL_TEMP,
adcPosSelDAC0OUT0 = _ADC_SINGLECTRL_POSSEL_DAC0OUT0,
adcPosSelR5VOUT = _ADC_SINGLECTRL_POSSEL_R5VOUT,
adcPosSelSP1 = _ADC_SINGLECTRL_POSSEL_SP1,
adcPosSelSP2 = _ADC_SINGLECTRL_POSSEL_SP2,
adcPosSelDAC0OUT1 = _ADC_SINGLECTRL_POSSEL_DAC0OUT1,
adcPosSelSUBLSB = _ADC_SINGLECTRL_POSSEL_SUBLSB,
adcPosSelOPA3 = _ADC_SINGLECTRL_POSSEL_OPA3,
adcPosSelDEFAULT = _ADC_SINGLECTRL_POSSEL_DEFAULT,
adcPosSelVSS = _ADC_SINGLECTRL_POSSEL_VSS
}
Positive input selection for single and scan conversion.
enum ADC_NegSel_TypeDef {
adcNegSelAPORT0XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH0,
adcNegSelAPORT0XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH1,
adcNegSelAPORT0XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH2,
adcNegSelAPORT0XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH3,
adcNegSelAPORT0XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH4,
adcNegSelAPORT0XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH5,
adcNegSelAPORT0XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH6,
adcNegSelAPORT0XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH7,
adcNegSelAPORT0XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH8,
adcNegSelAPORT0XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH9,
adcNegSelAPORT0XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH10,
adcNegSelAPORT0XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH11,
adcNegSelAPORT0XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH12,
adcNegSelAPORT0XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH13,
adcNegSelAPORT0XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH14,
adcNegSelAPORT0XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH15,
adcNegSelAPORT0YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH0,
adcNegSelAPORT0YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH1,
adcNegSelAPORT0YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH2,
adcNegSelAPORT0YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH3,
adcNegSelAPORT0YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH4,
adcNegSelAPORT0YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH5,
adcNegSelAPORT0YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH6,
adcNegSelAPORT0YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH7,
adcNegSelAPORT0YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH8,
adcNegSelAPORT0YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH9,
adcNegSelAPORT0YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH10,
adcNegSelAPORT0YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH11,
adcNegSelAPORT0YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH12,
adcNegSelAPORT0YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH13,
adcNegSelAPORT0YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH14,
adcNegSelAPORT0YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH15,
adcNegSelAPORT1XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH0,
adcNegSelAPORT1YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH1,
adcNegSelAPORT1XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH2,
adcNegSelAPORT1YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH3,
adcNegSelAPORT1XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH4,
adcNegSelAPORT1YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH5,
adcNegSelAPORT1XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH6,
adcNegSelAPORT1YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH7,
adcNegSelAPORT1XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH8,
adcNegSelAPORT1YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH9,
adcNegSelAPORT1XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH10,
adcNegSelAPORT1YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH11,
adcNegSelAPORT1XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH12,
adcNegSelAPORT1YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH13,
adcNegSelAPORT1XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH14,
adcNegSelAPORT1YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH15,
adcNegSelAPORT1XCH16 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH16,
adcNegSelAPORT1YCH17 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH17,
adcNegSelAPORT1XCH18 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH18,
adcNegSelAPORT1YCH19 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH19,
adcNegSelAPORT1XCH20 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH20,
adcNegSelAPORT1YCH21 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH21,
adcNegSelAPORT1XCH22 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH22,
adcNegSelAPORT1YCH23 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH23,
adcNegSelAPORT1XCH24 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH24,
adcNegSelAPORT1YCH25 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH25,
adcNegSelAPORT1XCH26 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH26,
adcNegSelAPORT1YCH27 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH27,
adcNegSelAPORT1XCH28 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH28,
adcNegSelAPORT1YCH29 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH29,
adcNegSelAPORT1XCH30 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH30,
adcNegSelAPORT1YCH31 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH31,
adcNegSelAPORT2YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH0,
adcNegSelAPORT2XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH1,
adcNegSelAPORT2YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH2,
adcNegSelAPORT2XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH3,
adcNegSelAPORT2YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH4,
adcNegSelAPORT2XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH5,
adcNegSelAPORT2YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH6,
adcNegSelAPORT2XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH7,
adcNegSelAPORT2YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH8,
adcNegSelAPORT2XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH9,
adcNegSelAPORT2YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH10,
adcNegSelAPORT2XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH11,
adcNegSelAPORT2YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH12,
adcNegSelAPORT2XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH13,
adcNegSelAPORT2YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH14,
adcNegSelAPORT2XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH15,
adcNegSelAPORT2YCH16 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH16,
adcNegSelAPORT2XCH17 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH17,
adcNegSelAPORT2YCH18 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH18,
adcNegSelAPORT2XCH19 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH19,
adcNegSelAPORT2YCH20 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH20,
adcNegSelAPORT2XCH21 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH21,
adcNegSelAPORT2YCH22 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH22,
adcNegSelAPORT2XCH23 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH23,
adcNegSelAPORT2YCH24 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH24,
adcNegSelAPORT2XCH25 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH25,
adcNegSelAPORT2YCH26 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH26,
adcNegSelAPORT2XCH27 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH27,
adcNegSelAPORT2YCH28 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH28,
adcNegSelAPORT2XCH29 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH29,
adcNegSelAPORT2YCH30 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH30,
adcNegSelAPORT2XCH31 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH31,
adcNegSelAPORT3XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH0,
adcNegSelAPORT3YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH1,
adcNegSelAPORT3XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH2,
adcNegSelAPORT3YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH3,
adcNegSelAPORT3XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH4,
adcNegSelAPORT3YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH5,
adcNegSelAPORT3XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH6,
adcNegSelAPORT3YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH7,
adcNegSelAPORT3XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH8,
adcNegSelAPORT3YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH9,
adcNegSelAPORT3XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH10,
adcNegSelAPORT3YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH11,
adcNegSelAPORT3XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH12,
adcNegSelAPORT3YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH13,
adcNegSelAPORT3XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH14,
adcNegSelAPORT3YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH15,
adcNegSelAPORT3XCH16 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH16,
adcNegSelAPORT3YCH17 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH17,
adcNegSelAPORT3XCH18 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH18,
adcNegSelAPORT3YCH19 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH19,
adcNegSelAPORT3XCH20 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH20,
adcNegSelAPORT3YCH21 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH21,
adcNegSelAPORT3XCH22 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH22,
adcNegSelAPORT3YCH23 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH23,
adcNegSelAPORT3XCH24 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH24,
adcNegSelAPORT3YCH25 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH25,
adcNegSelAPORT3XCH26 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH26,
adcNegSelAPORT3YCH27 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH27,
adcNegSelAPORT3XCH28 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH28,
adcNegSelAPORT3YCH29 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH29,
adcNegSelAPORT3XCH30 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH30,
adcNegSelAPORT3YCH31 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH31,
adcNegSelAPORT4YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH0,
adcNegSelAPORT4XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH1,
adcNegSelAPORT4YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH2,
adcNegSelAPORT4XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH3,
adcNegSelAPORT4YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH4,
adcNegSelAPORT4XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH5,
adcNegSelAPORT4YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH6,
adcNegSelAPORT4XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH7,
adcNegSelAPORT4YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH8,
adcNegSelAPORT4XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH9,
adcNegSelAPORT4YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH10,
adcNegSelAPORT4XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH11,
adcNegSelAPORT4YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH12,
adcNegSelAPORT4XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH13,
adcNegSelAPORT4YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH14,
adcNegSelAPORT4XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH15,
adcNegSelAPORT4YCH16 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH16,
adcNegSelAPORT4XCH17 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH17,
adcNegSelAPORT4YCH18 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH18,
adcNegSelAPORT4XCH19 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH19,
adcNegSelAPORT4YCH20 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH20,
adcNegSelAPORT4XCH21 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH21,
adcNegSelAPORT4YCH22 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH22,
adcNegSelAPORT4XCH23 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH23,
adcNegSelAPORT4YCH24 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH24,
adcNegSelAPORT4XCH25 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH25,
adcNegSelAPORT4YCH26 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH26,
adcNegSelAPORT4XCH27 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH27,
adcNegSelAPORT4YCH28 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH28,
adcNegSelAPORT4XCH29 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH29,
adcNegSelAPORT4YCH30 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH30,
adcNegSelAPORT4XCH31 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH31,
adcNegSelTESTN = _ADC_SINGLECTRL_NEGSEL_TESTN,
adcNegSelDEFAULT = _ADC_SINGLECTRL_NEGSEL_DEFAULT,
adcNegSelVSS = _ADC_SINGLECTRL_NEGSEL_VSS
}
Negative input selection for single and scan conversion.
enum ADC_ScanInputGroup_TypeDef {
adcScanInputGroup0 = 0,
adcScanInputGroup1 = 1,
adcScanInputGroup2 = 2,
adcScanInputGroup3 = 3
}
ADC scan input groups.
enum ADC_ScanNegInput_TypeDef {
adcScanNegInput1 = 1,
adcScanNegInput3 = 3,
adcScanNegInput5 = 5,
adcScanNegInput7 = 7,
adcScanNegInput8 = 8,
adcScanNegInput10 = 10,
adcScanNegInput12 = 12,
adcScanNegInput14 = 14,
adcScanNegInputDefault = 0xFF
}
ADC scan alternative negative inputs.
enum ADC_Start_TypeDef {
adcStartSingle = ADC_CMD_SINGLESTART,
adcStartScan = ADC_CMD_SCANSTART,
adcStartScanAndSingle = ADC_CMD_SCANSTART | ADC_CMD_SINGLESTART
}
ADC start command.
enum ADC_Warmup_TypeDef {
adcWarmupNormal = _ADC_CTRL_WARMUPMODE_NORMAL,
adcWarmupKeepInStandby = _ADC_CTRL_WARMUPMODE_KEEPINSTANDBY,
adcWarmupKeepInSlowAcq = _ADC_CTRL_WARMUPMODE_KEEPINSLOWACC,
adcWarmupKeepADCWarm = _ADC_CTRL_WARMUPMODE_KEEPADCWARM
}
Warm-up mode.
enum ADC_EM2ClockConfig_TypeDef {
adcEm2Disabled = 0,
adcEm2ClockOnDemand = ADC_CTRL_ADCCLKMODE_ASYNC | ADC_CTRL_ASYNCCLKEN_ASNEEDED,
adcEm2ClockAlwaysOn = ADC_CTRL_ADCCLKMODE_ASYNC | ADC_CTRL_ASYNCCLKEN_ALWAYSON
}
ADC EM2 clock configuration.

Function Documentation

ADC_DataSingleGet()

uint32_t ADC_DataSingleGet ( ADC_TypeDef * adc )
inline

Get a single conversion result.

Note
Check data valid flag before calling this function.
Parameters
[in] adc A pointer to the ADC peripheral register block.
Returns
Single conversion data.

ADC_DataSinglePeek()

uint32_t ADC_DataSinglePeek ( ADC_TypeDef * adc )
inline

Peek single conversion result.

Note
Check data valid flag before calling this function.
Parameters
[in] adc A pointer to the ADC peripheral register block.
Returns
Single conversion data.

ADC_DataScanGet()

uint32_t ADC_DataScanGet ( ADC_TypeDef * adc )
inline

Get a scan result.

Note
Check data valid flag before calling this function.
Parameters
[in] adc A pointer to the ADC peripheral register block.
Returns
Scan conversion data.

ADC_DataScanPeek()

uint32_t ADC_DataScanPeek ( ADC_TypeDef * adc )
inline

Peek scan result.

Note
Check data valid flag before calling this function.
Parameters
[in] adc A pointer to the ADC peripheral register block.
Returns
Scan conversion data.

ADC_DataIdScanGet()

uint32_t ADC_DataIdScanGet ( ADC_TypeDef * adc,
uint32_t * scanId
)

Get a scan result and scan select ID.

Note
Only use if scan data valid. This function does not check the DV flag. The return value is meant to be used as an index for the scan select ID.
Parameters
[in] adc A pointer to the ADC peripheral register block.
[out] scanId A scan select ID of the first data in the scan FIFO.
Returns
The first scan data in the scan FIFO.

ADC_Init()

void ADC_Init ( ADC_TypeDef * adc,
const ADC_Init_TypeDef * init
)

Initialize ADC.

Initializes common parts for both single conversion and scan sequence. In addition, single and/or scan control configuration must be done. See ADC_InitSingle() and ADC_InitScan() respectively. For ADC architectures with the ADCn->SCANINPUTSEL register, use ADC_ScanSingleEndedInputAdd() to configure single-ended scan inputs or ADC_ScanDifferentialInputAdd() to configure differential scan inputs. ADC_ScanInputClear() is also provided for applications that need to update the input configuration.

Note
This function will stop any ongoing conversion.
Parameters
[in] adc A pointer to the ADC peripheral register block.
[in] init A pointer to the ADC initialization structure.

ADC_Reset()

void ADC_Reset ( ADC_TypeDef * adc )

Reset ADC to a state that it was in after a hardware reset.

Note
The ROUTE register is NOT reset by this function to allow a centralized setup of this feature.
Parameters
[in] adc A pointer to ADC peripheral register block.

ADC_InitScan()

void ADC_InitScan ( ADC_TypeDef * adc,
const ADC_InitScan_TypeDef * init
)

Initialize the ADC scan sequence.

See ADC_Start() for starting a scan sequence.

When selecting an external reference, the gain and offset calibration must be set explicitly (CAL register). For other references, the calibration is updated with values defined during manufacturing. For ADC architectures with the ADCn->SCANINPUTSEL register, use ADC_ScanSingleEndedInputAdd() to configure single-ended scan inputs or ADC_ScanDifferentialInputAdd() to configure differential scan inputs. ADC_ScanInputClear() is also provided for applications that need to update the input configuration.

Note
This function will stop any ongoing scan sequence.
Parameters
[in] adc A pointer to the ADC peripheral register block.
[in] init A pointer to the ADC initialization structure.

ADC_ScanInputClear()

void ADC_ScanInputClear ( ADC_InitScan_TypeDef * scanInit )

Clear ADC scan input configuration.

Parameters
[in] scanInit Structure to hold the scan configuration and input configuration.

ADC_ScanSingleEndedInputAdd()

uint32_t ADC_ScanSingleEndedInputAdd ( ADC_InitScan_TypeDef * scanInit,
ADC_ScanInputGroup_TypeDef inputGroup,
ADC_PosSel_TypeDef singleEndedSel
)

Initialize ADC scan single-ended input configuration.

Set a configuration for ADC scan conversion with single-ended inputs. The ADC_InitScan_TypeDef structure updated from this function will be passed to ADC_InitScan() .

Parameters
[in] scanInit ADC scan initialization structure
[in] inputGroup ADC scan input group. See section 25.3.4 in the reference manual for more information.
[in] singleEndedSel APORT select.
Returns
Scan ID of selected ADC input. See section 25.3.4 in the reference manual for more information. Note that the returned integer represents the bit position in ADCn_SCANMASK set by this function. The accumulated mask is stored in scanInit->scanInputConfig->scanInputEn.

ADC_ScanDifferentialInputAdd()

uint32_t ADC_ScanDifferentialInputAdd ( ADC_InitScan_TypeDef * scanInit,
ADC_ScanInputGroup_TypeDef inputGroup,
ADC_PosSel_TypeDef posSel,
ADC_ScanNegInput_TypeDef negInput
)

Initialize the ADC scan differential input configuration.

Set a configuration for the ADC scan conversion with differential inputs. The ADC_InitScan_TypeDef structure updated by this function should be passed to ADC_InitScan() .

Parameters
[in] scanInit Structure to hold the scan and input configuration.
[in] inputGroup ADC scan input group. See section 25.3.4 in the reference manual for more information.
[in] posSel APORT bus pair select. The negative terminal is implicitly selected by the positive terminal.
[in] negInput ADC scan alternative negative input. Set to adcScanNegInputDefault to select a default negative input (implicit from posSel).
Returns
Scan ID of the selected ADC input. See section 25.3.4 in the reference manual for more information. Note that the returned integer represents the bit position in ADCn_SCANMASK set by this function. The accumulated mask is stored in the scanInit->scanInputConfig->scanInputEn.

ADC_InitSingle()

void ADC_InitSingle ( ADC_TypeDef * adc,
const ADC_InitSingle_TypeDef * init
)

Initialize the single ADC sample conversion.

See ADC_Start() for starting a single conversion.

When selecting an external reference, the gain and offset calibration must be set explicitly (CAL register). For other references, the calibration is updated with values defined during manufacturing.

Note
This function will stop any ongoing single conversion.
This function will set the BIASPROG_GPBIASACC bit when selecting the internal temperature sensor and clear the bit otherwise. Any application that depends on the state of the BIASPROG_GPBIASACC bit should modify it after a call to this function.
Parameters
[in] adc A pointer to the ADC peripheral register block.
[in] init A pointer to the ADC initialization structure.

ADC_TimebaseCalc()

uint8_t ADC_TimebaseCalc ( uint32_t hfperFreq )

Calculate a timebase value to get a timebase providing at least 1 us.

Parameters
[in] hfperFreq Frequency in Hz of the reference HFPER/HFPERC clock. Set to 0 to use currently defined HFPER/HFPERC clock setting.
Returns
A timebase value to use for ADC to achieve at least 1 us.

ADC_PrescaleCalc()

uint8_t ADC_PrescaleCalc ( uint32_t adcFreq,
uint32_t hfperFreq
)

Calculate the prescaler value used to determine the ADC clock.

The ADC clock is given by: (HFPERCLK or HFPERCCLK) / (prescale + 1).

Note
The return value is clamped to the maximum prescaler value that the hardware supports.
Parameters
[in] adcFreq ADC frequency wanted. The frequency will automatically be adjusted to a valid range according to the reference manual.
[in] hfperFreq Frequency in Hz of reference HFPER/HFPERC clock. Set to 0 to use currently defined HFPER/HFPERC clock setting.
Returns
A prescaler value to use for ADC in order to achieve a clock value <= adcFreq .

ADC_IntClear()

void ADC_IntClear ( ADC_TypeDef * adc,
uint32_t flags
)
inline

Clear one or more pending ADC interrupts.

Parameters
[in] adc A pointer to the ADC peripheral register block.
[in] flags Pending ADC interrupt source to clear. Use a bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).

ADC_IntDisable()

void ADC_IntDisable ( ADC_TypeDef * adc,
uint32_t flags
)
inline

Disable one or more ADC interrupts.

Parameters
[in] adc A pointer to the ADC peripheral register block.
[in] flags ADC interrupt sources to disable. Use a bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).

ADC_IntEnable()

void ADC_IntEnable ( ADC_TypeDef * adc,
uint32_t flags
)
inline

Enable one or more ADC interrupts.

Note
Depending on use, a pending interrupt may already be set prior to enabling the interrupt. Consider using ADC_IntClear() prior to enabling if the pending interrupt should be ignored.
Parameters
[in] adc A pointer to the ADC peripheral register block.
[in] flags ADC interrupt sources to enable. Use a bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).

ADC_IntGet()

uint32_t ADC_IntGet ( ADC_TypeDef * adc )
inline

Get pending ADC interrupt flags.

Note
This function does not clear event bits.
Parameters
[in] adc A pointer to the ADC peripheral register block.
Returns
ADC interrupt sources pending. A bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).

ADC_IntGetEnabled()

uint32_t ADC_IntGetEnabled ( ADC_TypeDef * adc )
inline

Get enabled and pending ADC interrupt flags.

Useful for handling more interrupt sources in the same interrupt handler.

Parameters
[in] adc A pointer to the ADC peripheral register block.
Note
This function does not clear interrupt flags.
Returns
Pending and enabled ADC interrupt sources. The return value is the bitwise AND combination of
  • the OR combination of enabled interrupt sources in ADCx_IEN_nnn register (ADCx_IEN_nnn) and
  • the OR combination of valid interrupt flags of the ADC module (ADCx_IF_nnn).

ADC_IntSet()

void ADC_IntSet ( ADC_TypeDef * adc,
uint32_t flags
)
inline

Set one or more pending ADC interrupts from software.

Parameters
[in] adc A pointer to the ADC peripheral register block.
[in] flags ADC interrupt sources to set to pending. Use a bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).

ADC_Start()

void ADC_Start ( ADC_TypeDef * adc,
ADC_Start_TypeDef cmd
)
inline

Start scan sequence and/or single conversion.

Parameters
[in] adc A pointer to the ADC peripheral register block.
[in] cmd A command indicating which type of sampling to start.

Macro Definition Documentation

ADC_CTRLX_VREFSEL_REG

#define ADC_CTRLX_VREFSEL_REG   0x80UL

Single and scan mode voltage references.

Using unshifted enumerations and or in ADC_CTRLX_VREFSEL_REG to select the extension register CTRLX_VREFSEL.

ADC_SCANINPUTSEL_GROUP_NONE

#define ADC_SCANINPUTSEL_GROUP_NONE   0xFFU

Define none selected group for ADC_SCANINPUTSEL.

ADC_SCANINPUTSEL_NONE

#define ADC_SCANINPUTSEL_NONE
Value:
<< _ADC_SCANINPUTSEL_INPUT0TO7SEL_SHIFT) \
<< _ADC_SCANINPUTSEL_INPUT8TO15SEL_SHIFT) \
<< _ADC_SCANINPUTSEL_INPUT16TO23SEL_SHIFT) \
<< _ADC_SCANINPUTSEL_INPUT24TO31SEL_SHIFT))

Define none selected for ADC_SCANINPUTSEL.

ADC_INIT_DEFAULT

#define ADC_INIT_DEFAULT
Value:
{ \
adcOvsRateSel2, /* 2x oversampling (if enabled). */ \
adcWarmupNormal, /* ADC shutdown after each conversion. */ \
_ADC_CTRL_TIMEBASE_DEFAULT, /* Use hardware default value. */ \
_ADC_CTRL_PRESC_DEFAULT, /* Use hardware default value. */ \
false, /* Do not use tailgate. */ \
adcEm2Disabled /* ADC disabled in EM2. */ \
}

Default configuration for ADC initialization structure.

ADC_INITSCAN_DEFAULT

#define ADC_INITSCAN_DEFAULT
Value:
{ \
adcPRSSELCh0, /* PRS ch0 (if enabled). */ \
adcAcqTime1, /* 1 ADC_CLK cycle acquisition time. */ \
adcRef1V25, /* 1.25 V internal reference. */ \
adcRes12Bit, /* 12 bit resolution. */ \
{ \
/* Initialization should match values set by @ref ADC_ScanInputClear(). */ \
ADC_SCANINPUTSEL_NONE, /* Default ADC inputs. */ \
0, /* Default input mask (all off). */ \
_ADC_SCANNEGSEL_RESETVALUE, /* Default negative select for positive terminal. */ \
}, \
false, /* Single-ended input. */ \
false, /* PRS disabled. */ \
false, /* Right adjust. */ \
false, /* Deactivate conversion after one scan sequence. */ \
false, /* No EM2 DMA wakeup from scan FIFO DVL. */ \
false /* Discard new data on full FIFO. */ \
}

Default configuration for ADC scan initialization structure.

ADC_INITSINGLE_DEFAULT

#define ADC_INITSINGLE_DEFAULT
Value:
{ \
adcPRSSELCh0, /* PRS ch0 (if enabled). */ \
adcAcqTime1, /* 1 ADC_CLK cycle acquisition time. */ \
adcRef1V25, /* 1.25 V internal reference. */ \
adcRes12Bit, /* 12 bit resolution. */ \
adcPosSelAPORT0XCH0, /* Select node BUS0XCH0 as posSel */ \
adcNegSelVSS, /* Select VSS as negSel */ \
false, /* Single-ended input. */ \
false, /* PRS disabled. */ \
false, /* Right adjust. */ \
false, /* Deactivate conversion after one scan sequence. */ \
false, /* No EM2 DMA wakeup from single FIFO DVL */ \
false /* Discard new data on full FIFO. */ \
}

Default configuration for ADC single conversion initialization structure.

Enumeration Type Documentation

ADC_AcqTime_TypeDef

Acquisition time (in ADC clock cycles).

Enumerator
adcAcqTime1

1 clock cycle.

adcAcqTime2

2 clock cycles.

adcAcqTime4

4 clock cycles.

adcAcqTime8

8 clock cycles.

adcAcqTime16

16 clock cycles.

adcAcqTime32

32 clock cycles.

adcAcqTime64

64 clock cycles.

adcAcqTime128

128 clock cycles.

adcAcqTime256

256 clock cycles.

ADC_OvsRateSel_TypeDef

Oversample rate select.

Enumerator
adcOvsRateSel2

2 samples per conversion result.

adcOvsRateSel4

4 samples per conversion result.

adcOvsRateSel8

8 samples per conversion result.

adcOvsRateSel16

16 samples per conversion result.

adcOvsRateSel32

32 samples per conversion result.

adcOvsRateSel64

64 samples per conversion result.

adcOvsRateSel128

128 samples per conversion result.

adcOvsRateSel256

256 samples per conversion result.

adcOvsRateSel512

512 samples per conversion result.

adcOvsRateSel1024

1024 samples per conversion result.

adcOvsRateSel2048

2048 samples per conversion result.

adcOvsRateSel4096

4096 samples per conversion result.

ADC_PRSSEL_TypeDef

Peripheral Reflex System signal used to trigger a single sample.

Enumerator
adcPRSSELCh0

PRS channel 0.

adcPRSSELCh1

PRS channel 1.

adcPRSSELCh2

PRS channel 2.

adcPRSSELCh3

PRS channel 3.

adcPRSSELCh4

PRS channel 4.

adcPRSSELCh5

PRS channel 5.

adcPRSSELCh6

PRS channel 6.

adcPRSSELCh7

PRS channel 7.

adcPRSSELCh8

PRS channel 8.

adcPRSSELCh9

PRS channel 9.

adcPRSSELCh10

PRS channel 10.

adcPRSSELCh11

PRS channel 11.

adcPRSSELCh12

PRS channel 12.

adcPRSSELCh13

PRS channel 13.

adcPRSSELCh14

PRS channel 14.

adcPRSSELCh15

PRS channel 15.

ADC_Ref_TypeDef

ADC Reference.

Enumerator
adcRef1V25

Internal 1.25 V reference.

adcRef2V5

Internal 2.5 V reference.

adcRefVDD

Buffered VDD.

adcRef5V

Internal 5 V reference.

adcRefExtSingle

Single-ended external reference from pin 6.

adcRef2xExtDiff

Differential external reference from pin 6 and 7.

adcRef2xVDD

Unbuffered 2xVDD.

adcRefVBGR

Custom VFS: Internal Bandgap reference.

adcRefVddxAtt

Custom VFS: Scaled AVDD: AVDD * VREFATT.

adcRefVPxAtt

Custom VFS: Scaled singled ended external reference from pin 6: VREFP * VREFATT.

adcRefP

Custom VFS: Raw single-ended external reference from pin 6.

adcRefVEntropy

Custom VFS: Special mode for entropy generation.

adcRefVPNxAtt

Custom VFS: Scaled differential external Vref from pin 6 and 7: (VREFP - VREFN) * VREFATT.

adcRefPN

Custom VFS: Raw differential external Vref from pin 6 and 7: VREFP - VREFN.

ADC_Res_TypeDef

Sample resolution.

Enumerator
adcRes12Bit

12 bit sampling.

adcRes8Bit

8 bit sampling.

adcRes6Bit

6 bit sampling.

adcResOVS

Oversampling.

ADC_PosSel_TypeDef

Positive input selection for single and scan conversion.

ADC_NegSel_TypeDef

Negative input selection for single and scan conversion.

ADC_ScanInputGroup_TypeDef

ADC scan input groups.

ADC_ScanNegInput_TypeDef

ADC scan alternative negative inputs.

ADC_Start_TypeDef

ADC start command.

Enumerator
adcStartSingle

Start a single conversion.

adcStartScan

Start a scan sequence.

adcStartScanAndSingle

Start a scan sequence and single conversion, typically used when tailgating a single conversion after a scan sequence.

ADC_Warmup_TypeDef

Warm-up mode.

Enumerator
adcWarmupNormal

ADC shutdown after each conversion.

adcWarmupKeepInStandby

ADC is kept in standby mode between conversions.

1 us warmup time needed before the next conversion.

adcWarmupKeepInSlowAcq

ADC is kept in slow acquisition mode between conversions.

1 us warmup time needed before the next conversion.

adcWarmupKeepADCWarm

ADC and reference selected for scan mode kept at warmup allowing continuous conversion.

ADC_EM2ClockConfig_TypeDef

ADC EM2 clock configuration.