STM32F4xx_HAL_Driver  1.8.3
Configuration of ADC hierarchical scope: group injected
+ Collaboration diagram for Configuration of ADC hierarchical scope: group injected:

Functions

__STATIC_INLINE void LL_ADC_INJ_SetTriggerSource (ADC_TypeDef *ADCx, uint32_t TriggerSource)
 Set ADC group injected conversion trigger source: internal (SW start) or from external IP (timer event, external interrupt line). More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerSource (const ADC_TypeDef *ADCx)
 Get ADC group injected conversion trigger source: internal (SW start) or from external IP (timer event, external interrupt line). More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_IsTriggerSourceSWStart (const ADC_TypeDef *ADCx)
 Get ADC group injected conversion trigger source internal (SW start) or external. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerEdge (const ADC_TypeDef *ADCx)
 Get ADC group injected conversion trigger polarity. Applicable only for trigger source set to external trigger. @rmtoll CR2 JEXTEN LL_ADC_INJ_GetTriggerEdge. More...
 
__STATIC_INLINE void LL_ADC_INJ_SetSequencerLength (ADC_TypeDef *ADCx, uint32_t SequencerNbRanks)
 Set ADC group injected sequencer length and scan direction. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerLength (const ADC_TypeDef *ADCx)
 Get ADC group injected sequencer length and scan direction. More...
 
__STATIC_INLINE void LL_ADC_INJ_SetSequencerDiscont (ADC_TypeDef *ADCx, uint32_t SeqDiscont)
 Set ADC group injected sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerDiscont (const ADC_TypeDef *ADCx)
 Get ADC group injected sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks. @rmtoll CR1 DISCEN LL_ADC_REG_GetSequencerDiscont. More...
 
