STM32F4xx_HAL_Driver  1.8.3
IO operation functions

IO operation functions. More...

+ Collaboration diagram for IO operation functions:

Functions

HAL_StatusTypeDef HAL_ADC_Start (ADC_HandleTypeDef *hadc)
 Enables ADC and starts conversion of the regular channels. More...
 
HAL_StatusTypeDef HAL_ADC_Stop (ADC_HandleTypeDef *hadc)
 Disables ADC and stop conversion of regular channels. More...
 
HAL_StatusTypeDef HAL_ADC_PollForConversion (ADC_HandleTypeDef *hadc, uint32_t Timeout)
 Poll for regular conversion complete. More...
 
HAL_StatusTypeDef HAL_ADC_PollForEvent (ADC_HandleTypeDef *hadc, uint32_t EventType, uint32_t Timeout)
 Poll for conversion event. More...
 
HAL_StatusTypeDef HAL_ADC_Start_IT (ADC_HandleTypeDef *hadc)
 Enables the interrupt and starts ADC conversion of regular channels. More...
 
HAL_StatusTypeDef HAL_ADC_Stop_IT (ADC_HandleTypeDef *hadc)
 Disables the interrupt and stop ADC conversion of regular channels. More...
 
void HAL_ADC_IRQHandler (ADC_HandleTypeDef *hadc)
 Handles ADC interrupt request. More...
 
HAL_StatusTypeDef HAL_ADC_Start_DMA (ADC_HandleTypeDef *hadc, uint32_t *pData, uint32_t Length)
 Enables ADC DMA request after last transfer (Single-ADC mode) and enables ADC peripheral. More...
 
HAL_StatusTypeDef HAL_ADC_Stop_DMA (ADC_HandleTypeDef *hadc)
 Disables ADC DMA (Single-ADC mode) and disables ADC peripheral. More...
 
uint32_t HAL_ADC_GetValue (ADC_HandleTypeDef *hadc)
 Gets the converted value from data register of regular channel. More...
 
void HAL_ADC_ConvCpltCallback (ADC_HandleTypeDef *hadc)
 Regular conversion complete callback in non blocking mode. More...
 
void HAL_ADC_ConvHalfCpltCallback (ADC_HandleTypeDef *hadc)
 Regular conversion half DMA transfer callback in non blocking mode. More...
 
void HAL_ADC_LevelOutOfWindowCallback (ADC_HandleTypeDef *hadc)
 Analog watchdog callback in non blocking mode. More...
 
void HAL_ADC_ErrorCallback (ADC_HandleTypeDef *hadc)
 Error ADC callback. More...
 

Detailed Description

IO operation functions.

 ===============================================================================
             ##### IO operation functions #####
 ===============================================================================
    [..]  This section provides functions allowing to:
      (+) Start conversion of regular channel.
      (+) Stop conversion of regular channel.
      (+) Start conversion of regular channel and enable interrupt.
      (+) Stop conversion of regular channel and disable interrupt.
      (+) Start conversion of regular channel and enable DMA transfer.
      (+) Stop conversion of regular channel and disable DMA transfer.
      (+) Handle ADC interrupt request.

Function Documentation

◆ HAL_ADC_ConvCpltCallback()

__weak void HAL_ADC_ConvCpltCallback ( ADC_HandleTypeDef hadc)

Regular conversion complete callback in non blocking mode.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
None

Definition at line 1580 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_ConvHalfCpltCallback()

__weak void HAL_ADC_ConvHalfCpltCallback ( ADC_HandleTypeDef hadc)

Regular conversion half DMA transfer callback in non blocking mode.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
None

Definition at line 1595 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_ErrorCallback()

__weak void HAL_ADC_ErrorCallback ( ADC_HandleTypeDef hadc)

Error ADC callback.

