G32R430 Device Driver Layer v1.0.4
G32R4xx Device Driver Layer API Reference
Configuration of ADC transversal scope: analog watchdog

Functions

__STATIC_INLINE void DDL_ADC12_SetAnalogWDMonitChannels (ADC12_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDChannelGroup)
 Set ADC analog watchdog monitored channels: a single channel, multiple channels or all channels, on ADC groups regular and-or injected.
__STATIC_INLINE uint32_t DDL_ADC12_GetAnalogWDMonitChannels (ADC12_TypeDef *ADCx, uint32_t AWDy)
 Get ADC analog watchdog monitored channel.
__STATIC_INLINE void DDL_ADC12_ConfigAnalogWDThresholds (ADC12_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdHighValue, uint32_t AWDThresholdLowValue)
 Set ADC analog watchdog thresholds value of both thresholds high and low.
__STATIC_INLINE void DDL_ADC12_SetAnalogWDThresholds (ADC12_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdsHighLow, uint32_t AWDThresholdValue)
 Set ADC analog watchdog threshold value of threshold high or low.
__STATIC_INLINE uint32_t DDL_ADC12_GetAnalogWDThresholds (ADC12_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdsHighLow)
 Get ADC analog watchdog threshold value of threshold high, threshold low or raw data with ADC thresholds high and low concatenated.

Detailed Description

Function Documentation

◆ DDL_ADC12_ConfigAnalogWDThresholds()

__STATIC_INLINE void DDL_ADC12_ConfigAnalogWDThresholds ( ADC12_TypeDef * ADCx,
uint32_t AWDy,
uint32_t AWDThresholdHighValue,
uint32_t AWDThresholdLowValue )

Set ADC analog watchdog thresholds value of both thresholds high and low.

Note
If value of only one threshold high or low must be set, use function DDL_ADC12_SetAnalogWDThresholds().
  • AWD flexible (instances AWD2, AWD3):
    • channels monitored: flexible on channels monitored, selection is channel wise, from from 1 to all channels. Specificity of this analog watchdog: Multiple channels can be selected. For example: (DDL_ADC12_AWD_CHANNEL4_REG_INJ | DDL_ADC12_AWD_CHANNEL5_REG_INJ | ...)
    • groups monitored: not selection possible (monitoring on both groups regular and injected). Channels selected are monitored on groups regular and injected: DDL_ADC12_AWD_CHANNELxx_REG_INJ (do not use parameters DDL_ADC12_AWD_CHANNELxx_REG and DDL_ADC12_AWD_CHANNELxx_INJ)
If ADC oversampling is enabled, ADC analog watchdog thresholds are impacted: the comparison of analog watchdog thresholds is done on oversampling final computation (after ratio and shift application): ADC data register bitfield [15:0] (16 most significant bits).
Parameters
ADCxADC instance
AWDyThis parameter can be one of the following values:
AWDThresholdHighValueValue between Min_Data=0x000 and Max_Data=0xFFF
AWDThresholdLowValueValue between Min_Data=0x000 and Max_Data=0xFFF
Return values
None

Definition at line 2148 of file g32r4xx_ddl_adc12.h.

◆ DDL_ADC12_GetAnalogWDMonitChannels()

__STATIC_INLINE uint32_t DDL_ADC12_GetAnalogWDMonitChannels ( ADC12_TypeDef * ADCx,
uint32_t AWDy )

Get ADC analog watchdog monitored channel.

Note
Usage of the returned channel number:
  • To reinject this channel into another function DDL_ADC12_xxx: the returned channel number is only partly formatted on definition of literals DDL_ADC12_CHANNEL_x. Therefore, it has to be compared with parts of literals DDL_ADC12_CHANNEL_x or using helper macro __DDL_ADC12_CHANNEL_TO_DECIMAL_NB(). Then the selected literal DDL_ADC12_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 __DDL_ADC12_CHANNEL_TO_DECIMAL_NB(). Applicable only when the analog watchdog is set to monitor one channel.
  • AWD standard (instance AWD1):
    • channels monitored: can monitor 1 channel or all channels.
    • groups monitored: ADC groups regular and-or injected.
  • AWD flexible (instances AWD2, AWD3):
    • channels monitored: flexible on channels monitored, selection is channel wise, from from 1 to all channels. Specificity of this analog watchdog: Multiple channels can be selected. For example: (DDL_ADC12_AWD_CHANNEL4_REG_INJ | DDL_ADC12_AWD_CHANNEL5_REG_INJ | ...)
    • groups monitored: not selection possible (monitoring on both groups regular and injected). Channels selected are monitored on groups regular and injected: DDL_ADC12_AWD_CHANNELxx_REG_INJ (do not use parameters DDL_ADC12_AWD_CHANNELxx_REG and DDL_ADC12_AWD_CHANNELxx_INJ)
