STM32L443xx HAL User Manual
Data Structures | Defines | Functions
stm32l4xx_hal_adc_ex.h File Reference

Header file of ADC HAL extended module. More...

#include "stm32l4xx_hal_def.h"

Go to the source code of this file.

Data Structures

struct  ADC_InjOversamplingTypeDef
 ADC Injected Conversion Oversampling structure definition. More...
struct  ADC_InjectionConfTypeDef
 Structure definition of ADC group injected and ADC channel affected to ADC group injected. More...

Defines

#define ADC_INJECTED_SOFTWARE_START   (LL_ADC_INJ_TRIG_SOFTWARE)
#define ADC_EXTERNALTRIGINJEC_T1_TRGO   (LL_ADC_INJ_TRIG_EXT_TIM1_TRGO)
#define ADC_EXTERNALTRIGINJEC_T1_TRGO2   (LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2)
#define ADC_EXTERNALTRIGINJEC_T1_CC4   (LL_ADC_INJ_TRIG_EXT_TIM1_CH4)
#define ADC_EXTERNALTRIGINJEC_T2_TRGO   (LL_ADC_INJ_TRIG_EXT_TIM2_TRGO)
#define ADC_EXTERNALTRIGINJEC_T2_CC1   (LL_ADC_INJ_TRIG_EXT_TIM2_CH1)
#define ADC_EXTERNALTRIGINJEC_T3_TRGO   (LL_ADC_INJ_TRIG_EXT_TIM3_TRGO)
#define ADC_EXTERNALTRIGINJEC_T3_CC1   (LL_ADC_INJ_TRIG_EXT_TIM3_CH1)
#define ADC_EXTERNALTRIGINJEC_T3_CC3   (LL_ADC_INJ_TRIG_EXT_TIM3_CH3)
#define ADC_EXTERNALTRIGINJEC_T3_CC4   (LL_ADC_INJ_TRIG_EXT_TIM3_CH4)
#define ADC_EXTERNALTRIGINJEC_T4_TRGO   (LL_ADC_INJ_TRIG_EXT_TIM4_TRGO)
#define ADC_EXTERNALTRIGINJEC_T6_TRGO   (LL_ADC_INJ_TRIG_EXT_TIM6_TRGO)
#define ADC_EXTERNALTRIGINJEC_T8_CC4   (LL_ADC_INJ_TRIG_EXT_TIM8_CH4)
#define ADC_EXTERNALTRIGINJEC_T8_TRGO   (LL_ADC_INJ_TRIG_EXT_TIM8_TRGO)
#define ADC_EXTERNALTRIGINJEC_T8_TRGO2   (LL_ADC_INJ_TRIG_EXT_TIM8_TRGO2)
#define ADC_EXTERNALTRIGINJEC_T15_TRGO   (LL_ADC_INJ_TRIG_EXT_TIM15_TRGO)
#define ADC_EXTERNALTRIGINJEC_EXT_IT15   (LL_ADC_INJ_TRIG_EXT_EXTI_LINE15)
#define ADC_EXTERNALTRIGINJECCONV_EDGE_NONE   (0x00000000UL)
#define ADC_EXTERNALTRIGINJECCONV_EDGE_RISING   (ADC_JSQR_JEXTEN_0)
#define ADC_EXTERNALTRIGINJECCONV_EDGE_FALLING   (ADC_JSQR_JEXTEN_1)
#define ADC_EXTERNALTRIGINJECCONV_EDGE_RISINGFALLING   (ADC_JSQR_JEXTEN)
#define ADC_SINGLE_ENDED   (LL_ADC_SINGLE_ENDED)
#define ADC_DIFFERENTIAL_ENDED   (LL_ADC_DIFFERENTIAL_ENDED)
#define ADC_OFFSET_NONE   (ADC_OFFSET_4 + 1U)
#define ADC_OFFSET_1   (LL_ADC_OFFSET_1)
#define ADC_OFFSET_2   (LL_ADC_OFFSET_2)
#define ADC_OFFSET_3   (LL_ADC_OFFSET_3)
#define ADC_OFFSET_4   (LL_ADC_OFFSET_4)
#define ADC_INJECTED_RANK_1   (LL_ADC_INJ_RANK_1)
#define ADC_INJECTED_RANK_2   (LL_ADC_INJ_RANK_2)
#define ADC_INJECTED_RANK_3   (LL_ADC_INJ_RANK_3)
#define ADC_INJECTED_RANK_4   (LL_ADC_INJ_RANK_4)
#define ADC_REGULAR_GROUP   (LL_ADC_GROUP_REGULAR)
#define ADC_INJECTED_GROUP   (LL_ADC_GROUP_INJECTED)
#define ADC_REGULAR_INJECTED_GROUP   (LL_ADC_GROUP_REGULAR_INJECTED)
#define ADC_CFGR_FIELDS
#define ADC_SMPR1_FIELDS
#define ADC_CFGR_FIELDS_2   ((ADC_CFGR_DMACFG | ADC_CFGR_AUTDLY))
#define ADC_IS_SOFTWARE_START_INJECTED(__HANDLE__)   (((__HANDLE__)->Instance->JSQR & ADC_JSQR_JEXTEN) == 0UL)
 Test if conversion trigger of injected group is software start or external trigger.
