STM32L4xx_HAL_Driver  1.14.0
Peripheral State functions

ADC Peripheral State functions. More...

Functions

uint32_t HAL_ADC_GetState (ADC_HandleTypeDef *hadc)
 Return the ADC handle state. More...
 
uint32_t HAL_ADC_GetError (ADC_HandleTypeDef *hadc)
 Return the ADC error code. More...
 

Detailed Description

ADC Peripheral State functions.

 ===============================================================================
            ##### Peripheral state and errors functions #####
 ===============================================================================
    [..]
    This subsection provides functions to get in run-time the status of the
    peripheral.
      (+) Check the ADC state
      (+) Check the ADC error code

Function Documentation

◆ HAL_ADC_GetError()

uint32_t HAL_ADC_GetError ( ADC_HandleTypeDef hadc)

Return the ADC error code.

Parameters
hadcADC handle
Return values
ADCerror code (bitfield on 32 bits)

Definition at line 3207 of file stm32l4xx_hal_adc.c.

3208 {
3209  /* Check the parameters */
3210  assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance));
3211 
3212  return hadc->ErrorCode;
3213 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_ADC_GetState()

uint32_t HAL_ADC_GetState ( ADC_HandleTypeDef hadc)

Return the ADC handle state.

Note
ADC state machine is managed by bitfields, ADC status must be compared with states bits. For example: " if ((HAL_ADC_GetState(hadc1) & HAL_ADC_STATE_REG_BUSY) != 0UL) " " if ((HAL_ADC_GetState(hadc1) & HAL_ADC_STATE_AWD1) != 0UL) "
Parameters
hadcADC handle
Return values
ADChandle state (bitfield on 32 bits)

Definition at line 3193 of file stm32l4xx_hal_adc.c.

3194 {
3195  /* Check the parameters */
3196  assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance));
3197 
3198  /* Return ADC handle state */
3199  return hadc->State;
3200 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))