__STATIC_INLINE void LL_ADC_INJ_SetSequencerRanks (ADC_TypeDef *ADCx, uint32_t Rank, uint32_t Channel)
 Set ADC group injected sequence: channel on the selected sequence rank. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerRanks (const ADC_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected sequence: channel on the selected sequence rank. More...
 
__STATIC_INLINE void LL_ADC_INJ_SetTrigAuto (ADC_TypeDef *ADCx, uint32_t TrigAuto)
 Set ADC group injected conversion trigger: independent or from ADC group regular. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_GetTrigAuto (const ADC_TypeDef *ADCx)
 Get ADC group injected conversion trigger: independent or from ADC group regular. @rmtoll CR1 JAUTO LL_ADC_INJ_GetTrigAuto. More...
 
__STATIC_INLINE void LL_ADC_INJ_SetOffset (ADC_TypeDef *ADCx, uint32_t Rank, uint32_t OffsetLevel)
 Set ADC group injected offset. More...
 
__STATIC_INLINE uint32_t LL_ADC_INJ_GetOffset (const ADC_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected offset. More...
 

Detailed Description

Function Documentation

◆ LL_ADC_INJ_GetOffset()

__STATIC_INLINE uint32_t LL_ADC_INJ_GetOffset ( const ADC_TypeDef *  ADCx,
uint32_t  Rank 
)

Get ADC group injected offset.

Note
It gives offset level (offset to be subtracted from the raw converted data). Caution: Offset format is dependent to ADC resolution: offset has to be left-aligned on bit 11, the LSB (right bits) are set to 0. @rmtoll JOFR1 JOFFSET1 LL_ADC_INJ_GetOffset
JOFR2 JOFFSET2 LL_ADC_INJ_GetOffset
JOFR3 JOFFSET3 LL_ADC_INJ_GetOffset
JOFR4 JOFFSET4 LL_ADC_INJ_GetOffset
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 3186 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_GetSequencerDiscont()

__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerDiscont ( const ADC_TypeDef *  ADCx)

Get ADC group injected sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks. @rmtoll CR1 DISCEN LL_ADC_REG_GetSequencerDiscont.

Parameters
ADCxADC instance
Return values
Returnedvalue can be one of the following values:
  • LL_ADC_INJ_SEQ_DISCONT_DISABLE
  • LL_ADC_INJ_SEQ_DISCONT_1RANK

Definition at line 2958 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_GetSequencerLength()

__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerLength ( const ADC_TypeDef *  ADCx)

Get ADC group injected sequencer length and scan direction.

Note
This function retrieves:
  • Sequence length: Number of ranks in the scan sequence.
  • Sequence direction: Unless specified in parameters, sequencer scan direction is forward (from rank 1 to rank n).
On this STM32 series, group injected sequencer configuration is conditioned to ADC instance sequencer mode. If ADC instance sequencer mode is disabled, sequencers of all groups (group regular, group injected) can be configured but their execution is disabled (limited to rank 1). Refer to function LL_ADC_SetSequencersScanMode().
Sequencer disabled is equivalent to sequencer of 1 rank: ADC conversion on only 1 channel. @rmtoll JSQR JL LL_ADC_INJ_GetSequencerLength
Parameters
ADCxADC instance
Return values
Returnedvalue can be one of the following values:
  • LL_ADC_INJ_SEQ_SCAN_DISABLE
  • LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS
  • LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS
  • LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS

Definition at line 2925 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_GetSequencerRanks()

__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerRanks ( const ADC_TypeDef *  ADCx,
uint32_t  Rank 
)

Get ADC group injected sequence: channel on the selected sequence rank.

Note
Depending on devices and packages, some channels may not be available. Refer to device datasheet for channels availability.
Usage of the returned channel number:
  • To reinject this channel into another function LL_ADC_xxx: the returned channel number is only partly formatted on definition of literals LL_ADC_CHANNEL_x. Therefore, it has to be compared with parts of literals LL_ADC_CHANNEL_x or using helper macro __LL_ADC_CHANNEL_TO_DECIMAL_NB(). Then the selected literal LL_ADC_CHANNEL_x can be used as parameter for another function.
  • To get the channel number in decimal format: process the returned value with the helper macro __LL_ADC_CHANNEL_TO_DECIMAL_NB(). @rmtoll JSQR JSQ1 LL_ADC_INJ_SetSequencerRanks
    JSQR JSQ2 LL_ADC_INJ_SetSequencerRanks
    JSQR JSQ3 LL_ADC_INJ_SetSequencerRanks
    JSQR JSQ4 LL_ADC_INJ_SetSequencerRanks
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
Returnedvalue can be one of the following values:
  • LL_ADC_CHANNEL_0
  • LL_ADC_CHANNEL_1
  • LL_ADC_CHANNEL_2
  • LL_ADC_CHANNEL_3
  • LL_ADC_CHANNEL_4
  • LL_ADC_CHANNEL_5
  • LL_ADC_CHANNEL_6
  • LL_ADC_CHANNEL_7
  • LL_ADC_CHANNEL_8
  • LL_ADC_CHANNEL_9
  • LL_ADC_CHANNEL_10
  • LL_ADC_CHANNEL_11
  • LL_ADC_CHANNEL_12
  • LL_ADC_CHANNEL_13
  • LL_ADC_CHANNEL_14
  • LL_ADC_CHANNEL_15
  • LL_ADC_CHANNEL_16
  • LL_ADC_CHANNEL_17
  • LL_ADC_CHANNEL_18
  • LL_ADC_CHANNEL_VREFINT (1)
  • LL_ADC_CHANNEL_TEMPSENSOR (1)(2)
  • LL_ADC_CHANNEL_VBAT (1)
(1) On STM32F4, parameter available only on ADC instance: ADC1.
(2) On devices STM32F42x and STM32F43x, limitation: this internal channel is shared between temperature sensor and Vbat, only 1 measurement path must be enabled.
(1) For ADC channel read back from ADC register, comparison with internal channel parameter to be done using helper macro __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL().

Definition at line 3079 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_GetTrigAuto()

__STATIC_INLINE uint32_t LL_ADC_INJ_GetTrigAuto ( const ADC_TypeDef *  ADCx)

Get ADC group injected conversion trigger: independent or from ADC group regular. @rmtoll CR1 JAUTO LL_ADC_INJ_GetTrigAuto.

Parameters
ADCxADC instance
Return values
Returnedvalue can be one of the following values:
  • LL_ADC_INJ_TRIG_INDEPENDENT
  • LL_ADC_INJ_TRIG_FROM_GRP_REGULAR

Definition at line 3129 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_GetTriggerEdge()

__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerEdge ( const ADC_TypeDef *  ADCx)

Get ADC group injected conversion trigger polarity. Applicable only for trigger source set to external trigger. @rmtoll CR2 JEXTEN LL_ADC_INJ_GetTriggerEdge.

Parameters
ADCxADC instance
Return values
Returnedvalue can be one of the following values:
  • LL_ADC_INJ_TRIG_EXT_RISING
  • LL_ADC_INJ_TRIG_EXT_FALLING
  • LL_ADC_INJ_TRIG_EXT_RISINGFALLING

Definition at line 2870 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_GetTriggerSource()

__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerSource ( const ADC_TypeDef *  ADCx)

Get ADC group injected conversion trigger source: internal (SW start) or from external IP (timer event, external interrupt line).

Note
To determine whether group injected trigger source is internal (SW start) or external, without detail of which peripheral is selected as external trigger, (equivalent to "if(LL_ADC_INJ_GetTriggerSource(ADC1) == LL_ADC_INJ_TRIG_SOFTWARE)") use function LL_ADC_INJ_IsTriggerSourceSWStart.
Availability of parameters of trigger sources from timer depends on timers availability on the selected device. @rmtoll CR2 JEXTSEL LL_ADC_INJ_GetTriggerSource
CR2 JEXTEN LL_ADC_INJ_GetTriggerSource
Parameters
ADCxADC instance
Return values
Returnedvalue can be one of the following values:
  • LL_ADC_INJ_TRIG_SOFTWARE
  • LL_ADC_INJ_TRIG_EXT_TIM1_CH4
  • LL_ADC_INJ_TRIG_EXT_TIM1_TRGO
  • LL_ADC_INJ_TRIG_EXT_TIM2_CH1
  • LL_ADC_INJ_TRIG_EXT_TIM2_TRGO
  • LL_ADC_INJ_TRIG_EXT_TIM3_CH2
  • LL_ADC_INJ_TRIG_EXT_TIM3_CH4
  • LL_ADC_INJ_TRIG_EXT_TIM4_CH1
  • LL_ADC_INJ_TRIG_EXT_TIM4_CH2
  • LL_ADC_INJ_TRIG_EXT_TIM4_CH3
  • LL_ADC_INJ_TRIG_EXT_TIM4_TRGO
  • LL_ADC_INJ_TRIG_EXT_TIM5_CH4
  • LL_ADC_INJ_TRIG_EXT_TIM5_TRGO
  • LL_ADC_INJ_TRIG_EXT_TIM8_CH2
  • LL_ADC_INJ_TRIG_EXT_TIM8_CH3
  • LL_ADC_INJ_TRIG_EXT_TIM8_CH4
  • LL_ADC_INJ_TRIG_EXT_EXTI_LINE15

Definition at line 2828 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_IsTriggerSourceSWStart()

__STATIC_INLINE uint32_t LL_ADC_INJ_IsTriggerSourceSWStart ( const ADC_TypeDef *  ADCx)

Get ADC group injected conversion trigger source internal (SW start) or external.

Note
In case of group injected trigger source set to external trigger, to determine which peripheral is selected as external trigger, use function LL_ADC_INJ_GetTriggerSource. @rmtoll CR2 JEXTEN LL_ADC_INJ_IsTriggerSourceSWStart
Parameters
ADCxADC instance
Return values
Value"0" if trigger source external trigger Value "1" if trigger source SW start.

Definition at line 2855 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_SetOffset()

__STATIC_INLINE void LL_ADC_INJ_SetOffset ( ADC_TypeDef *  ADCx,
uint32_t  Rank,
uint32_t  OffsetLevel 
)

Set ADC group injected offset.

Note
It sets:
  • ADC group injected rank to which the offset programmed will be applied
  • Offset level (offset to be subtracted from the raw converted data). Caution: Offset format is dependent to ADC resolution: offset has to be left-aligned on bit 11, the LSB (right bits) are set to 0.
Offset cannot be enabled or disabled. To emulate offset disabled, set an offset value equal to 0. @rmtoll JOFR1 JOFFSET1 LL_ADC_INJ_SetOffset
JOFR2 JOFFSET2 LL_ADC_INJ_SetOffset
JOFR3 JOFFSET3 LL_ADC_INJ_SetOffset
JOFR4 JOFFSET4 LL_ADC_INJ_SetOffset
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
OffsetLevelValue between Min_Data=0x000 and Max_Data=0xFFF
Return values
None

Definition at line 3159 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_SetSequencerDiscont()

__STATIC_INLINE void LL_ADC_INJ_SetSequencerDiscont ( ADC_TypeDef *  ADCx,
uint32_t  SeqDiscont 
)

Set ADC group injected sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks.

Note
It is not possible to enable both ADC group injected auto-injected mode and sequencer discontinuous mode. @rmtoll CR1 DISCEN LL_ADC_INJ_SetSequencerDiscont
Parameters
ADCxADC instance
SeqDiscontThis parameter can be one of the following values:
  • LL_ADC_INJ_SEQ_DISCONT_DISABLE
  • LL_ADC_INJ_SEQ_DISCONT_1RANK
Return values
None

Definition at line 2943 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_SetSequencerLength()

__STATIC_INLINE void LL_ADC_INJ_SetSequencerLength ( ADC_TypeDef *  ADCx,
uint32_t  SequencerNbRanks 
)

Set ADC group injected sequencer length and scan direction.

Note
This function performs configuration of:
  • Sequence length: Number of ranks in the scan sequence.
  • Sequence direction: Unless specified in parameters, sequencer scan direction is forward (from rank 1 to rank n).
On this STM32 series, group injected sequencer configuration is conditioned to ADC instance sequencer mode. If ADC instance sequencer mode is disabled, sequencers of all groups (group regular, group injected) can be configured but their execution is disabled (limited to rank 1). Refer to function LL_ADC_SetSequencersScanMode().
Sequencer disabled is equivalent to sequencer of 1 rank: ADC conversion on only 1 channel. @rmtoll JSQR JL LL_ADC_INJ_SetSequencerLength
Parameters
ADCxADC instance
SequencerNbRanksThis parameter can be one of the following values:
  • LL_ADC_INJ_SEQ_SCAN_DISABLE
  • LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS
  • LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS
  • LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS
Return values
None

Definition at line 2898 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_SetSequencerRanks()

__STATIC_INLINE void LL_ADC_INJ_SetSequencerRanks ( ADC_TypeDef *  ADCx,
uint32_t  Rank,
uint32_t  Channel 
)

Set ADC group injected sequence: channel on the selected sequence rank.

Note
Depending on devices and packages, some channels may not be available. Refer to device datasheet for channels availability.
On this STM32 series, to measure internal channels (VrefInt, TempSensor, ...), measurement paths to internal channels must be enabled separately. This can be done using function LL_ADC_SetCommonPathInternalCh(). @rmtoll JSQR JSQ1 LL_ADC_INJ_SetSequencerRanks
JSQR JSQ2 LL_ADC_INJ_SetSequencerRanks
JSQR JSQ3 LL_ADC_INJ_SetSequencerRanks
JSQR JSQ4 LL_ADC_INJ_SetSequencerRanks
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
ChannelThis parameter can be one of the following values:
  • LL_ADC_CHANNEL_0
  • LL_ADC_CHANNEL_1
  • LL_ADC_CHANNEL_2
  • LL_ADC_CHANNEL_3
  • LL_ADC_CHANNEL_4
  • LL_ADC_CHANNEL_5
  • LL_ADC_CHANNEL_6
  • LL_ADC_CHANNEL_7
  • LL_ADC_CHANNEL_8
  • LL_ADC_CHANNEL_9
  • LL_ADC_CHANNEL_10
  • LL_ADC_CHANNEL_11
  • LL_ADC_CHANNEL_12
  • LL_ADC_CHANNEL_13
  • LL_ADC_CHANNEL_14
  • LL_ADC_CHANNEL_15
  • LL_ADC_CHANNEL_16
  • LL_ADC_CHANNEL_17
  • LL_ADC_CHANNEL_18
  • LL_ADC_CHANNEL_VREFINT (1)
  • LL_ADC_CHANNEL_TEMPSENSOR (1)(2)
  • LL_ADC_CHANNEL_VBAT (1)
(1) On STM32F4, parameter available only on ADC instance: ADC1.
(2) On devices STM32F42x and STM32F43x, limitation: this internal channel is shared between temperature sensor and Vbat, only 1 measurement path must be enabled.
Return values
None

Definition at line 3010 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_SetTrigAuto()

__STATIC_INLINE void LL_ADC_INJ_SetTrigAuto ( ADC_TypeDef *  ADCx,
uint32_t  TrigAuto 
)

Set ADC group injected conversion trigger: independent or from ADC group regular.

Note
This mode can be used to extend number of data registers updated after one ADC conversion trigger and with data permanently kept (not erased by successive conversions of scan of ADC sequencer ranks), up to 5 data registers: 1 data register on ADC group regular, 4 data registers on ADC group injected.
If ADC group injected injected trigger source is set to an external trigger, this feature must be must be set to independent trigger. ADC group injected automatic trigger is compliant only with group injected trigger source set to SW start, without any further action on ADC group injected conversion start or stop: in this case, ADC group injected is controlled only from ADC group regular.
It is not possible to enable both ADC group injected auto-injected mode and sequencer discontinuous mode. @rmtoll CR1 JAUTO LL_ADC_INJ_SetTrigAuto
Parameters
ADCxADC instance
TrigAutoThis parameter can be one of the following values:
  • LL_ADC_INJ_TRIG_INDEPENDENT
  • LL_ADC_INJ_TRIG_FROM_GRP_REGULAR
Return values
None

Definition at line 3115 of file stm32f4xx_ll_adc.h.

◆ LL_ADC_INJ_SetTriggerSource()

__STATIC_INLINE void LL_ADC_INJ_SetTriggerSource ( ADC_TypeDef *  ADCx,
uint32_t  TriggerSource 
)

Set ADC group injected conversion trigger source: internal (SW start) or from external IP (timer event, external interrupt line).

Note
On this STM32 series, setting of external trigger edge is performed using function LL_ADC_INJ_StartConversionExtTrig().
Availability of parameters of trigger sources from timer depends on timers availability on the selected device. @rmtoll CR2 JEXTSEL LL_ADC_INJ_SetTriggerSource
CR2 JEXTEN LL_ADC_INJ_SetTriggerSource
Parameters
ADCxADC instance
TriggerSourceThis parameter can be one of the following values:
  • LL_ADC_INJ_TRIG_SOFTWARE
  • LL_ADC_INJ_TRIG_EXT_TIM1_CH4
  • LL_ADC_INJ_TRIG_EXT_TIM1_TRGO
  • LL_ADC_INJ_TRIG_EXT_TIM2_CH1
  • LL_ADC_INJ_TRIG_EXT_TIM2_TRGO
  • LL_ADC_INJ_TRIG_EXT_TIM3_CH2
  • LL_ADC_INJ_TRIG_EXT_TIM3_CH4
  • LL_ADC_INJ_TRIG_EXT_TIM4_CH1
  • LL_ADC_INJ_TRIG_EXT_TIM4_CH2
  • LL_ADC_INJ_TRIG_EXT_TIM4_CH3
  • LL_ADC_INJ_TRIG_EXT_TIM4_TRGO
  • LL_ADC_INJ_TRIG_EXT_TIM5_CH4
  • LL_ADC_INJ_TRIG_EXT_TIM5_TRGO
  • LL_ADC_INJ_TRIG_EXT_TIM8_CH2
  • LL_ADC_INJ_TRIG_EXT_TIM8_CH3
  • LL_ADC_INJ_TRIG_EXT_TIM8_CH4
  • LL_ADC_INJ_TRIG_EXT_EXTI_LINE15
Return values
None

Definition at line 2784 of file stm32f4xx_ll_adc.h.