STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
|
This file provides firmware functions to manage the following functionalities of the ADC extension peripheral: More...
#include "stm32f4xx_hal.h"
Go to the source code of this file.
Functions | |
static void | ADC_MultiModeDMAConvCplt (DMA_HandleTypeDef *hdma) |
DMA transfer complete callback. | |
static void | ADC_MultiModeDMAError (DMA_HandleTypeDef *hdma) |
DMA error callback. | |
static void | ADC_MultiModeDMAHalfConvCplt (DMA_HandleTypeDef *hdma) |
DMA half transfer complete callback. | |
HAL_StatusTypeDef | HAL_ADCEx_InjectedStart (ADC_HandleTypeDef *hadc) |
Enables the selected ADC software start conversion of the injected channels. | |
HAL_StatusTypeDef | HAL_ADCEx_InjectedStart_IT (ADC_HandleTypeDef *hadc) |
Enables the interrupt and starts ADC conversion of injected channels. | |
HAL_StatusTypeDef | HAL_ADCEx_InjectedStop (ADC_HandleTypeDef *hadc) |
Stop conversion of injected channels. Disable ADC peripheral if no regular conversion is on going. | |
HAL_StatusTypeDef | HAL_ADCEx_InjectedPollForConversion (ADC_HandleTypeDef *hadc, uint32_t Timeout) |
Poll for injected conversion complete. | |
HAL_StatusTypeDef | HAL_ADCEx_InjectedStop_IT (ADC_HandleTypeDef *hadc) |
Stop conversion of injected channels, disable interruption of end-of-conversion. Disable ADC peripheral if no regular conversion is on going. | |
uint32_t | HAL_ADCEx_InjectedGetValue (ADC_HandleTypeDef *hadc, uint32_t InjectedRank) |
Gets the converted value from data register of injected channel. | |
HAL_StatusTypeDef | HAL_ADCEx_MultiModeStart_DMA (ADC_HandleTypeDef *hadc, uint32_t *pData, uint32_t Length) |
Enables ADC DMA request after last transfer (Multi-ADC mode) and enables ADC peripheral. | |
HAL_StatusTypeDef | HAL_ADCEx_MultiModeStop_DMA (ADC_HandleTypeDef *hadc) |
Disables ADC DMA (multi-ADC mode) and disables ADC peripheral. | |
uint32_t | HAL_ADCEx_MultiModeGetValue (ADC_HandleTypeDef *hadc) |
Returns the last ADC1, ADC2 and ADC3 regular conversions results data in the selected multi mode. | |
void | HAL_ADCEx_InjectedConvCpltCallback (ADC_HandleTypeDef *hadc) |
Injected conversion complete callback in non blocking mode. | |
HAL_StatusTypeDef | HAL_ADCEx_InjectedConfigChannel (ADC_HandleTypeDef *hadc, ADC_InjectionConfTypeDef *sConfigInjected) |
Configures for the selected ADC injected channel its corresponding rank in the sequencer and its sample time. | |
HAL_StatusTypeDef | HAL_ADCEx_MultiModeConfigChannel (ADC_HandleTypeDef *hadc, ADC_MultiModeTypeDef *multimode) |
Configures the ADC multi-mode. | |
This file provides firmware functions to manage the following functionalities of the ADC extension peripheral:
Copyright (c) 2017 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.
============================================================================== ##### How to use this driver ##### ============================================================================== [..] (#)Initialize the ADC low level resources by implementing the HAL_ADC_MspInit(): (##) 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. (#) Configure the ADC Prescaler, conversion resolution and data alignment using the HAL_ADC_Init() function. (#) Configure the ADC Injected channels group features, use HAL_ADC_Init() and HAL_ADC_ConfigChannel() functions. (#) 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 (+) At ADC end of conversion HAL_ADCEx_InjectedConvCpltCallback() function is executed and user can add his own code by customization of function pointer HAL_ADCEx_InjectedConvCpltCallback (+) In case of ADC Error, HAL_ADCEx_InjectedErrorCallback() function is executed and user can add his own code by customization of function pointer HAL_ADCEx_InjectedErrorCallback (+) Stop the ADC peripheral using HAL_ADCEx_InjectedStop_IT() *** Multi mode ADCs Regular channels configuration *** ====================================================== [..] (+) Select the Multi mode ADC regular channels features (dual or triple mode) and configure the DMA mode using HAL_ADCEx_MultiModeConfigChannel() functions. (+) Start the ADC peripheral using HAL_ADCEx_MultiModeStart_DMA(), at this stage the user specify the length of data to be transferred at each end of conversion (+) Read the ADCs converted values using the HAL_ADCEx_MultiModeGetValue() function.
Definition in file stm32f4xx_hal_adc_ex.c.