G32R430 Device Driver Layer v1.0.4
G32R4xx Device Driver Layer API Reference
Configuration of ADC hierarchical scope: group injected

Functions

__STATIC_INLINE void DDL_ADC16_INJ_SetTriggerSource (ADC16_TypeDef *ADCx, uint32_t TriggerSource)
 Set ADC group injected conversion trigger source: internal (SW start) or from external peripheral (timer event, external interrupt line).
__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetTriggerSource (ADC16_TypeDef *ADCx)
 Get ADC group injected conversion trigger source: internal (SW start) or from external peripheral (timer event, external interrupt line).
__STATIC_INLINE uint32_t DDL_ADC16_INJ_IsTriggerSourceSWStart (ADC16_TypeDef *ADCx)
 Get ADC group injected conversion trigger source internal (SW start) or external.
__STATIC_INLINE void DDL_ADC16_INJ_SetTriggerEdge (ADC16_TypeDef *ADCx, uint32_t ExternalTriggerEdge)
 Set ADC group injected conversion trigger polarity. Applicable only for trigger source set to external trigger.
__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetTriggerEdge (ADC16_TypeDef *ADCx)
 Get ADC group injected conversion trigger polarity. Applicable only for trigger source set to external trigger.
__STATIC_INLINE void DDL_ADC16_INJ_SetSequencerLength (ADC16_TypeDef *ADCx, uint32_t SequencerNbRanks)
 Set ADC group injected sequencer length and scan direction.
__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetSequencerLength (ADC16_TypeDef *ADCx)
 Get ADC group injected sequencer length and scan direction.
