STM32L4xx_HAL_Driver  1.14.0
Operation on ADC hierarchical scope: group injected

Functions

__STATIC_INLINE void LL_ADC_INJ_StartConversion (ADC_TypeDef *ADCx)
 Start ADC group injected conversion. More...
 
__STATIC_INLINE void LL_ADC_INJ_StopConversion (ADC_TypeDef *ADCx)
 Stop ADC group injected conversion. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_IsConversionOngoing (ADC_TypeDef *ADCx)
 Get ADC group injected conversion state. CR JADSTART LL_ADC_INJ_IsConversionOngoing. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_IsStopConversionOngoing (ADC_TypeDef *ADCx)
 Get ADC group injected command of conversion stop state CR JADSTP LL_ADC_INJ_IsStopConversionOngoing. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_ReadConversionData32 (ADC_TypeDef *ADCx, uint32_t Rank)
 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). JDR1 JDATA LL_ADC_INJ_ReadConversionData32
JDR2 JDATA LL_ADC_INJ_ReadConversionData32
JDR3 JDATA LL_ADC_INJ_ReadConversionData32
JDR4 JDATA LL_ADC_INJ_ReadConversionData32. More...
 
__STATIC_INLINE uint16_t LL_ADC_INJ_ReadConversionData12 (ADC_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected conversion data, range fit for ADC resolution 12 bits. More...
 
__STATIC_INLINE uint16_t LL_ADC_INJ_ReadConversionData10 (ADC_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected conversion data, range fit for ADC resolution 10 bits. More...
 
__STATIC_INLINE uint8_t LL_ADC_INJ_ReadConversionData8 (ADC_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected conversion data, range fit for ADC resolution 8 bits. More...
 
__STATIC_INLINE uint8_t LL_ADC_INJ_ReadConversionData6 (ADC_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected conversion data, range fit for ADC resolution 6 bits. More...
 

Detailed Description

Function Documentation

◆ LL_ADC_INJ_IsConversionOngoing()

__STATIC_INLINE uint32_t LL_ADC_INJ_IsConversionOngoing ( ADC_TypeDef *  ADCx)

Get ADC group injected conversion state. CR JADSTART LL_ADC_INJ_IsConversionOngoing.

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

Definition at line 6277 of file stm32l4xx_ll_adc.h.

6278 {
6279  return ((READ_BIT(ADCx->CR, ADC_CR_JADSTART) == (ADC_CR_JADSTART)) ? 1UL : 0UL);
6280 }

◆ LL_ADC_INJ_IsStopConversionOngoing()

__STATIC_INLINE uint32_t LL_ADC_INJ_IsStopConversionOngoing ( ADC_TypeDef *  ADCx)

Get ADC group injected command of conversion stop state CR JADSTP LL_ADC_INJ_IsStopConversionOngoing.

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

Definition at line 6288 of file stm32l4xx_ll_adc.h.

6289 {
6290  return ((READ_BIT(ADCx->CR, ADC_CR_JADSTP) == (ADC_CR_JADSTP)) ? 1UL : 0UL);
6291 }

◆ LL_ADC_INJ_ReadConversionData10()

__STATIC_INLINE uint16_t LL_ADC_INJ_ReadConversionData10 ( ADC_TypeDef *  ADCx,
uint32_t  Rank 
)

Get ADC group injected 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_INJ_ReadConversionData32. JDR1 JDATA LL_ADC_INJ_ReadConversionData10
JDR2 JDATA LL_ADC_INJ_ReadConversionData10
JDR3 JDATA LL_ADC_INJ_ReadConversionData10
JDR4 JDATA LL_ADC_INJ_ReadConversionData10
Parameters
ADCxADC instance
RankThis parameter can be one of the following values:
  • LL_ADC_INJ_RANK_1
  • LL_ADC_INJ_RANK_2
  • LL_ADC_INJ_RANK_3
  • LL_ADC_INJ_RANK_4
Return values
Valuebetween Min_Data=0x000 and Max_Data=0x3FF

Definition at line 6364 of file stm32l4xx_ll_adc.h.

6365 {
6366  register const __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, ((Rank & ADC_INJ_JDRX_REGOFFSET_MASK) >> ADC_JDRX_REGOFFSET_POS));
6367 
6368  return (uint16_t)(READ_BIT(*preg,
6369  ADC_JDR1_JDATA)
6370  );
6371 }

◆ LL_ADC_INJ_ReadConversionData12()

__STATIC_INLINE uint16_t LL_ADC_INJ_ReadConversionData12 ( ADC_TypeDef *  ADCx,
uint32_t  Rank 
)

Get ADC group injected 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_INJ_ReadConversionData32. JDR1 JDATA LL_ADC_INJ_ReadConversionData12
JDR2 JDATA LL_ADC_INJ_ReadConversionData12
JDR3 JDATA LL_ADC_INJ_ReadConversionData12
JDR4 JDATA LL_ADC_INJ_ReadConversionData12
Parameters
ADCxADC instance
RankThis parameter can be one of the following values:
  • LL_ADC_INJ_RANK_1
  • LL_ADC_INJ_RANK_2
  • LL_ADC_INJ_RANK_3
  • LL_ADC_INJ_RANK_4
Return values
Valuebetween Min_Data=0x000 and Max_Data=0xFFF

Definition at line 6337 of file stm32l4xx_ll_adc.h.

6338 {
6339  register const __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, ((Rank & ADC_INJ_JDRX_REGOFFSET_MASK) >> ADC_JDRX_REGOFFSET_POS));
6340 
6341  return (uint16_t)(READ_BIT(*preg,
6342  ADC_JDR1_JDATA)
6343  );
6344 }

◆ LL_ADC_INJ_ReadConversionData32()

__STATIC_INLINE uint32_t LL_ADC_INJ_ReadConversionData32 ( ADC_TypeDef *  ADCx,
uint32_t  Rank 
)

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). JDR1 JDATA LL_ADC_INJ_ReadConversionData32
JDR2 JDATA LL_ADC_INJ_ReadConversionData32
JDR3 JDATA LL_ADC_INJ_ReadConversionData32
JDR4 JDATA LL_ADC_INJ_ReadConversionData32.

Parameters
ADCxADC instance
RankThis parameter can be one of the following values:
  • LL_ADC_INJ_RANK_1
  • LL_ADC_INJ_RANK_2
  • LL_ADC_INJ_RANK_3
  • LL_ADC_INJ_RANK_4
Return values
Valuebetween Min_Data=0x00000000 and Max_Data=0xFFFFFFFF

Definition at line 6310 of file stm32l4xx_ll_adc.h.

6311 {
6312  register const __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, ((Rank & ADC_INJ_JDRX_REGOFFSET_MASK) >> ADC_JDRX_REGOFFSET_POS));
6313 
6314  return (uint32_t)(READ_BIT(*preg,
6315  ADC_JDR1_JDATA)
6316  );
6317 }