Parameters
ADCxADC instance
AWDyThis parameter can be one of the following values:
Return values
Returnedvalue can be one of the following values:

Definition at line 2105 of file g32r4xx_ddl_adc12.h.

◆ DDL_ADC12_GetAnalogWDThresholds()

__STATIC_INLINE uint32_t DDL_ADC12_GetAnalogWDThresholds ( ADC12_TypeDef * ADCx,
uint32_t AWDy,
uint32_t AWDThresholdsHighLow )

Get ADC analog watchdog threshold value of threshold high, threshold low or raw data with ADC thresholds high and low concatenated.

Note
If raw data with ADC thresholds high and low is retrieved, the data of each threshold high or low can be isolated using helper macro: __DDL_ADC12_ANALOGWD_THRESHOLDS_HIGH_LOW().
Parameters
ADCxADC instance
AWDyThis parameter can be one of the following values:
AWDThresholdsHighLowThis parameter can be one of the following values:
Return values
Valuebetween Min_Data=0x000 and Max_Data=0xFFF

Definition at line 2228 of file g32r4xx_ddl_adc12.h.

◆ DDL_ADC12_SetAnalogWDMonitChannels()

__STATIC_INLINE void DDL_ADC12_SetAnalogWDMonitChannels ( ADC12_TypeDef * ADCx,
uint32_t AWDy,
uint32_t AWDChannelGroup )

Set ADC analog watchdog monitored channels: a single channel, multiple channels or all channels, on ADC groups regular and-or injected.

Note
Once monitored channels are selected, analog watchdog is enabled.
  • AWD standard (instance AWD1):
    • channels monitored: can monitor 1 channel or all channels.
    • groups monitored: ADC groups regular and-or injected.
  • AWD flexible (instances AWD2, AWD3):
    • channels monitored: flexible on channels monitored, selection is channel wise, from from 1 to all channels. Specificity of this analog watchdog: Multiple channels can be selected. For example: (DDL_ADC12_AWD_CHANNEL4_REG_INJ | DDL_ADC12_AWD_CHANNEL5_REG_INJ | ...)
    • groups monitored: not selection possible (monitoring on both groups regular and injected). Channels selected are monitored on groups regular and injected: DDL_ADC12_AWD_CHANNELxx_REG_INJ (do not use parameters DDL_ADC12_AWD_CHANNELxx_REG and DDL_ADC12_AWD_CHANNELxx_INJ)
Parameters
ADCxADC instance
AWDyThis parameter can be one of the following values:
AWDChannelGroupThis parameter can be one of the following values:
Return values
None

Definition at line 2010 of file g32r4xx_ddl_adc12.h.

◆ DDL_ADC12_SetAnalogWDThresholds()

__STATIC_INLINE void DDL_ADC12_SetAnalogWDThresholds ( ADC12_TypeDef * ADCx,
uint32_t AWDy,
uint32_t AWDThresholdsHighLow,
uint32_t AWDThresholdValue )

Set ADC analog watchdog threshold value of threshold high or low.

Note
If values of both thresholds high or low must be set, use function DDL_ADC12_ConfigAnalogWDThresholds().
  • AWD flexible (instances AWD2, AWD3):
    • channels monitored: flexible on channels monitored, selection is channel wise, from from 1 to all channels. Specificity of this analog watchdog: Multiple channels can be selected. For example: (DDL_ADC12_AWD_CHANNEL4_REG_INJ | DDL_ADC12_AWD_CHANNEL5_REG_INJ | ...)
    • groups monitored: not selection possible (monitoring on both groups regular and injected). Channels selected are monitored on groups regular and injected: DDL_ADC12_AWD_CHANNELxx_REG_INJ (do not use parameters DDL_ADC12_AWD_CHANNELxx_REG and DDL_ADC12_AWD_CHANNELxx_INJ)
If ADC oversampling is enabled, ADC analog watchdog thresholds are impacted: the comparison of analog watchdog thresholds is done on oversampling final computation (after ratio and shift application): ADC data register bitfield [15:4] (12 most significant bits). ADC can be disabled, enabled with or without conversion on going on either ADC groups regular or injected.
Parameters
ADCxADC instance
AWDyThis parameter can be one of the following values:
AWDThresholdsHighLowThis parameter can be one of the following values:
AWDThresholdValueValue between Min_Data=0x000 and Max_Data=0xFFF
Return values
None

Definition at line 2195 of file g32r4xx_ddl_adc12.h.