|
STM32F103xB HAL User Manual
|
This file provides firmware functions to manage the following functionalities of the Analog to Digital Convertor (ADC) peripheral: + Initialization and de-initialization functions ++ Initialization and Configuration of ADC + Operation functions ++ Start, stop, get result of conversions of regular group, using 3 possible modes: polling, interruption or DMA. + Control functions ++ Channels configuration on regular group ++ Channels configuration on injected group ++ Analog Watchdog configuration + State functions ++ ADC state machine management ++ Interrupts and flags management Other functions (extended functions) are available in file "stm32f1xx_hal_adc_ex.c". More...
#include "stm32f1xx_hal.h"Go to the source code of this file.
Defines | |
| #define | ADC_ENABLE_TIMEOUT 2U |
| #define | ADC_DISABLE_TIMEOUT 2U |
| #define | ADC_STAB_DELAY_US 1U |
| #define | ADC_TEMPSENSOR_DELAY_US 10U |
Functions | |
| HAL_StatusTypeDef | HAL_ADC_Init (ADC_HandleTypeDef *hadc) |
| Initializes the ADC peripheral and regular group according to parameters specified in structure "ADC_InitTypeDef". | |
| HAL_StatusTypeDef | HAL_ADC_DeInit (ADC_HandleTypeDef *hadc) |
| Deinitialize the ADC peripheral registers to their default reset values, with deinitialization of the ADC MSP. | |
| __weak void | HAL_ADC_MspInit (ADC_HandleTypeDef *hadc) |
| Initializes the ADC MSP. | |
| __weak void | HAL_ADC_MspDeInit (ADC_HandleTypeDef *hadc) |
| DeInitializes the ADC MSP. | |
| HAL_StatusTypeDef | HAL_ADC_RegisterCallback (ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID, pADC_CallbackTypeDef pCallback) |
| Register a User ADC Callback To be used instead of the weak predefined callback. | |
| HAL_StatusTypeDef | HAL_ADC_UnRegisterCallback (ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID) |
| Unregister a ADC Callback ADC callback is redirected to the weak predefined callback. | |
| HAL_StatusTypeDef | HAL_ADC_Start (ADC_HandleTypeDef *hadc) |
| Enables ADC, starts conversion of regular group. | |
| HAL_StatusTypeDef | HAL_ADC_Stop (ADC_HandleTypeDef *hadc) |
| Stop ADC conversion of regular group (and injected channels in case of auto_injection mode), disable ADC peripheral. | |
| HAL_StatusTypeDef | HAL_ADC_PollForConversion (ADC_HandleTypeDef *hadc, uint32_t Timeout) |
| Wait for regular group conversion to be completed. | |
| HAL_StatusTypeDef | HAL_ADC_PollForEvent (ADC_HandleTypeDef *hadc, uint32_t EventType, uint32_t Timeout) |
| Poll for conversion event. | |
| HAL_StatusTypeDef | HAL_ADC_Start_IT (ADC_HandleTypeDef *hadc) |
| Enables ADC, starts conversion of regular group with interruption. | |
| HAL_StatusTypeDef | HAL_ADC_Stop_IT (ADC_HandleTypeDef *hadc) |
| Stop ADC conversion of regular group (and injected group in case of auto_injection mode), disable interrution of end-of-conversion, disable ADC peripheral. | |
| HAL_StatusTypeDef | HAL_ADC_Start_DMA (ADC_HandleTypeDef *hadc, uint32_t *pData, uint32_t Length) |
| Enables ADC, starts conversion of regular group and transfers result through DMA. | |
| HAL_StatusTypeDef | HAL_ADC_Stop_DMA (ADC_HandleTypeDef *hadc) |
| Stop ADC conversion of regular group (and injected group in case of auto_injection mode), disable ADC DMA transfer, disable ADC peripheral. | |
| uint32_t | HAL_ADC_GetValue (ADC_HandleTypeDef *hadc) |
| Get ADC regular group conversion result. | |
| void | HAL_ADC_IRQHandler (ADC_HandleTypeDef *hadc) |
| Handles ADC interrupt request. | |
| __weak void | HAL_ADC_ConvCpltCallback (ADC_HandleTypeDef *hadc) |
| Conversion complete callback in non blocking mode. | |
| __weak void | HAL_ADC_ConvHalfCpltCallback (ADC_HandleTypeDef *hadc) |
| Conversion DMA half-transfer callback in non blocking mode. | |
| __weak void | HAL_ADC_LevelOutOfWindowCallback (ADC_HandleTypeDef *hadc) |
| Analog watchdog callback in non blocking mode. | |
| __weak void | HAL_ADC_ErrorCallback (ADC_HandleTypeDef *hadc) |
| ADC error callback in non blocking mode (ADC conversion with interruption or transfer by DMA) | |
| HAL_StatusTypeDef | HAL_ADC_ConfigChannel (ADC_HandleTypeDef *hadc, ADC_ChannelConfTypeDef *sConfig) |
| Configures the the selected channel to be linked to the regular group. | |
| HAL_StatusTypeDef | HAL_ADC_AnalogWDGConfig (ADC_HandleTypeDef *hadc, ADC_AnalogWDGConfTypeDef *AnalogWDGConfig) |
| Configures the analog watchdog. | |
| uint32_t | HAL_ADC_GetState (ADC_HandleTypeDef *hadc) |
| return the ADC state | |
| uint32_t | HAL_ADC_GetError (ADC_HandleTypeDef *hadc) |
| Return the ADC error code. | |
| HAL_StatusTypeDef | ADC_Enable (ADC_HandleTypeDef *hadc) |
| Enable the selected ADC. | |
| HAL_StatusTypeDef | ADC_ConversionStop_Disable (ADC_HandleTypeDef *hadc) |
| Stop ADC conversion and disable the selected ADC. | |
| void | ADC_DMAConvCplt (DMA_HandleTypeDef *hdma) |
| DMA transfer complete callback. | |
| void | ADC_DMAHalfConvCplt (DMA_HandleTypeDef *hdma) |
| DMA half transfer complete callback. | |
| void | ADC_DMAError (DMA_HandleTypeDef *hdma) |
| DMA error callback. | |
This file provides firmware functions to manage the following functionalities of the Analog to Digital Convertor (ADC) peripheral: + Initialization and de-initialization functions ++ Initialization and Configuration of ADC + Operation functions ++ Start, stop, get result of conversions of regular group, using 3 possible modes: polling, interruption or DMA. + Control functions ++ Channels configuration on regular group ++ Channels configuration on injected group ++ Analog Watchdog configuration + State functions ++ ADC state machine management ++ Interrupts and flags management Other functions (extended functions) are available in file "stm32f1xx_hal_adc_ex.c".
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause
Definition in file stm32f1xx_hal_adc.c.
1.7.6.1