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

Functions

__STATIC_INLINE void DDL_ADC16_SetLowPowerMode (ADC16_TypeDef *ADCx, uint32_t LowPowerMode)
 Set ADC low power mode.
__STATIC_INLINE uint32_t DDL_ADC16_GetLowPowerMode (ADC16_TypeDef *ADCx)
 Get ADC low power mode:
__STATIC_INLINE void DDL_ADC16_SetOffset (ADC16_TypeDef *ADCx, uint32_t Offsety, uint32_t OffsetLevel)
 Set ADC selected offset number 1, 2, 3 or 4.
__STATIC_INLINE uint32_t DDL_ADC16_GetOffsetLevel (ADC16_TypeDef *ADCx, uint32_t Offsety)
 Get for the ADC selected offset number 1, 2, 3 or 4: Offset level (offset to be subtracted from the raw converted data).
__STATIC_INLINE void DDL_ADC16_SetOffsetState (ADC16_TypeDef *ADCx, uint32_t Offsety, uint32_t OffsetState)
 Set for the ADC selected offset number 1, 2, 3 or 4: force offset state disable or enable without modifying offset channel or offset value.
__STATIC_INLINE uint32_t DDL_ADC16_GetOffsetState (ADC16_TypeDef *ADCx, uint32_t Offsety)
 Get for the ADC selected offset number 1, 2, 3 or 4: offset state disabled or enabled.
__STATIC_INLINE void DDL_ADC16_SetOffsetSign (ADC16_TypeDef *ADCx, uint32_t Offsety, uint32_t OffsetSign)
 Set for the ADC selected offset number 1, 2, 3 or 4: choose offset sign.
__STATIC_INLINE uint32_t DDL_ADC16_GetOffsetSign (ADC16_TypeDef *ADCx, uint32_t Offsety)
 Get for the ADC selected offset number 1, 2, 3 or 4: offset sign if positive or negative.

Detailed Description

Function Documentation

◆ DDL_ADC16_GetLowPowerMode()

__STATIC_INLINE uint32_t DDL_ADC16_GetLowPowerMode ( ADC16_TypeDef * ADCx)

Get ADC low power mode:

Note
Description of ADC low power modes:
  • ADC low power mode "auto wait": Dynamic low power mode, ADC conversions occurrences are limited to the minimum necessary in order to reduce power consumption. New ADC conversion starts only when the previous unitary conversion data (for ADC group regular) or previous sequence conversions data (for ADC group injected) has been retrieved by user software. In the meantime, ADC remains idle: does not performs any other conversion. This mode allows to automatically adapt the ADC conversions triggers to the speed of the software that reads the data. Moreover, this avoids risk of overrun for low frequency applications. How to use this low power mode:
    • It is not recommended to use with interruption or DMA since these modes have to clear immediately the EOC flag (by CPU to free the IRQ pending event or by DMA). Auto wait will work but fort a very short time, discarding its intended benefit (except specific case of high load of CPU or DMA transfers which can justify usage of auto wait).
    • Do use with polling: 1. Start conversion,
      1. Later on, when conversion data is needed: poll for end of conversion to ensure that conversion is completed and retrieve ADC conversion data. This will trig another ADC conversion start.
  • ADC low power mode "auto power-off" (feature available on this device if parameter DDL_ADC16_LP_AUTOPOWEROFF is available): the ADC automatically powers-off after a conversion and automatically wakes up when a new conversion is triggered (with startup time between trigger and start of sampling). This feature can be combined with low power mode "auto wait".
With ADC low power mode "auto wait", the ADC conversion data read is corresponding to previous ADC conversion start, independently of delay during which ADC was idle. Therefore, the ADC conversion data may be outdated: does not correspond to the current voltage level on the selected ADC channel.
Parameters
ADCxADC instance
Return values
Returnedvalue can be one of the following values:

Definition at line 1096 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_GetOffsetLevel()

__STATIC_INLINE uint32_t DDL_ADC16_GetOffsetLevel ( ADC16_TypeDef * ADCx,
uint32_t Offsety )

Get for the ADC selected offset number 1, 2, 3 or 4: Offset level (offset to be subtracted from the raw converted data).

Parameters
ADCxADC instance
OffsetyThis parameter can be one of the following values:
Return values
Valuebetween Min_Data=0x0000 and Max_Data=0xFFFF

Definition at line 1148 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_GetOffsetSign()

__STATIC_INLINE uint32_t DDL_ADC16_GetOffsetSign ( ADC16_TypeDef * ADCx,
uint32_t Offsety )

