STM32L4xx_HAL_Driver  1.14.0
Operation on ADC hierarchical scope: ADC instance

Functions

__STATIC_INLINE void LL_ADC_EnableDeepPowerDown (ADC_TypeDef *ADCx)
 Put ADC instance in deep power down state. More...
 
__STATIC_INLINE void LL_ADC_DisableDeepPowerDown (ADC_TypeDef *ADCx)
 Disable ADC deep power down mode. More...
 
__STATIC_INLINE uint32_t LL_ADC_IsDeepPowerDownEnabled (ADC_TypeDef *ADCx)
 Get the selected ADC instance deep power down state. CR DEEPPWD LL_ADC_IsDeepPowerDownEnabled. More...
 
__STATIC_INLINE void LL_ADC_EnableInternalRegulator (ADC_TypeDef *ADCx)
 Enable ADC instance internal voltage regulator. More...
 
__STATIC_INLINE void LL_ADC_DisableInternalRegulator (ADC_TypeDef *ADCx)
 Disable ADC internal voltage regulator. More...
 
__STATIC_INLINE uint32_t LL_ADC_IsInternalRegulatorEnabled (ADC_TypeDef *ADCx)
 Get the selected ADC instance internal voltage regulator state. CR ADVREGEN LL_ADC_IsInternalRegulatorEnabled. More...
 
__STATIC_INLINE void LL_ADC_Enable (ADC_TypeDef *ADCx)
 Enable the selected ADC instance. More...
 
__STATIC_INLINE void LL_ADC_Disable (ADC_TypeDef *ADCx)
 Disable the selected ADC instance. More...
 
__STATIC_INLINE uint32_t LL_ADC_IsEnabled (ADC_TypeDef *ADCx)
 Get the selected ADC instance enable state. More...
 
__STATIC_INLINE uint32_t LL_ADC_IsDisableOngoing (ADC_TypeDef *ADCx)
 Get the selected ADC instance disable state. CR ADDIS LL_ADC_IsDisableOngoing. More...
 
__STATIC_INLINE void LL_ADC_StartCalibration (ADC_TypeDef *ADCx, uint32_t SingleDiff)
 Start ADC calibration in the mode single-ended or differential (for devices with differential mode available). More...
 
__STATIC_INLINE uint32_t LL_ADC_IsCalibrationOnGoing (ADC_TypeDef *ADCx)
 Get ADC calibration state. CR ADCAL LL_ADC_IsCalibrationOnGoing. More...
 

Detailed Description

Function Documentation

◆ LL_ADC_Disable()

__STATIC_INLINE void LL_ADC_Disable ( ADC_TypeDef *  ADCx)

Disable the selected ADC instance.

Note
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be not disabled. Must be enabled without conversion on going on either groups regular or injected. CR ADDIS LL_ADC_Disable
Parameters
ADCxADC instance
Return values
None

Definition at line 5953 of file stm32l4xx_ll_adc.h.

