STM32F439xx HAL User Manual
Functions
Configuration of ADC hierarchical scope: group injected
ADC Exported Functions

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).
__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerSource (ADC_TypeDef *ADCx)
 Get ADC group injected conversion trigger source: internal (SW start) or from external IP (timer event, external interrupt line).
__STATIC_INLINE uint32_t LL_ADC_INJ_IsTriggerSourceSWStart (ADC_TypeDef *ADCx)
 Get ADC group injected conversion trigger source internal (SW start) or external.
__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerEdge (ADC_TypeDef *ADCx)
 Get ADC group injected conversion trigger polarity.
__STATIC_INLINE void LL_ADC_INJ_SetSequencerLength (ADC_TypeDef *ADCx, uint32_t SequencerNbRanks)
 Set ADC group injected sequencer length and scan direction.
__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerLength (ADC_TypeDef *ADCx)
 Get ADC group injected sequencer length and scan direction.
__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.
__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerDiscont (ADC_TypeDef *ADCx)
 Get ADC group injected sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks.
__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.
__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerRanks (ADC_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected sequence: channel on the selected sequence rank.
__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.
__STATIC_INLINE uint32_t LL_ADC_INJ_GetTrigAuto (ADC_TypeDef *ADCx)
 Get ADC group injected conversion trigger: independent or from ADC group regular.
__STATIC_INLINE void LL_ADC_INJ_SetOffset (ADC_TypeDef *ADCx, uint32_t Rank, uint32_t OffsetLevel)
 Set ADC group injected offset.
__STATIC_INLINE uint32_t LL_ADC_INJ_GetOffset (ADC_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected offset.

Function Documentation

__STATIC_INLINE uint32_t LL_ADC_INJ_GetOffset ( 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.
Reference Manual to LL API cross reference:
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:
Return values:
Valuebetween Min_Data=0x000 and Max_Data=0xFFF

Definition at line 3093 of file stm32f4xx_ll_adc.h.

References __ADC_MASK_SHIFT, __ADC_PTR_REG_OFFSET, and ADC_INJ_JOFRX_REGOFFSET_MASK.

__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerDiscont ( ADC_TypeDef *  ADCx)

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

Reference Manual to LL API cross reference:
CR1 DISCEN LL_ADC_REG_GetSequencerDiscont
Parameters:
ADCxADC instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 2865 of file stm32f4xx_ll_adc.h.

__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerLength ( 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 serie, 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.
Reference Manual to LL API cross reference:
JSQR JL LL_ADC_INJ_GetSequencerLength
Parameters:
ADCxADC instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 2832 of file stm32f4xx_ll_adc.h.

__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerRanks ( 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().
Reference Manual to LL API cross reference:
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:
Return values:
Returnedvalue can be one of the following values: (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 2986 of file stm32f4xx_ll_adc.h.

References ADC_CHANNEL_ID_NUMBER_MASK.

__STATIC_INLINE uint32_t LL_ADC_INJ_GetTrigAuto ( ADC_TypeDef *  ADCx)

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

Reference Manual to LL API cross reference:
CR1 JAUTO LL_ADC_INJ_GetTrigAuto
Parameters:
ADCxADC instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 3036 of file stm32f4xx_ll_adc.h.

__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerEdge ( ADC_TypeDef *  ADCx)

Get ADC group injected conversion trigger polarity.

Applicable only for trigger source set to external trigger.

Reference Manual to LL API cross reference:
CR2 JEXTEN LL_ADC_INJ_GetTriggerEdge
Parameters:
ADCxADC instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 2777 of file stm32f4xx_ll_adc.h.

__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerSource ( 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.
Reference Manual to LL API cross reference:
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:

Definition at line 2735 of file stm32f4xx_ll_adc.h.

References ADC_INJ_TRIG_EDGE_MASK, ADC_INJ_TRIG_EXTEN_BITOFFSET_POS, and ADC_INJ_TRIG_SOURCE_MASK.

__STATIC_INLINE uint32_t LL_ADC_INJ_IsTriggerSourceSWStart ( 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.
Reference Manual to LL API cross reference:
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 2762 of file stm32f4xx_ll_adc.h.

References LL_ADC_INJ_TRIG_SOFTWARE.

__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.
Reference Manual to LL API cross reference:
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:
OffsetLevelValue between Min_Data=0x000 and Max_Data=0xFFF
Return values:
None

Definition at line 3066 of file stm32f4xx_ll_adc.h.

References __ADC_MASK_SHIFT, __ADC_PTR_REG_OFFSET, and ADC_INJ_JOFRX_REGOFFSET_MASK.

__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.
Reference Manual to LL API cross reference:
CR1 DISCEN LL_ADC_INJ_SetSequencerDiscont
Parameters:
ADCxADC instance
SeqDiscontThis parameter can be one of the following values:
Return values:
None

Definition at line 2850 of file stm32f4xx_ll_adc.h.

__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 serie, 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.
Reference Manual to LL API cross reference:
JSQR JL LL_ADC_INJ_SetSequencerLength
Parameters:
ADCxADC instance
SequencerNbRanksThis parameter can be one of the following values:
Return values:
None

Definition at line 2805 of file stm32f4xx_ll_adc.h.

Referenced by LL_ADC_INJ_Init().

__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 serie, to measure internal channels (VrefInt, TempSensor, ...), measurement paths to internal channels must be enabled separately. This can be done using function LL_ADC_SetCommonPathInternalCh().
Reference Manual to LL API cross reference:
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:
ChannelThis parameter can be one of the following values: (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 2917 of file stm32f4xx_ll_adc.h.

References ADC_CHANNEL_ID_NUMBER_MASK.

__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.
Reference Manual to LL API cross reference:
CR1 JAUTO LL_ADC_INJ_SetTrigAuto
Parameters:
ADCxADC instance
TrigAutoThis parameter can be one of the following values:
Return values:
None

Definition at line 3022 of file stm32f4xx_ll_adc.h.

__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 serie, 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.
Reference Manual to LL API cross reference:
CR2 JEXTSEL LL_ADC_INJ_SetTriggerSource
CR2 JEXTEN LL_ADC_INJ_SetTriggerSource
Parameters:
ADCxADC instance
TriggerSourceThis parameter can be one of the following values:
Return values:
None

Definition at line 2691 of file stm32f4xx_ll_adc.h.

Referenced by LL_ADC_DeInit().