Note
In case of error due to overrun when using ADC with DMA transfer (HAL ADC handle parameter "ErrorCode" to state "HAL_ADC_ERROR_OVR"):
  • Reinitialize the DMA using function "HAL_ADC_Stop_DMA()".
  • If needed, restart a new ADC conversion using function "HAL_ADC_Start_DMA()" (this function is also clearing overrun flag)
Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
None

Definition at line 1631 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_GetValue()

uint32_t HAL_ADC_GetValue ( ADC_HandleTypeDef hadc)

Gets the converted value from data register of regular channel.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
Convertedvalue

Definition at line 1568 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_IRQHandler()

void HAL_ADC_IRQHandler ( ADC_HandleTypeDef hadc)

Handles ADC interrupt request.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
None

Definition at line 1199 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_LevelOutOfWindowCallback()

__weak void HAL_ADC_LevelOutOfWindowCallback ( ADC_HandleTypeDef hadc)

Analog watchdog callback in non blocking mode.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
None

Definition at line 1610 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_PollForConversion()

HAL_StatusTypeDef HAL_ADC_PollForConversion ( ADC_HandleTypeDef hadc,
uint32_t  Timeout 
)

Poll for regular conversion complete.

Note
ADC conversion flags EOS (end of sequence) and EOC (end of conversion) are cleared by this function.
This function cannot be used in a particular setup: ADC configured in DMA mode and polling for end of each conversion (ADC init parameter "EOCSelection" set to ADC_EOC_SINGLE_CONV). In this case, DMA resets the flag EOC and polling cannot be performed on each conversion. Nevertheless, polling can still be performed on the complete sequence.
Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
TimeoutTimeout value in millisecond.
Return values
HALstatus

Definition at line 882 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_PollForEvent()

HAL_StatusTypeDef HAL_ADC_PollForEvent ( ADC_HandleTypeDef hadc,
uint32_t  EventType,
uint32_t  Timeout 
)

Poll for conversion event.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
EventTypethe ADC event type. This parameter can be one of the following values:
  • ADC_AWD_EVENT: ADC Analog watch Dog event.
  • ADC_OVR_EVENT: ADC Overrun event.
TimeoutTimeout value in millisecond.
Return values
HALstatus

Definition at line 971 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_Start()

HAL_StatusTypeDef HAL_ADC_Start ( ADC_HandleTypeDef hadc)

Enables ADC and starts conversion of the regular channels.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
HALstatus

Definition at line 716 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_Start_DMA()

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

Enables ADC DMA request after last transfer (Single-ADC mode) and enables ADC peripheral.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
pDataThe destination Buffer address.
LengthThe length of data to be transferred from ADC peripheral to memory.
Return values
HALstatus

Definition at line 1364 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_Start_IT()

HAL_StatusTypeDef HAL_ADC_Start_IT ( ADC_HandleTypeDef hadc)

Enables the interrupt and starts ADC conversion of regular channels.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
HALstatus.

Definition at line 1037 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_Stop()

HAL_StatusTypeDef HAL_ADC_Stop ( ADC_HandleTypeDef hadc)

Disables ADC and stop conversion of regular channels.

Note
Caution: This function will stop also injected channels.
Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
HALstatus.

Definition at line 839 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_Stop_DMA()

HAL_StatusTypeDef HAL_ADC_Stop_DMA ( ADC_HandleTypeDef hadc)

Disables ADC DMA (Single-ADC mode) and disables ADC peripheral.

Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
HALstatus

Definition at line 1512 of file stm32f4xx_hal_adc.c.

◆ HAL_ADC_Stop_IT()

HAL_StatusTypeDef HAL_ADC_Stop_IT ( ADC_HandleTypeDef hadc)

Disables the interrupt and stop ADC conversion of regular channels.

Note
Caution: This function will stop also injected channels.
Parameters
hadcpointer to a ADC_HandleTypeDef structure that contains the configuration information for the specified ADC.
Return values
HALstatus.

Definition at line 1162 of file stm32f4xx_hal_adc.c.