#define ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED(__HANDLE__)
 Check if conversion is on going on regular or injected groups.
#define ADC_IS_CONVERSION_ONGOING_INJECTED(__HANDLE__)   (LL_ADC_INJ_IsConversionOngoing((__HANDLE__)->Instance))
 Check if conversion is on going on injected group.
#define ADC_IS_INDEPENDENT(__HANDLE__)   (SET)
 Check whether or not ADC is independent.
#define ADC_JSQR_RK(__CHANNELNB__, __RANKNB__)
 Set the selected injected Channel rank.
#define ADC_CFGR_INJECT_CONTEXT_QUEUE(__INJECT_CONTEXT_QUEUE_MODE__)   ((__INJECT_CONTEXT_QUEUE_MODE__) << ADC_CFGR_JQM_Pos)
 Configure ADC injected context queue.
#define ADC_CFGR_INJECT_DISCCONTINUOUS(__INJECT_DISCONTINUOUS_MODE__)   ((__INJECT_DISCONTINUOUS_MODE__) << ADC_CFGR_JDISCEN_Pos)
 Configure ADC discontinuous conversion mode for injected group.
#define ADC_CFGR_REG_DISCONTINUOUS(__REG_DISCONTINUOUS_MODE__)   ((__REG_DISCONTINUOUS_MODE__) << ADC_CFGR_DISCEN_Pos)
 Configure ADC discontinuous conversion mode for regular group.
#define ADC_CFGR_DISCONTINUOUS_NUM(__NBR_DISCONTINUOUS_CONV__)   (((__NBR_DISCONTINUOUS_CONV__) - 1UL) << ADC_CFGR_DISCNUM_Pos)
 Configure the number of discontinuous conversions for regular group.
#define ADC_CFGR_AUTOWAIT(__AUTOWAIT__)   ((__AUTOWAIT__) << ADC_CFGR_AUTDLY_Pos)
 Configure the ADC auto delay mode.
#define ADC_CFGR_CONTINUOUS(__CONTINUOUS_MODE__)   ((__CONTINUOUS_MODE__) << ADC_CFGR_CONT_Pos)
 Configure ADC continuous conversion mode.
#define ADC_CFGR_DMACONTREQ(__DMACONTREQ_MODE__)   ((__DMACONTREQ_MODE__) << ADC_CFGR_DMACFG_Pos)
 Configure the ADC DMA continuous request.
#define ADC_OFR_CHANNEL(__CHANNEL__)   ((__CHANNEL__) << ADC_OFR1_OFFSET1_CH_Pos)
 Configure the channel number into offset OFRx register.
#define ADC_DIFSEL_CHANNEL(__CHANNEL__)   (1UL << (__CHANNEL__))
 Configure the channel number into differential mode selection register.
#define ADC_CALFACT_DIFF_SET(__CALIBRATION_FACTOR__)
 Configure calibration factor in differential mode to be set into calibration register.
#define ADC_CALFACT_DIFF_GET(__CALIBRATION_FACTOR__)   ((__CALIBRATION_FACTOR__) >> ADC_CALFACT_CALFACT_D_Pos)
 Calibration factor in differential mode to be retrieved from calibration register.
