Analog-to-digital converter (ADC)
ï‚· uint32_t ADC_TypeDef::RESERVED9
ï€ Reserved, 0x0AC
ï‚· __IO uint32_t ADC_TypeDef::DIFSEL
ï€ ADC Differential Mode Selection Register, Address offset: 0xB0
ï‚· __IO uint32_t ADC_TypeDef::CALFACT
ï€ ADC Calibration Factors, Address offset: 0xB4
3.2 ADC Firmware driver API description
The following section lists the various functions of the ADC library.
3.2.1 How to use this driver
1. select the ADC clock using the function RCC_ADCCLKConfig()
2. Enable the ADC interface clock using RCC_AHBPeriphClockCmd();
3. ADC pins configuration
ï€ Enable the clock for the ADC GPIOs using the following function:
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOx, ENABLE);
ï€ Configure these ADC pins in analog mode using GPIO_Init();
4. Configure the ADC conversion resolution, data alignment, external trigger and edge,
sequencer lenght and Enable/Disable the continuous mode using the ADC_Init()
function.
5. Activate the ADC peripheral using ADC_Cmd() function.
ADC channels group configuration
ï‚· To configure the ADC channels features, use ADC_Init(), ADC_InjectedInit() and
ADC_RegularChannelConfig() functions or/and ADC_InjectedChannelConfig()
ï‚· To activate the continuous mode, use the ADC_ContinuousModeCmd() function.
ï‚· To activate the Discontinuous mode, use the ADC_DiscModeCmd() functions.
ï‚· To activate the overrun mode, use the ADC_OverrunModeCmd() functions.
ï‚· To activate the calibration mode, use the ADC_StartCalibration() functions.
ï‚· To read the ADC converted values, use the ADC_GetConversionValue() function.
DMA for ADC channels features configuration
ï‚· To enable the DMA mode for ADC channels group, use the ADC_DMACmd()
function.
ï‚· To configure the DMA transfer request, use ADC_DMAConfig() function.
3.2.2 Initialization and Configuration functions
This section provides functions allowing to:
1. Initialize and configure the ADC injected and/or regular channels and dual mode.
2. Management of the calibration process
3. ADC Power-on Power-off