5954 {
5955  /* Note: Write register with some additional bits forced to state reset */
5956  /* instead of modifying only the selected bit for this function, */
5957  /* to not interfere with bits with HW property "rs". */
5958  MODIFY_REG(ADCx->CR,
5959  ADC_CR_BITS_PROPERTY_RS,
5960  ADC_CR_ADDIS);
5961 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_ADC_DisableDeepPowerDown()

__STATIC_INLINE void LL_ADC_DisableDeepPowerDown ( ADC_TypeDef *  ADCx)

Disable ADC deep power down mode.

Note
In case of ADC calibration necessary: When ADC is in deep-power-down state, the internal analog calibration is lost. After exiting from deep power down, calibration must be relaunched or calibration factor (preliminarily saved) must be set back into calibration register.
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be ADC disabled. CR DEEPPWD LL_ADC_DisableDeepPowerDown
Parameters
ADCxADC instance
Return values
None

Definition at line 5849 of file stm32l4xx_ll_adc.h.

5850 {
5851  /* Note: Write register with some additional bits forced to state reset */
5852  /* instead of modifying only the selected bit for this function, */
5853  /* to not interfere with bits with HW property "rs". */
5854  CLEAR_BIT(ADCx->CR, (ADC_CR_DEEPPWD | ADC_CR_BITS_PROPERTY_RS));
5855 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_ADC_DisableInternalRegulator()

__STATIC_INLINE void LL_ADC_DisableInternalRegulator ( ADC_TypeDef *  ADCx)

Disable ADC internal voltage regulator.

Note
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be ADC disabled. CR ADVREGEN LL_ADC_DisableInternalRegulator
Parameters
ADCxADC instance
Return values
None

Definition at line 5901 of file stm32l4xx_ll_adc.h.

5902 {
5903  CLEAR_BIT(ADCx->CR, (ADC_CR_ADVREGEN | ADC_CR_BITS_PROPERTY_RS));
5904 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_ADC_Enable()

__STATIC_INLINE void LL_ADC_Enable ( ADC_TypeDef *  ADCx)

Enable the selected ADC instance.

Note
On this STM32 serie, after ADC enable, a delay for ADC internal analog stabilization is required before performing a ADC conversion start. Refer to device datasheet, parameter tSTAB.
On this STM32 serie, flag LL_ADC_FLAG_ADRDY is raised when the ADC is enabled and when conversion clock is active. (not only core clock: this ADC has a dual clock domain)
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be ADC disabled and ADC internal voltage regulator enabled. CR ADEN LL_ADC_Enable
Parameters
ADCxADC instance
Return values
None

Definition at line 5933 of file stm32l4xx_ll_adc.h.

5934 {
5935  /* Note: Write register with some additional bits forced to state reset */
5936  /* instead of modifying only the selected bit for this function, */
5937  /* to not interfere with bits with HW property "rs". */
5938  MODIFY_REG(ADCx->CR,
5939  ADC_CR_BITS_PROPERTY_RS,
5940  ADC_CR_ADEN);
5941 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_ADC_EnableDeepPowerDown()

__STATIC_INLINE void LL_ADC_EnableDeepPowerDown ( ADC_TypeDef *  ADCx)

Put ADC instance in deep power down state.

Note
In case of ADC calibration necessary: When ADC is in deep-power-down state, the internal analog calibration is lost. After exiting from deep power down, calibration must be relaunched or calibration factor (preliminarily saved) must be set back into calibration register.
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be ADC disabled. CR DEEPPWD LL_ADC_EnableDeepPowerDown
Parameters
ADCxADC instance
Return values
None

Definition at line 5826 of file stm32l4xx_ll_adc.h.

5827 {
5828  /* Note: Write register with some additional bits forced to state reset */
5829  /* instead of modifying only the selected bit for this function, */
5830  /* to not interfere with bits with HW property "rs". */
5831  MODIFY_REG(ADCx->CR,
5832  ADC_CR_BITS_PROPERTY_RS,
5833  ADC_CR_DEEPPWD);
5834 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_ADC_EnableInternalRegulator()

__STATIC_INLINE void LL_ADC_EnableInternalRegulator ( ADC_TypeDef *  ADCx)

Enable ADC instance internal voltage regulator.

Note
On this STM32 serie, after ADC internal voltage regulator enable, a delay for ADC internal voltage regulator stabilization is required before performing a ADC calibration or ADC enable. Refer to device datasheet, parameter tADCVREG_STUP. Refer to literal LL_ADC_DELAY_INTERNAL_REGUL_STAB_US.
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be ADC disabled. CR ADVREGEN LL_ADC_EnableInternalRegulator
Parameters
ADCxADC instance
Return values
None

Definition at line 5882 of file stm32l4xx_ll_adc.h.

5883 {
5884  /* Note: Write register with some additional bits forced to state reset */
5885  /* instead of modifying only the selected bit for this function, */
5886  /* to not interfere with bits with HW property "rs". */
5887  MODIFY_REG(ADCx->CR,
5888  ADC_CR_BITS_PROPERTY_RS,
5889  ADC_CR_ADVREGEN);
5890 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_ADC_IsCalibrationOnGoing()

__STATIC_INLINE uint32_t LL_ADC_IsCalibrationOnGoing ( ADC_TypeDef *  ADCx)

Get ADC calibration state. CR ADCAL LL_ADC_IsCalibrationOnGoing.

Parameters
ADCxADC instance
Return values
0calibration complete, 1: calibration in progress.

Definition at line 6027 of file stm32l4xx_ll_adc.h.

6028 {
6029  return ((READ_BIT(ADCx->CR, ADC_CR_ADCAL) == (ADC_CR_ADCAL)) ? 1UL : 0UL);
6030 }

◆ LL_ADC_IsDeepPowerDownEnabled()

__STATIC_INLINE uint32_t LL_ADC_IsDeepPowerDownEnabled ( ADC_TypeDef *  ADCx)

Get the selected ADC instance deep power down state. CR DEEPPWD LL_ADC_IsDeepPowerDownEnabled.

Parameters
ADCxADC instance
Return values
0deep power down is disabled, 1: deep power down is enabled.

Definition at line 5863 of file stm32l4xx_ll_adc.h.

5864 {
5865  return ((READ_BIT(ADCx->CR, ADC_CR_DEEPPWD) == (ADC_CR_DEEPPWD)) ? 1UL : 0UL);
5866 }

◆ LL_ADC_IsDisableOngoing()

__STATIC_INLINE uint32_t LL_ADC_IsDisableOngoing ( ADC_TypeDef *  ADCx)

Get the selected ADC instance disable state. CR ADDIS LL_ADC_IsDisableOngoing.

Parameters
ADCxADC instance
Return values
0no ADC disable command on going.

Definition at line 5983 of file stm32l4xx_ll_adc.h.

5984 {
5985  return ((READ_BIT(ADCx->CR, ADC_CR_ADDIS) == (ADC_CR_ADDIS)) ? 1UL : 0UL);
5986 }

◆ LL_ADC_IsEnabled()

__STATIC_INLINE uint32_t LL_ADC_IsEnabled ( ADC_TypeDef *  ADCx)

Get the selected ADC instance enable state.

Note
On this STM32 serie, flag LL_ADC_FLAG_ADRDY is raised when the ADC is enabled and when conversion clock is active. (not only core clock: this ADC has a dual clock domain) CR ADEN LL_ADC_IsEnabled
Parameters
ADCxADC instance
Return values
0ADC is disabled, 1: ADC is enabled.

Definition at line 5972 of file stm32l4xx_ll_adc.h.

5973 {
5974  return ((READ_BIT(ADCx->CR, ADC_CR_ADEN) == (ADC_CR_ADEN)) ? 1UL : 0UL);
5975 }

◆ LL_ADC_IsInternalRegulatorEnabled()

__STATIC_INLINE uint32_t LL_ADC_IsInternalRegulatorEnabled ( ADC_TypeDef *  ADCx)

Get the selected ADC instance internal voltage regulator state. CR ADVREGEN LL_ADC_IsInternalRegulatorEnabled.

Parameters
ADCxADC instance
Return values
0internal regulator is disabled, 1: internal regulator is enabled.

Definition at line 5912 of file stm32l4xx_ll_adc.h.

5913 {
5914  return ((READ_BIT(ADCx->CR, ADC_CR_ADVREGEN) == (ADC_CR_ADVREGEN)) ? 1UL : 0UL);
5915 }

◆ LL_ADC_StartCalibration()

__STATIC_INLINE void LL_ADC_StartCalibration ( ADC_TypeDef *  ADCx,
uint32_t  SingleDiff 
)

Start ADC calibration in the mode single-ended or differential (for devices with differential mode available).

Note
On this STM32 serie, a minimum number of ADC clock cycles are required between ADC end of calibration and ADC enable. Refer to literal LL_ADC_DELAY_CALIB_ENABLE_ADC_CYCLES.
For devices with differential mode available: Calibration of offset is specific to each of single-ended and differential modes (calibration run must be performed for each of these differential modes, if used afterwards and if the application requires their calibration).
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be ADC disabled. CR ADCAL LL_ADC_StartCalibration
CR ADCALDIF LL_ADC_StartCalibration
Parameters
ADCxADC instance
SingleDiffThis parameter can be one of the following values:
  • LL_ADC_SINGLE_ENDED
  • LL_ADC_DIFFERENTIAL_ENDED
Return values
None

Definition at line 6011 of file stm32l4xx_ll_adc.h.

6012 {
6013  /* Note: Write register with some additional bits forced to state reset */
6014  /* instead of modifying only the selected bit for this function, */
6015  /* to not interfere with bits with HW property "rs". */
6016  MODIFY_REG(ADCx->CR,
6017  ADC_CR_ADCALDIF | ADC_CR_BITS_PROPERTY_RS,
6018  ADC_CR_ADCAL | (SingleDiff & ADC_SINGLEDIFF_CALIB_START_MASK));
6019 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)