EasyManuals Logo

ST STM32F2 User Manual

ST STM32F2
1371 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #98 background imageLoading...
Page #98 background image
HAL ADC Extension Driver
UM1940
98/1371
DocID028236 Rev 2
Field Documentation
uint32_t ADC_MultiModeTypeDef::Mode
Configures the ADC to operate in independent or multi mode. This parameter can be a
value of ADCEx_Common_mode
uint32_t ADC_MultiModeTypeDef::DMAAccessMode
Configures the Direct memory access mode for multi ADC mode. This parameter can
be a value of ADCEx_Direct_memory_access_mode_for_multi_mode
uint32_t ADC_MultiModeTypeDef::TwoSamplingDelay
Configures the Delay between 2 sampling phases. This parameter can be a value of
ADC_delay_between_2_sampling_phases
7.2 ADCEx Firmware driver API description
7.2.1 How to use this driver
1. Initialize the ADC low level resources by implementing the HAL_ADC_MspInit():
a. Enable the ADC interface clock using __HAL_RCC_ADC_CLK_ENABLE()
b. ADC pins configuration
Enable the clock for the ADC GPIOs using the following function:
__HAL_RCC_GPIOx_CLK_ENABLE()
Configure these ADC pins in analog mode using HAL_GPIO_Init()
c. In case of using interrupts (e.g. HAL_ADC_Start_IT())
Configure the ADC interrupt priority using HAL_NVIC_SetPriority()
Enable the ADC IRQ handler using HAL_NVIC_EnableIRQ()
In ADC IRQ handler, call HAL_ADC_IRQHandler()
d. In case of using DMA to control data transfer (e.g. HAL_ADC_Start_DMA())
Enable the DMAx interface clock using
__HAL_RCC_DMAx_CLK_ENABLE()
Configure and enable two DMA streams stream for managing data transfer
from peripheral to memory (output stream)
Associate the initialized DMA handle to the ADC DMA handle using
__HAL_LINKDMA()
Configure the priority and enable the NVIC for the transfer complete interrupt
on the two DMA Streams. The output stream should have higher priority
than the input stream.
2. Configure the ADC Prescaler, conversion resolution and data alignment using the
HAL_ADC_Init() function.
3. Configure the ADC Injected channels group features, use HAL_ADC_Init() and
HAL_ADC_ConfigChannel() functions.
4. Three operation modes are available within this driver :
Polling mode IO operation
Start the ADC peripheral using HAL_ADCEx_InjectedStart()
Wait for end of conversion using HAL_ADC_PollForConversion(), at this stage user
can specify the value of timeout according to his end application
To read the ADC converted values, use the HAL_ADCEx_InjectedGetValue() function.
Stop the ADC peripheral using HAL_ADCEx_InjectedStop()
Interrupt mode IO operation
Start the ADC peripheral using HAL_ADCEx_InjectedStart_IT()
Use HAL_ADC_IRQHandler() called under ADC_IRQHandler() Interrupt subroutine

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F2 and is the answer not in the manual?

ST STM32F2 Specifications

General IconGeneral
BrandST
ModelSTM32F2
CategoryMicrocontrollers
LanguageEnglish

Related product manuals