#define ADC_TRX_HIGHTHRESHOLD(__THRESHOLD__)   ((__THRESHOLD__) << 16UL)
 Configure the analog watchdog high threshold into registers TR1, TR2 or TR3.
#define ADC_OFFSET_SHIFT_RESOLUTION(__HANDLE__, __OFFSET__)   ((__OFFSET__) << ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3UL) * 2UL))
 Shift the offset with respect to the selected ADC resolution.
#define ADC_AWD1THRESHOLD_SHIFT_RESOLUTION(__HANDLE__, __THRESHOLD__)   ((__THRESHOLD__) << ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3UL) * 2UL))
 Shift the AWD1 threshold with respect to the selected ADC resolution.
#define ADC_AWD23THRESHOLD_SHIFT_RESOLUTION(__HANDLE__, __THRESHOLD__)
 Shift the AWD2 and AWD3 threshold with respect to the selected ADC resolution.
#define ADC_CLEAR_COMMON_CONTROL_REGISTER(__HANDLE__)
 Clear Common Control Register.
#define ADC_TEMPERATURE_SENSOR_INSTANCE(__HANDLE__)   (((__HANDLE__)->Instance) == ADC1)
 Verify the ADC instance connected to the temperature sensor.
#define ADC_BATTERY_VOLTAGE_INSTANCE(__HANDLE__)   (((__HANDLE__)->Instance) == ADC1)
 Verify the ADC instance connected to the battery voltage VBAT.
#define ADC_VREFINT_INSTANCE(__HANDLE__)   (((__HANDLE__)->Instance) == ADC1)
 Verify the ADC instance connected to the internal voltage reference VREFINT.
#define IS_ADC_INJECTED_NB_CONV(__LENGTH__)   (((__LENGTH__) >= (1U)) && ((__LENGTH__) <= (4U)))
 Verify the length of scheduled injected conversions group.
#define IS_ADC_CALFACT(__CALIBRATION_FACTOR__)   ((__CALIBRATION_FACTOR__) <= (0x7FU))
 Calibration factor size verification (7 bits maximum).
#define IS_ADC_CHANNEL(__HANDLE__, __CHANNEL__)
 Verify the ADC channel setting.
#define IS_ADC_DIFF_CHANNEL(__HANDLE__, __CHANNEL__)
 Verify the ADC channel setting in differential mode.
#define IS_ADC_SINGLE_DIFFERENTIAL(__SING_DIFF__)
 Verify the ADC single-ended input or differential mode setting.
#define IS_ADC_OFFSET_NUMBER(__OFFSET_NUMBER__)
 Verify the ADC offset management setting.
#define IS_ADC_INJECTED_RANK(__CHANNEL__)
 Verify the ADC injected channel setting.
#define IS_ADC_EXTTRIGINJEC(__HANDLE__, __INJTRIG__)
 Verify the ADC injected conversions external trigger.
#define IS_ADC_EXTTRIGINJEC_EDGE(__EDGE__)
 Verify the ADC edge trigger setting for injected group.
#define IS_ADC_ANALOG_WATCHDOG_NUMBER(__WATCHDOG__)
 Verify the ADC analog watchdog setting.
#define IS_ADC_ANALOG_WATCHDOG_MODE(__WATCHDOG_MODE__)
 Verify the ADC analog watchdog mode setting.
#define IS_ADC_CONVERSION_GROUP(__CONVERSION__)
 Verify the ADC conversion (regular or injected or both).
#define IS_ADC_EVENT_TYPE(__EVENT__)
 Verify the ADC event type.
#define IS_ADC_OVERSAMPLING_RATIO(__RATIO__)
 Verify the ADC oversampling ratio.
#define IS_ADC_RIGHT_BIT_SHIFT(__SHIFT__)
 Verify the ADC oversampling shift.
#define IS_ADC_TRIGGERED_OVERSAMPLING_MODE(__MODE__)
 Verify the ADC oversampling triggered mode.
#define IS_ADC_REGOVERSAMPLING_MODE(__MODE__)
 Verify the ADC oversampling regular conversion resumed or continued mode.
