STM32L4xx_HAL_Driver  1.14.0
Operation on ADC hierarchical scope: group regular

Functions

__STATIC_INLINE void LL_ADC_REG_StartConversion (ADC_TypeDef *ADCx)
 Start ADC group regular conversion. More...
 
__STATIC_INLINE void LL_ADC_REG_StopConversion (ADC_TypeDef *ADCx)
 Stop ADC group regular conversion. More...
 
__STATIC_INLINE uint32_t LL_ADC_REG_IsConversionOngoing (ADC_TypeDef *ADCx)
 Get ADC group regular conversion state. CR ADSTART LL_ADC_REG_IsConversionOngoing. More...
 
__STATIC_INLINE uint32_t LL_ADC_REG_IsStopConversionOngoing (ADC_TypeDef *ADCx)
 Get ADC group regular command of conversion stop state CR ADSTP LL_ADC_REG_IsStopConversionOngoing. More...
 
__STATIC_INLINE uint32_t LL_ADC_REG_ReadConversionData32 (ADC_TypeDef *ADCx)
 Get ADC group regular conversion data, range fit for all ADC configurations: all ADC resolutions and all oversampling increased data width (for devices with feature oversampling). DR RDATA LL_ADC_REG_ReadConversionData32. More...
 
__STATIC_INLINE uint16_t LL_ADC_REG_ReadConversionData12 (ADC_TypeDef *ADCx)
 Get ADC group regular conversion data, range fit for ADC resolution 12 bits. More...
 
__STATIC_INLINE uint16_t LL_ADC_REG_ReadConversionData10 (ADC_TypeDef *ADCx)
 Get ADC group regular conversion data, range fit for ADC resolution 10 bits. More...
 
__STATIC_INLINE uint8_t LL_ADC_REG_ReadConversionData8 (ADC_TypeDef *ADCx)
 Get ADC group regular conversion data, range fit for ADC resolution 8 bits. More...
 
__STATIC_INLINE uint8_t LL_ADC_REG_ReadConversionData6 (ADC_TypeDef *ADCx)
 Get ADC group regular conversion data, range fit for ADC resolution 6 bits. More...
 
__STATIC_INLINE uint32_t LL_ADC_REG_ReadMultiConversionData32 (ADC_Common_TypeDef *ADCxy_COMMON, uint32_t ConversionData)
 Get ADC multimode conversion data of ADC master, ADC slave or raw data with ADC master and slave concatenated. More...
 

Detailed Description

Function Documentation

◆ LL_ADC_REG_IsConversionOngoing()

__STATIC_INLINE uint32_t LL_ADC_REG_IsConversionOngoing ( ADC_TypeDef *  ADCx)

Get ADC group regular conversion state. CR ADSTART LL_ADC_REG_IsConversionOngoing.

Parameters
ADCxADC instance
Return values
0no conversion is on going on ADC group regular.

Definition at line 6094 of file stm32l4xx_ll_adc.h.

6095 {
6096  return ((READ_BIT(ADCx->CR, ADC_CR_ADSTART) == (ADC_CR_ADSTART)) ? 1UL : 0UL);
6097 }

◆ LL_ADC_REG_IsStopConversionOngoing()

__STATIC_INLINE uint32_t LL_ADC_REG_IsStopConversionOngoing ( ADC_TypeDef *  ADCx)

Get ADC group regular command of conversion stop state CR ADSTP LL_ADC_REG_IsStopConversionOngoing.

Parameters
ADCxADC instance
Return values
0no command of conversion stop is on going on ADC group regular.

Definition at line 6105 of file stm32l4xx_ll_adc.h.

6106 {
6107  return ((READ_BIT(ADCx->CR, ADC_CR_ADSTP) == (ADC_CR_ADSTP)) ? 1UL : 0UL);
6108 }

◆ LL_ADC_REG_ReadConversionData10()

__STATIC_INLINE uint16_t LL_ADC_REG_ReadConversionData10 ( ADC_TypeDef *  ADCx)

Get ADC group regular conversion data, range fit for ADC resolution 10 bits.

Note
For devices with feature oversampling: Oversampling can increase data width, function for extended range may be needed: LL_ADC_REG_ReadConversionData32. DR RDATA LL_ADC_REG_ReadConversionData10
Parameters
ADCxADC instance
Return values
Valuebetween Min_Data=0x000 and Max_Data=0x3FF

Definition at line 6149 of file stm32l4xx_ll_adc.h.

6150 {
6151  return (uint16_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA));
6152 }

◆ LL_ADC_REG_ReadConversionData12()

__STATIC_INLINE uint16_t LL_ADC_REG_ReadConversionData12 ( ADC_TypeDef *  ADCx)

Get ADC group regular conversion data, range fit for ADC resolution 12 bits.

Note
For devices with feature oversampling: Oversampling can increase data width, function for extended range may be needed: LL_ADC_REG_ReadConversionData32. DR RDATA LL_ADC_REG_ReadConversionData12
Parameters
ADCxADC instance
Return values
Valuebetween Min_Data=0x000 and Max_Data=0xFFF

Definition at line 6134 of file stm32l4xx_ll_adc.h.

6135 {
6136  return (uint16_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA));
6137 }

◆ LL_ADC_REG_ReadConversionData32()

__STATIC_INLINE uint32_t LL_ADC_REG_ReadConversionData32 ( ADC_TypeDef *  ADCx)