Get for the ADC selected offset number 1, 2, 3 or 4: offset sign if positive or negative.

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

Definition at line 1246 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_GetOffsetState()

__STATIC_INLINE uint32_t DDL_ADC16_GetOffsetState ( ADC16_TypeDef * ADCx,
uint32_t Offsety )

Get for the ADC selected offset number 1, 2, 3 or 4: offset state disabled or enabled.

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

Definition at line 1199 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_SetLowPowerMode()

__STATIC_INLINE void DDL_ADC16_SetLowPowerMode ( ADC16_TypeDef * ADCx,
uint32_t LowPowerMode )

Set ADC low power mode.

Note
Description of ADC low power modes:
  • ADC low power mode "auto wait": Dynamic low power mode, ADC conversions occurrences are limited to the minimum necessary in order to reduce power consumption. New ADC conversion starts only when the previous unitary conversion data (for ADC group regular) or previous sequence conversions data (for ADC group injected) has been retrieved by user software. In the meantime, ADC remains idle: does not performs any other conversion. This mode allows to automatically adapt the ADC conversions triggers to the speed of the software that reads the data. Moreover, this avoids risk of overrun for low frequency applications. How to use this low power mode:
    • It is not recommended to use with interruption or DMA since these modes have to clear immediately the EOC flag (by CPU to free the IRQ pending event or by DMA). Auto wait will work but fort a very short time, discarding its intended benefit (except specific case of high load of CPU or DMA transfers which can justify usage of auto wait).
    • Do use with polling: 1. Start conversion,
      1. Later on, when conversion data is needed: poll for end of conversion to ensure that conversion is completed and retrieve ADC conversion data. This will trig another ADC conversion start.
  • ADC low power mode "auto power-off" (feature available on this device if parameter DD_ADC_LP_AUTOPOWEROFF is available): the ADC automatically powers-off after a conversion and automatically wakes up when a new conversion is triggered (with startup time between trigger and start of sampling). This feature can be combined with low power mode "auto wait".
With ADC low power mode "auto wait", the ADC conversion data read is corresponding to previous ADC conversion start, independently of delay during which ADC was idle. Therefore, the ADC conversion data may be outdated: does not correspond to the current voltage level on the selected ADC channel.
Parameters
ADCxADC instance
LowPowerModeThis parameter can be one of the following values:
Return values
None

Definition at line 1046 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_SetOffset()

__STATIC_INLINE void DDL_ADC16_SetOffset ( ADC16_TypeDef * ADCx,
uint32_t Offsety,
uint32_t OffsetLevel )

Set ADC selected offset number 1, 2, 3 or 4.

Note
This function set the 2 items of offset configuration:
  • ADC channel to which the offset programmed will be applied (independently of channel mapped on ADC group regular or group injected)
  • Offset level (offset to be subtracted from the raw converted data).
This function enables the offset, by default. It can be forced to disable state using function DDL_ADC16_SetOffsetState().
If a channel is mapped on several offsets numbers, only the offset with the lowest value is considered for the subtraction.
Parameters
ADCxADC instance
OffsetyThis parameter can be one of the following values:
OffsetLevelValue between Min_Data=0x0000 and Max_Data=0xFFFF
Return values
None

Definition at line 1125 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_SetOffsetSign()

__STATIC_INLINE void DDL_ADC16_SetOffsetSign ( ADC16_TypeDef * ADCx,
uint32_t Offsety,
uint32_t OffsetSign )

Set for the ADC selected offset number 1, 2, 3 or 4: choose offset sign.

Parameters
ADCxADC instance
OffsetyThis parameter can be one of the following values:
OffsetSignThis parameter can be one of the following values:
Return values
None

Definition at line 1222 of file g32r4xx_ddl_adc16.h.

◆ DDL_ADC16_SetOffsetState()

__STATIC_INLINE void DDL_ADC16_SetOffsetState ( ADC16_TypeDef * ADCx,
uint32_t Offsety,
uint32_t OffsetState )

Set for the ADC selected offset number 1, 2, 3 or 4: force offset state disable or enable without modifying offset channel or offset value.

Note
This function should be needed only in case of offset to be enabled-disabled dynamically, and should not be needed in other cases: function DDL_ADC16_SetOffset() automatically enables the offset.
Parameters
ADCxADC instance
OffsetyThis parameter can be one of the following values:
OffsetStateThis parameter can be one of the following values:
Return values
None

Definition at line 1175 of file g32r4xx_ddl_adc16.h.