#define IS_ADC_DFSDMCFG_MODE(__HANDLE__)   (SET)
 Verify the DFSDM mode configuration.
#define ADC_CFGR_DFSDM(__HANDLE__)   (0x0UL)
 Return the DFSDM configuration mode.

Functions

HAL_StatusTypeDef HAL_ADCEx_Calibration_Start (ADC_HandleTypeDef *hadc, uint32_t SingleDiff)
 Perform an ADC automatic self-calibration Calibration prerequisite: ADC must be disabled (execute this function before HAL_ADC_Start() or after HAL_ADC_Stop() ).
uint32_t HAL_ADCEx_Calibration_GetValue (ADC_HandleTypeDef *hadc, uint32_t SingleDiff)
 Get the calibration factor.
HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue (ADC_HandleTypeDef *hadc, uint32_t SingleDiff, uint32_t CalibrationFactor)
 Set the calibration factor to overwrite automatic conversion result.
HAL_StatusTypeDef HAL_ADCEx_InjectedStart (ADC_HandleTypeDef *hadc)
 Enable ADC, start conversion of injected group.
HAL_StatusTypeDef HAL_ADCEx_InjectedStop (ADC_HandleTypeDef *hadc)
 Stop conversion of injected channels.
HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion (ADC_HandleTypeDef *hadc, uint32_t Timeout)
 Wait for injected group conversion to be completed.
HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT (ADC_HandleTypeDef *hadc)
 Enable ADC, start conversion of injected group with interruption.
HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT (ADC_HandleTypeDef *hadc)
 Stop conversion of injected channels, disable interruption of end-of-conversion.
uint32_t HAL_ADCEx_InjectedGetValue (ADC_HandleTypeDef *hadc, uint32_t InjectedRank)
 Get ADC injected group conversion result.
__weak void HAL_ADCEx_InjectedConvCpltCallback (ADC_HandleTypeDef *hadc)
 Injected conversion complete callback in non-blocking mode.
__weak void HAL_ADCEx_InjectedQueueOverflowCallback (ADC_HandleTypeDef *hadc)
 Injected context queue overflow callback.
__weak void HAL_ADCEx_LevelOutOfWindow2Callback (ADC_HandleTypeDef *hadc)
 Analog watchdog 2 callback in non-blocking mode.
__weak void HAL_ADCEx_LevelOutOfWindow3Callback (ADC_HandleTypeDef *hadc)
 Analog watchdog 3 callback in non-blocking mode.
__weak void HAL_ADCEx_EndOfSamplingCallback (ADC_HandleTypeDef *hadc)
 End Of Sampling callback in non-blocking mode.
HAL_StatusTypeDef HAL_ADCEx_RegularStop (ADC_HandleTypeDef *hadc)
 Stop ADC conversion of regular group (and injected channels in case of auto_injection mode), disable ADC peripheral if no conversion is on going on injected group.
HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT (ADC_HandleTypeDef *hadc)
 Stop ADC conversion of ADC groups regular and injected, disable interrution of end-of-conversion, disable ADC peripheral if no conversion is on going on injected group.
HAL_StatusTypeDef HAL_ADCEx_RegularStop_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 if no conversion is on going on injected group.
HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel (ADC_HandleTypeDef *hadc, ADC_InjectionConfTypeDef *sConfigInjected)
 Configure a channel to be assigned to ADC group injected.
HAL_StatusTypeDef HAL_ADCEx_EnableInjectedQueue (ADC_HandleTypeDef *hadc)
 Enable Injected Queue.
HAL_StatusTypeDef HAL_ADCEx_DisableInjectedQueue (ADC_HandleTypeDef *hadc)
 Disable Injected Queue.
HAL_StatusTypeDef HAL_ADCEx_DisableVoltageRegulator (ADC_HandleTypeDef *hadc)
 Disable ADC voltage regulator.
HAL_StatusTypeDef HAL_ADCEx_EnterADCDeepPowerDownMode (ADC_HandleTypeDef *hadc)
 Enter ADC deep-power-down mode.

Detailed Description

Header file of ADC HAL extended module.

Author:
MCD Application Team
Attention:

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.

Definition in file stm32l4xx_hal_adc_ex.h.