Get ADC group regular conversion data, range fit for all ADC configurations: all ADC resolutions and all oversampling increased data width (for devices with feature oversampling). DR RDATA LL_ADC_REG_ReadConversionData32.

Parameters
ADCxADC instance
Return values
Valuebetween Min_Data=0x00000000 and Max_Data=0xFFFFFFFF

Definition at line 6119 of file stm32l4xx_ll_adc.h.

6120 {
6121  return (uint32_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA));
6122 }

◆ LL_ADC_REG_ReadConversionData6()

__STATIC_INLINE uint8_t LL_ADC_REG_ReadConversionData6 ( ADC_TypeDef *  ADCx)

Get ADC group regular conversion data, range fit for ADC resolution 6 bits.

Note
For devices with feature oversampling: Oversampling can increase data width, function for extended range may be needed: LL_ADC_REG_ReadConversionData32. DR RDATA LL_ADC_REG_ReadConversionData6
Parameters
ADCxADC instance
Return values
Valuebetween Min_Data=0x00 and Max_Data=0x3F

Definition at line 6179 of file stm32l4xx_ll_adc.h.

6180 {
6181  return (uint8_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA));
6182 }

◆ LL_ADC_REG_ReadConversionData8()

__STATIC_INLINE uint8_t LL_ADC_REG_ReadConversionData8 ( ADC_TypeDef *  ADCx)

Get ADC group regular conversion data, range fit for ADC resolution 8 bits.

Note
For devices with feature oversampling: Oversampling can increase data width, function for extended range may be needed: LL_ADC_REG_ReadConversionData32. DR RDATA LL_ADC_REG_ReadConversionData8
Parameters
ADCxADC instance
Return values
Valuebetween Min_Data=0x00 and Max_Data=0xFF

Definition at line 6164 of file stm32l4xx_ll_adc.h.

6165 {
6166  return (uint8_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA));
6167 }

◆ LL_ADC_REG_ReadMultiConversionData32()

__STATIC_INLINE uint32_t LL_ADC_REG_ReadMultiConversionData32 ( ADC_Common_TypeDef *  ADCxy_COMMON,
uint32_t  ConversionData 
)

Get ADC multimode conversion data of ADC master, ADC slave or raw data with ADC master and slave concatenated.

Note
If raw data with ADC master and slave concatenated is retrieved, a macro is available to get the conversion data of ADC master or ADC slave: see helper macro __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE(). (however this macro is mainly intended for multimode transfer by DMA, because this function can do the same by getting multimode conversion data of ADC master or ADC slave separately). CDR RDATA_MST LL_ADC_REG_ReadMultiConversionData32
CDR RDATA_SLV LL_ADC_REG_ReadMultiConversionData32
Parameters
ADCxy_COMMONADC common instance (can be set directly from CMSIS definition or by using helper macro __LL_ADC_COMMON_INSTANCE() )
ConversionDataThis parameter can be one of the following values:
  • LL_ADC_MULTI_MASTER
  • LL_ADC_MULTI_SLAVE
  • LL_ADC_MULTI_MASTER_SLAVE
Return values
Valuebetween Min_Data=0x00000000 and Max_Data=0xFFFFFFFF

Definition at line 6206 of file stm32l4xx_ll_adc.h.

6207 {
6208  return (uint32_t)(READ_BIT(ADCxy_COMMON->CDR,
6209  ConversionData)
6210  >> (POSITION_VAL(ConversionData) & 0x1FUL)
6211  );
6212 }

◆ LL_ADC_REG_StartConversion()

__STATIC_INLINE void LL_ADC_REG_StartConversion ( ADC_TypeDef *  ADCx)

Start ADC group regular conversion.

Note
On this STM32 serie, this function is relevant for both internal trigger (SW start) and external trigger:
  • If ADC trigger has been set to software start, ADC conversion starts immediately.
  • If ADC trigger has been set to external trigger, ADC conversion will start at next trigger event (on the selected trigger edge) following the ADC start conversion command.
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be enabled without conversion on going on group regular, without conversion stop command on going on group regular, without ADC disable command on going. CR ADSTART LL_ADC_REG_StartConversion
Parameters
ADCxADC instance
Return values
None

Definition at line 6058 of file stm32l4xx_ll_adc.h.

6059 {
6060  /* Note: Write register with some additional bits forced to state reset */
6061  /* instead of modifying only the selected bit for this function, */
6062  /* to not interfere with bits with HW property "rs". */
6063  MODIFY_REG(ADCx->CR,
6064  ADC_CR_BITS_PROPERTY_RS,
6065  ADC_CR_ADSTART);
6066 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_ADC_REG_StopConversion()

__STATIC_INLINE void LL_ADC_REG_StopConversion ( ADC_TypeDef *  ADCx)

Stop ADC group regular conversion.

Note
On this STM32 serie, setting of this feature is conditioned to ADC state: ADC must be enabled with conversion on going on group regular, without ADC disable command on going. CR ADSTP LL_ADC_REG_StopConversion
Parameters
ADCxADC instance
Return values
None

Definition at line 6078 of file stm32l4xx_ll_adc.h.

6079 {
6080  /* Note: Write register with some additional bits forced to state reset */
6081  /* instead of modifying only the selected bit for this function, */
6082  /* to not interfere with bits with HW property "rs". */
6083  MODIFY_REG(ADCx->CR,
6084  ADC_CR_BITS_PROPERTY_RS,
6085  ADC_CR_ADSTP);
6086 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)