Adcex Firmware Driver Api Description; How To Use This Driver - ST STM32F2 User Manual

Description of stm32f2 hal and low layer drivers
Hide thumbs Also See for STM32F2:
Table of Contents

Advertisement

HAL ADC Extension Driver
Field Documentation
uint32_t ADC_MultiModeTypeDef::Mode
Configures the ADC to operate in independent or multi mode. This parameter can be a
value of
uint32_t ADC_MultiModeTypeDef::DMAAccessMode
Configures the Direct memory access mode for multi ADC mode. This parameter can
be a value of
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.
b.
c.
d.
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
98/1371
ADCEx_Common_mode
ADCEx_Direct_memory_access_mode_for_multi_mode
Enable the ADC interface clock using __HAL_RCC_ADC_CLK_ENABLE()
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()
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()
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.
DocID028236 Rev 2
UM1940

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF