L4 HAL Drivers

Embed: (wiki syntax)

« Back to documentation index

Extended Input and Output operation functions

Extended Input and Output operation functions
[ADC Extended Exported Functions]

Extended IO operation functions. More...

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 from automatic conversion result.
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, disable ADC peripheral if no regular conversion is on going.
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.
HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA (ADC_HandleTypeDef *hadc, uint32_t *pData, uint32_t Length)
 Enable ADC, start MultiMode conversion and transfer regular results through DMA.
HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA (ADC_HandleTypeDef *hadc)
 Stop multimode ADC conversion, disable ADC DMA transfer, disable ADC peripheral.
uint32_t HAL_ADCEx_MultiModeGetValue (ADC_HandleTypeDef *hadc)
 Return the last ADC Master and Slave regular conversions results when in multimode configuration.
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 groups, disable ADC peripheral if no injected conversion is on-going.
HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT (ADC_HandleTypeDef *hadc)
 Stop ADC conversion of regular groups when interruptions are enabled, disable ADC peripheral if no injected conversion is on-going.
HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA (ADC_HandleTypeDef *hadc)
 Stop ADC conversion of regular groups and disable ADC DMA transfer, disable ADC peripheral if no injected conversion is on-going.
HAL_StatusTypeDef HAL_ADCEx_RegularMultiModeStop_DMA (ADC_HandleTypeDef *hadc)
 Stop DMA-based multimode ADC conversion, disable ADC DMA transfer, disable ADC peripheral if no injected conversion is on-going.

Detailed Description

Extended IO operation functions.

 ===============================================================================
             ##### IO operation functions #####
 ===============================================================================  
    [..]  This section provides functions allowing to:
    
      (+) Perform the ADC self-calibration for single or differential ending.
      (+) Get calibration factors for single or differential ending.
      (+) Set calibration factors for single or differential ending.
          
      (+) Start conversion of injected group.
      (+) Stop conversion of injected group.
      (+) Poll for conversion complete on injected group.
      (+) Get result of injected channel conversion.
      (+) Start conversion of injected group and enable interruptions.
      (+) Stop conversion of injected group and disable interruptions.

      (+) When multimode feature is available, start multimode and enable DMA transfer.
      (+) Stop multimode and disable ADC DMA transfer.
      (+) Get result of multimode conversion.




Function Documentation

uint32_t HAL_ADCEx_Calibration_GetValue ( ADC_HandleTypeDef *  hadc,
uint32_t  SingleDiff 
)

Get the calibration factor from automatic conversion result.

Parameters:
hadc,:ADC handle.
SingleDiff,:Selection of single-ended or differential input This parameter can be one of the following values:

  • ADC_SINGLE_ENDED: Channel in mode input single ended
  • ADC_DIFFERENTIAL_ENDED: Channel in mode input differential ended
Return values:
Convertedvalue

Definition at line 295 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue ( ADC_HandleTypeDef *  hadc,
uint32_t  SingleDiff,
uint32_t  CalibrationFactor 
)

Set the calibration factor to overwrite automatic conversion result.

ADC must be enabled and no conversion on going.

Parameters:
hadc,:ADC handle.
SingleDiff,:Selection of single-ended or differential input. This parameter can be one of the following values:

  • ADC_SINGLE_ENDED: Channel in mode input single ended
  • ADC_DIFFERENTIAL_ENDED: Channel in mode input differential ended
CalibrationFactor,:Calibration factor (coded on 7 bits maximum)
Return values:
HALstate

Definition at line 324 of file stm32l4xx_hal_adc_ex.c.

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() ).

Parameters:
hadc,:ADC handle.
SingleDiff,:Selection of single-ended or differential input This parameter can be one of the following values:

  • ADC_SINGLE_ENDED: Channel in mode input single ended
  • ADC_DIFFERENTIAL_ENDED: Channel in mode input differential ended
Return values:
HALstatus

Definition at line 216 of file stm32l4xx_hal_adc_ex.c.

__weak void HAL_ADCEx_EndOfSamplingCallback ( ADC_HandleTypeDef *  hadc )

End Of Sampling callback in non-blocking mode.

Parameters:
hadc,:ADC handle
Return values:
None

Definition at line 1273 of file stm32l4xx_hal_adc_ex.c.

__weak void HAL_ADCEx_InjectedConvCpltCallback ( ADC_HandleTypeDef *  hadc )

Injected conversion complete callback in non-blocking mode.

Parameters:
hadc,:ADC handle
Return values:
None

Definition at line 1219 of file stm32l4xx_hal_adc_ex.c.

uint32_t HAL_ADCEx_InjectedGetValue ( ADC_HandleTypeDef *  hadc,
uint32_t  InjectedRank 
)

Get ADC injected group conversion result.

Parameters:
hadc,:ADC handle
InjectedRank,:the converted ADC injected rank. This parameter can be one of the following values:

  • ADC_INJECTED_RANK_1: Injected Channel1 selected
  • ADC_INJECTED_RANK_2: Injected Channel2 selected
  • ADC_INJECTED_RANK_3: Injected Channel3 selected
  • ADC_INJECTED_RANK_4: Injected Channel4 selected
Note:
Reading JDRy register automatically clears JEOC flag. To reset JEOS flag the user must resort to the macro __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_JEOS).
Return values:
None

Definition at line 1183 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion ( ADC_HandleTypeDef *  hadc,
uint32_t  Timeout 
)

Wait for injected group conversion to be completed.

Parameters:
hadc,:ADC handle
Timeout,:Timeout value in millisecond.
Note:
Depending on hadc->Init.EOCSelection, JEOS or JEOC is checked and cleared depending on AUTDLY bit status.
Return values:
HALstatus

Definition at line 563 of file stm32l4xx_hal_adc_ex.c.

__weak void HAL_ADCEx_InjectedQueueOverflowCallback ( ADC_HandleTypeDef *  hadc )

Injected context queue overflow callback.

Note:
This callback is called if injected context queue is enabled (parameter "QueueInjectedContext" in injected channel configuration) and if a new injected context is set when queue is full (maximum 2 contexts).
Parameters:
hadc,:ADC handle
Return values:
None

Definition at line 1236 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_InjectedStart ( ADC_HandleTypeDef *  hadc )

Enable ADC, start conversion of injected group.

Note:
Interruptions enabled in this function: None.
Case of multimode enabled when multimode feature is available: HAL_ADCEx_InjectedStart() API must be called for ADC slave first, then for ADC master. For ADC slave, ADC is enabled only (conversion is not started). For ADC master, ADC is enabled and multimode conversion is started.
Parameters:
hadc,:ADC handle.
Return values:
HALstatus

Definition at line 380 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT ( ADC_HandleTypeDef *  hadc )

Enable ADC, start conversion of injected group with interruption.

Note:
Interruptions enabled in this function according to initialization setting : JEOC (end of conversion) or JEOS (end of sequence)
Case of multimode enabled (when multimode feature is enabled): HAL_ADCEx_InjectedStart_IT() API must be called for ADC slave first, then for ADC master. For ADC slave, ADC is enabled only (conversion is not started). For ADC master, ADC is enabled and multimode conversion is started.
Parameters:
hadc,:ADC handle.
Return values:
HALstatus.

Definition at line 717 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_InjectedStop ( ADC_HandleTypeDef *  hadc )

Stop conversion of injected channels, disable ADC peripheral if no regular conversion is on going.

Note:
If ADC must be disabled and if regular conversion is on going, function HAL_ADC_Stop() must be used.
In case of auto-injection mode, HAL_ADC_Stop() must be used.
In case of multimode enabled (when multimode feature is available), HAL_ADCEx_InjectedStop() must be called for ADC master first, then for ADC slave. For ADC master, conversion is stopped and ADC is disabled. For ADC slave, ADC is disabled only (conversion stop of ADC master has already stopped conversion of ADC slave).
Parameters:
hadc,:ADC handle.
Return values:
None

Definition at line 507 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT ( ADC_HandleTypeDef *  hadc )

Stop conversion of injected channels, disable interruption of end-of-conversion.

Note:
Disable ADC peripheral if no regular conversion is on going.
If ADC must be disabled and if regular conversion is on going, function HAL_ADC_Stop must be used first.
Case of multimode enabled (when multimode feature is available): HAL_ADCEx_InjectedStop_IT() API must be called for ADC master first, then for ADC slave. For ADC master, conversion is stopped and ADC is disabled. For ADC slave, ADC is disabled only (conversion stop of ADC master has already stopped conversion of ADC slave).
In case of auto-injection mode, HAL_ADC_Stop() must be used.
Parameters:
hadc,:ADC handle
Return values:
None

Definition at line 864 of file stm32l4xx_hal_adc_ex.c.

__weak void HAL_ADCEx_LevelOutOfWindow2Callback ( ADC_HandleTypeDef *  hadc )

Analog watchdog 2 callback in non-blocking mode.

Parameters:
hadc,:ADC handle
Return values:
None

Definition at line 1248 of file stm32l4xx_hal_adc_ex.c.

__weak void HAL_ADCEx_LevelOutOfWindow3Callback ( ADC_HandleTypeDef *  hadc )

Analog watchdog 3 callback in non-blocking mode.

Parameters:
hadc,:ADC handle
Return values:
None

Definition at line 1260 of file stm32l4xx_hal_adc_ex.c.

uint32_t HAL_ADCEx_MultiModeGetValue ( ADC_HandleTypeDef *  hadc )

Return the last ADC Master and Slave regular conversions results when in multimode configuration.

Parameters:
hadc,:ADC handle of ADC Master (handle of ADC Slave must not be used)
Return values:
Theconverted data values.

Definition at line 1154 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA ( ADC_HandleTypeDef *  hadc,
uint32_t *  pData,
uint32_t  Length 
)

Enable ADC, start MultiMode conversion and transfer regular results through DMA.

Note:
Multimode must have been previously configured using HAL_ADCEx_MultiModeConfigChannel() function. Interruptions enabled in this function: overrun, DMA half transfer, DMA transfer complete. Each of these interruptions has its dedicated callback function.
State field of Slave ADC handle is not updated in this configuration: user should not rely on it for information related to Slave regular conversions.
Parameters:
hadc,:ADC handle of ADC master (handle of ADC slave must not be used)
pData,:Destination Buffer address.
Length,:Length of data to be transferred from ADC peripheral to memory (in bytes).
Return values:
None

Definition at line 931 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA ( ADC_HandleTypeDef *  hadc )

Stop multimode ADC conversion, disable ADC DMA transfer, disable ADC peripheral.

Note:
Multimode is kept enabled after this function. MultiMode DMA bits (MDMA and DMACFG bits of common CCR register) are maintained. To disable Multimode (set with HAL_ADCEx_MultiModeConfigChannel()), ADC must be reinitialized using HAL_ADC_Init() or HAL_ADC_DeInit(), or the user can resort to HAL_ADCEx_DisableMultiMode() API.
In case of DMA configured in circular mode, function HAL_ADC_Stop_DMA() must be called after this function with handle of ADC slave, to properly disable the DMA channel.
Parameters:
hadc,:ADC handle of ADC master (handle of ADC slave must not be used)
Return values:
None

Definition at line 1046 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_RegularMultiModeStop_DMA ( ADC_HandleTypeDef *  hadc )

Stop DMA-based multimode ADC conversion, disable ADC DMA transfer, disable ADC peripheral if no injected conversion is on-going.

Note:
Multimode is kept enabled after this function. Multimode DMA bits (MDMA and DMACFG bits of common CCR register) are maintained. To disable multimode (set with HAL_ADCEx_MultiModeConfigChannel()), ADC must be reinitialized using HAL_ADC_Init() or HAL_ADC_DeInit(), or the user can resort to HAL_ADCEx_DisableMultiMode() API.
In case of DMA configured in circular mode, function HAL_ADCEx_RegularStop_DMA() must be called after this function with handle of ADC slave, to properly disable the DMA channel.
Parameters:
hadc,:ADC handle of ADC master (handle of ADC slave must not be used)
Return values:
None

Definition at line 1485 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_RegularStop ( ADC_HandleTypeDef *  hadc )

Stop ADC conversion of regular groups, disable ADC peripheral if no injected conversion is on-going.

Parameters:
hadc,:ADC handle
Return values:
HALstatus.

Definition at line 1287 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA ( ADC_HandleTypeDef *  hadc )

Stop ADC conversion of regular groups and disable ADC DMA transfer, disable ADC peripheral if no injected conversion is on-going.

Note:
HAL_ADCEx_RegularStop_DMA() function is dedicated to single-ADC mode only. For multimode (when multimode feature is available), HAL_ADCEx_RegularMultiModeStop_DMA() API must be used.
Parameters:
hadc,:ADC handle
Return values:
HALstatus.

Definition at line 1398 of file stm32l4xx_hal_adc_ex.c.

HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT ( ADC_HandleTypeDef *  hadc )

Stop ADC conversion of regular groups when interruptions are enabled, disable ADC peripheral if no injected conversion is on-going.

Parameters:
hadc,:ADC handle
Return values:
HALstatus.

Definition at line 1341 of file stm32l4xx_hal_adc_ex.c.