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

void ADC_Init (ADC_TypeDef *adc, const ADC_Init_TypeDef *init)
Initialize ADC.
void ADC_InitScan (ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init)
Initialize the ADC scan sequence.
void ADC_InitSingle (ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init)
Initialize the single ADC sample conversion.
uint8_t ADC_PrescaleCalc (uint32_t adcFreq, uint32_t hfperFreq)
Calculate the prescaler value used to determine the ADC clock.
void ADC_Reset (ADC_TypeDef *adc)
Reset ADC to a state that it was in after a hardware reset.
uint8_t ADC_TimebaseCalc (uint32_t hfperFreq)
Calculate a timebase value to get a timebase providing at least 1 us.
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.
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_INIT_DEFAULT
Default configuration for ADC initialization structure.
#define ADC_INITSCAN_DEFAULT
Default configuration for ADC scan initialization structure.