__STATIC_INLINE void DDL_ADC16_INJ_SetSequencerDiscont (ADC16_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 DDL_ADC16_INJ_GetSequencerDiscont (ADC16_TypeDef *ADCx)
 Get ADC group injected sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks.
__STATIC_INLINE void DDL_ADC16_INJ_SetSequencerRanks (ADC16_TypeDef *ADCx, uint32_t Rank, uint32_t Channel)
 Set ADC group injected sequence: channel on the selected sequence rank.
__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetSequencerRanks (ADC16_TypeDef *ADCx, uint32_t Rank)
 Get ADC group injected sequence: channel on the selected sequence rank.
__STATIC_INLINE void DDL_ADC16_INJ_SetTrigAuto (ADC16_TypeDef *ADCx, uint32_t TrigAuto)
 Set ADC group injected conversion trigger: independent or from ADC group regular.
__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetTrigAuto (ADC16_TypeDef *ADCx)
 Get ADC group injected conversion trigger: independent or from ADC group regular.
__STATIC_INLINE void DDL_ADC16_INJ_SetQueueMode (ADC16_TypeDef *ADCx, uint32_t QueueMode)
 Set ADC group injected contexts queue mode.
__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetQueueMode (ADC16_TypeDef *ADCx)
 Get ADC group injected context queue mode.
__STATIC_INLINE void DDL_ADC16_INJ_ConfigQueueContext (ADC16_TypeDef *ADCx, uint32_t TriggerSource, uint32_t ExternalTriggerEdge, uint32_t SequencerNbRanks, uint32_t Rank1_Channel, uint32_t Rank2_Channel, uint32_t Rank3_Channel, uint32_t Rank4_Channel)
 Set one context on ADC group injected that will be checked in contexts queue.

Detailed Description

Function Documentation

◆ DDL_ADC16_INJ_ConfigQueueContext()

__STATIC_INLINE void DDL_ADC16_INJ_ConfigQueueContext ( ADC16_TypeDef * ADCx,
uint32_t TriggerSource,
uint32_t ExternalTriggerEdge,
uint32_t SequencerNbRanks,
uint32_t Rank1_Channel,
uint32_t Rank2_Channel,
uint32_t Rank3_Channel,
uint32_t Rank4_Channel )

Set one context on ADC group injected that will be checked in contexts queue.

Note
A context is a setting of group injected sequencer:
  • group injected trigger
  • sequencer length
  • sequencer ranks This function is intended to be used when contexts queue is enabled, because the sequence must be fully configured in one time (functions to set separately injected trigger and sequencer channels cannot be used): Refer to function DDL_ADC16_INJ_SetQueueMode().
In the contexts queue, only the active context can be read. The parameters of this function can be read using functions:
Parameters
ADCxADC instance
TriggerSourceThis parameter can be one of the following values:
ExternalTriggerEdgeThis parameter can be one of the following values: Note: This parameter is discarded in case of SW start: parameter "TriggerSource" set to "DDL_ADC16_INJ_TRIG_SOFTWARE".
SequencerNbRanksThis parameter can be one of the following values:
Rank1_ChannelThis parameter can be one of the following values:
Rank2_ChannelThis parameter can be one of the following values:
Rank3_ChannelThis parameter can be one of the following values:
Rank4_ChannelThis parameter can be one of the following values:
Return values
None

Definition at line 2204 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_GetQueueMode()

__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetQueueMode ( ADC16_TypeDef * ADCx)

Get ADC group injected context queue mode.

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

Definition at line 2125 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_GetSequencerDiscont()

__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetSequencerDiscont ( ADC16_TypeDef * ADCx)

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

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

Definition at line 1946 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_GetSequencerLength()

__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetSequencerLength ( ADC16_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).
Sequencer disabled is equivalent to sequencer of 1 rank: ADC conversion on only 1 channel.
Parameters
ADCxADC instance
Return values
Returnedvalue can be one of the following values:

Definition at line 1915 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_GetSequencerRanks()

__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetSequencerRanks ( ADC16_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.
Parameters
ADCxADC instance
ChannelThis parameter can be one of the following values:

Definition at line 2014 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_GetTrigAuto()

__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetTrigAuto ( ADC16_TypeDef * ADCx)

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

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

Definition at line 2072 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_GetTriggerEdge()

__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetTriggerEdge ( ADC16_TypeDef * ADCx)

Get ADC group injected conversion trigger polarity. Applicable only for trigger source set to external trigger.

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

Definition at line 1871 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_GetTriggerSource()

__STATIC_INLINE uint32_t DDL_ADC16_INJ_GetTriggerSource ( ADC16_TypeDef * ADCx)

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

Note
Availability of parameters of trigger sources from timer depends on timers availability on the selected device.
Parameters
ADCxADC instance
Return values
Returnedvalue can be one of the following values:

Definition at line 1828 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_IsTriggerSourceSWStart()

__STATIC_INLINE uint32_t DDL_ADC16_INJ_IsTriggerSourceSWStart ( ADC16_TypeDef * ADCx)

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

Parameters
ADCxADC instance
Return values
Value"0" if trigger source external trigger Value "1" if trigger source SW start.

Definition at line 1840 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_SetQueueMode()

__STATIC_INLINE void DDL_ADC16_INJ_SetQueueMode ( ADC16_TypeDef * ADCx,
uint32_t QueueMode )

Set ADC group injected contexts queue mode.

Note
A context is a setting of group injected sequencer:
  • group injected trigger
  • sequencer length
  • sequencer ranks If contexts queue is disabled:
  • only 1 sequence can be configured and is active perpetually. If contexts queue is enabled:
  • up to 2 contexts can be queued and are checked in and out as a FIFO stack (first-in, first-out).
  • If a new context is set when queues is full, error is triggered by interruption "Injected Queue Overflow".
  • Two behaviors are possible when all contexts have been processed: the contexts queue can maintain the last context active perpetually or can be empty and injected group triggers are disabled.
  • Triggers can be only external (not internal SW start)
  • Caution: The sequence must be fully configured in one time (one write of register JSQR makes a check-in of a new context into the queue). Therefore functions to set separately injected trigger and sequencer channels cannot be used, register JSQR must be set using function DDL_ADC16_INJ_ConfigQueueContext().
This parameter can be modified only when no conversion is on going on either groups regular or injected.
A modification of the context mode (bit JQDIS) causes the contexts queue to be flushed and the register JSQR is cleared.
Parameters
ADCxADC instance
QueueModeThis parameter can be one of the following values:
Return values
None

Definition at line 2112 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_SetSequencerDiscont()

__STATIC_INLINE void DDL_ADC16_INJ_SetSequencerDiscont ( ADC16_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.
Parameters
ADCxADC instance
SeqDiscontThis parameter can be one of the following values:
Return values
None

Definition at line 1932 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_SetSequencerLength()

__STATIC_INLINE void DDL_ADC16_INJ_SetSequencerLength ( ADC16_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).
Sequencer disabled is equivalent to sequencer of 1 rank: ADC conversion on only 1 channel.
ADC must not be disabled. Can be enabled with or without conversion on going on either groups regular or injected.
Parameters
ADCxADC instance
SequencerNbRanksThis parameter can be one of the following values:
Return values
None

Definition at line 1895 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_SetSequencerRanks()

__STATIC_INLINE void DDL_ADC16_INJ_SetSequencerRanks ( ADC16_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.
Parameters
ADCxADC instance
RankThis parameter can be one of the following values:
ChannelThis parameter can be one of the following values:
Return values
None

Definition at line 1971 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_SetTrigAuto()

__STATIC_INLINE void DDL_ADC16_INJ_SetTrigAuto ( ADC16_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.
ADC must be disabled or enabled without conversion on going on either groups regular or injected.
Parameters
ADCxADC instance
TrigAutoThis parameter can be one of the following values:
Return values
None

Definition at line 2059 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_SetTriggerEdge()

__STATIC_INLINE void DDL_ADC16_INJ_SetTriggerEdge ( ADC16_TypeDef * ADCx,
uint32_t ExternalTriggerEdge )

Set ADC group injected conversion trigger polarity. Applicable only for trigger source set to external trigger.

Note
ADC must not be disabled. Can be enabled with or without conversion on going on either groups regular or injected.
Parameters
ADCxADC instance
ExternalTriggerEdgeThis parameter can be one of the following values:
Return values
None

Definition at line 1857 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_INJ_SetTriggerSource()

__STATIC_INLINE void DDL_ADC16_INJ_SetTriggerSource ( ADC16_TypeDef * ADCx,
uint32_t TriggerSource )

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

Note
Availability of parameters of trigger sources from timer depends on timers availability on the selected device.
ADC must not be disabled. Can be enabled with or without conversion on going on either groups regular or injected.
Parameters
ADCxADC instance
TriggerSourceThis parameter can be one of the following values:
Return values
None

Definition at line 1801 of file g32r4xx_ddl_adc16.h.