◆ LL_ADC_INJ_ReadConversionData6()

__STATIC_INLINE uint8_t LL_ADC_INJ_ReadConversionData6 ( ADC_TypeDef *  ADCx,
uint32_t  Rank 
)

Get ADC group injected 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_INJ_ReadConversionData32. JDR1 JDATA LL_ADC_INJ_ReadConversionData6
JDR2 JDATA LL_ADC_INJ_ReadConversionData6
JDR3 JDATA LL_ADC_INJ_ReadConversionData6
JDR4 JDATA LL_ADC_INJ_ReadConversionData6
Parameters
ADCxADC instance
RankThis parameter can be one of the following values:
  • LL_ADC_INJ_RANK_1
  • LL_ADC_INJ_RANK_2
  • LL_ADC_INJ_RANK_3
  • LL_ADC_INJ_RANK_4
Return values
Valuebetween Min_Data=0x00 and Max_Data=0x3F

Definition at line 6418 of file stm32l4xx_ll_adc.h.

6419 {
6420  register const __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, ((Rank & ADC_INJ_JDRX_REGOFFSET_MASK) >> ADC_JDRX_REGOFFSET_POS));
6421 
6422  return (uint8_t)(READ_BIT(*preg,
6423  ADC_JDR1_JDATA)
6424  );
6425 }

◆ LL_ADC_INJ_ReadConversionData8()

__STATIC_INLINE uint8_t LL_ADC_INJ_ReadConversionData8 ( ADC_TypeDef *  ADCx,
uint32_t  Rank 
)

Get ADC group injected 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_INJ_ReadConversionData32. JDR1 JDATA LL_ADC_INJ_ReadConversionData8
JDR2 JDATA LL_ADC_INJ_ReadConversionData8
JDR3 JDATA LL_ADC_INJ_ReadConversionData8
JDR4 JDATA LL_ADC_INJ_ReadConversionData8
Parameters
ADCxADC instance
RankThis parameter can be one of the following values:
  • LL_ADC_INJ_RANK_1
  • LL_ADC_INJ_RANK_2
  • LL_ADC_INJ_RANK_3
  • LL_ADC_INJ_RANK_4
Return values
Valuebetween Min_Data=0x00 and Max_Data=0xFF

Definition at line 6391 of file stm32l4xx_ll_adc.h.

6392 {
6393  register const __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, ((Rank & ADC_INJ_JDRX_REGOFFSET_MASK) >> ADC_JDRX_REGOFFSET_POS));
6394 
6395  return (uint8_t)(READ_BIT(*preg,
6396  ADC_JDR1_JDATA)
6397  );
6398 }

◆ LL_ADC_INJ_StartConversion()

__STATIC_INLINE void LL_ADC_INJ_StartConversion ( ADC_TypeDef *  ADCx)

Start ADC group injected 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 injected, without conversion stop command on going on group injected, without ADC disable command on going. CR JADSTART LL_ADC_INJ_StartConversion
Parameters
ADCxADC instance
Return values
None

Definition at line 6241 of file stm32l4xx_ll_adc.h.

6242 {
6243  /* Note: Write register with some additional bits forced to state reset */
6244  /* instead of modifying only the selected bit for this function, */
6245  /* to not interfere with bits with HW property "rs". */
6246  MODIFY_REG(ADCx->CR,
6247  ADC_CR_BITS_PROPERTY_RS,
6248  ADC_CR_JADSTART);
6249 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_ADC_INJ_StopConversion()

__STATIC_INLINE void LL_ADC_INJ_StopConversion ( ADC_TypeDef *  ADCx)

Stop ADC group injected 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 injected, without ADC disable command on going. CR JADSTP LL_ADC_INJ_StopConversion
Parameters
ADCxADC instance
Return values
None

Definition at line 6261 of file stm32l4xx_ll_adc.h.

6262 {
6263  /* Note: Write register with some additional bits forced to state reset */
6264  /* instead of modifying only the selected bit for this function, */
6265  /* to not interfere with bits with HW property "rs". */
6266  MODIFY_REG(ADCx->CR,
6267  ADC_CR_BITS_PROPERTY_RS,
6268  ADC_CR_JADSTP);
6269 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)