STM32H735xx HAL User Manual
Functions
Configuration of ADC transversal scope: analog watchdog
ADC Exported Functions

Functions

__STATIC_INLINE void LL_ADC_SetAnalogWDMonitChannels (ADC_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 LL_ADC_GetAnalogWDMonitChannels (ADC_TypeDef *ADCx, uint32_t AWDy)
 Get ADC analog watchdog monitored channel.
__STATIC_INLINE void LL_ADC_SetAnalogWDThresholds (ADC_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 LL_ADC_GetAnalogWDThresholds (ADC_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.
__STATIC_INLINE void LL_ADC_ConfigAnalogWDThresholds (ADC_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 LL_ADC_SetAWDFilteringConfiguration (ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t FilteringConfig)
 Set ADC analog watchdog filtering configuration.
__STATIC_INLINE uint32_t LL_ADC_GetAWDFilteringConfiguration (ADC_TypeDef *ADCx, uint32_t AWDy)
 Get ADC analog watchdog filtering configuration.

Function Documentation

__STATIC_INLINE void LL_ADC_ConfigAnalogWDThresholds ( ADC_TypeDef *  ADCx,
uint32_t  AWDy,
uint32_t  AWDThresholdHighValue,
uint32_t  AWDThresholdLowValue 
)

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

Applicable for devices STM32H72xx and STM32H73xx.

Note:
If value of only one threshold high or low must be set, use function LL_ADC_SetAnalogWDThresholds().
In case of ADC resolution different of 12 bits, analog watchdog thresholds data require a specific shift. Use helper macro __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION().
On this STM32 series, there are 2 kinds of analog watchdog instance:
  • AWD standard (instance AWD1):
    • channels monitored: can monitor 1 channel or all channels.
    • groups monitored: ADC groups regular and-or injected.
    • resolution: resolution is not limited (corresponds to ADC resolution configured).
  • 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: (LL_ADC_AWD_CHANNEL4_REG_INJ | LL_ADC_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: LL_ADC_AWD_CHANNELxx_REG_INJ (do not use parameters LL_ADC_AWD_CHANNELxx_REG and LL_ADC_AWD_CHANNELxx_INJ)
    • resolution: resolution is limited to 8 bits: if ADC resolution is 12 bits the 4 LSB are ignored, if ADC resolution is 10 bits the 2 LSB are ignored.
Reference Manual to LL API cross reference:
TR1 HT1 LL_ADC_ConfigAnalogWDThresholds
TR2 HT2 LL_ADC_ConfigAnalogWDThresholds
TR3 HT3 LL_ADC_ConfigAnalogWDThresholds
TR1 LT1 LL_ADC_ConfigAnalogWDThresholds
TR2 LT2 LL_ADC_ConfigAnalogWDThresholds
TR3 LT3 LL_ADC_ConfigAnalogWDThresholds
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 6084 of file stm32h7xx_ll_adc.h.

References __ADC_PTR_REG_OFFSET, ADC_AWD_TR12_REGOFFSETGAP_MASK, ADC_AWD_TR12_REGOFFSETGAP_VAL, ADC_AWD_TRX_REGOFFSET_MASK, ADC_AWD_TRX_REGOFFSET_POS, LL_ADC_AWD_THRESHOLD_HIGH, and LL_ADC_AWD_THRESHOLD_LOW.

Referenced by HAL_ADC_AnalogWDGConfig().

__STATIC_INLINE uint32_t LL_ADC_GetAnalogWDMonitChannels ( ADC_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 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(). Applicable only when the analog watchdog is set to monitor one channel.
On this STM32 series, there are 2 kinds of analog watchdog instance:
  • AWD standard (instance AWD1):
    • channels monitored: can monitor 1 channel or all channels.
    • groups monitored: ADC groups regular and-or injected.
    • resolution: resolution is not limited (corresponds to ADC resolution configured).
  • 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: (LL_ADC_AWD_CHANNEL4_REG_INJ | LL_ADC_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: LL_ADC_AWD_CHANNELxx_REG_INJ (do not use parameters LL_ADC_AWD_CHANNELxx_REG and LL_ADC_AWD_CHANNELxx_INJ)
    • resolution: resolution is limited to 8 bits: if ADC resolution is 12 bits the 4 LSB are ignored, if ADC resolution is 10 bits the 2 LSB are ignored.
On this STM32 series, setting of this feature is conditioned to ADC state: ADC must be disabled or enabled without conversion on going on either groups regular or injected.
Reference Manual to LL API cross reference:
CFGR AWD1CH LL_ADC_GetAnalogWDMonitChannels
CFGR AWD1SGL LL_ADC_GetAnalogWDMonitChannels
CFGR AWD1EN LL_ADC_GetAnalogWDMonitChannels
CFGR JAWD1EN LL_ADC_GetAnalogWDMonitChannels
AWD2CR AWD2CH LL_ADC_GetAnalogWDMonitChannels
AWD3CR AWD3CH LL_ADC_GetAnalogWDMonitChannels
Parameters:
ADCxADC instance
AWDyThis parameter can be one of the following values: (1) On this AWD number, monitored channel can be retrieved if only 1 channel is programmed (or none or all channels). This function cannot retrieve monitored channel if multiple channels are programmed simultaneously by bitfield.
Return values:
Returnedvalue can be one of the following values: (0) On STM32H7, parameter available only on analog watchdog number: AWD1.

Definition at line 5846 of file stm32h7xx_ll_adc.h.

References __ADC_PTR_REG_OFFSET, __LL_ADC_CHANNEL_TO_DECIMAL_NB, ADC_AWD_CR12_REGOFFSETGAP_MASK, ADC_AWD_CR12_REGOFFSETGAP_VAL, ADC_AWD_CR23_CHANNEL_MASK, ADC_AWD_CR_ALL_CHANNEL_MASK, ADC_AWD_CRX_REGOFFSET_MASK, ADC_AWD_CRX_REGOFFSET_POS, and LL_ADC_AWD1.

__STATIC_INLINE uint32_t LL_ADC_GetAnalogWDThresholds ( ADC_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:
In case of ADC resolution different of 12 bits, analog watchdog thresholds data require a specific shift. Use helper macro __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION().
Reference Manual to LL API cross reference:
TR1 HT1 LL_ADC_GetAnalogWDThresholds
TR2 HT2 LL_ADC_GetAnalogWDThresholds
TR3 HT3 LL_ADC_GetAnalogWDThresholds
TR1 LT1 LL_ADC_GetAnalogWDThresholds
TR2 LT2 LL_ADC_GetAnalogWDThresholds
TR3 LT3 LL_ADC_GetAnalogWDThresholds
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=0x3FFFFFF

Definition at line 6021 of file stm32h7xx_ll_adc.h.

References __ADC_PTR_REG_OFFSET, ADC_AWD_TR12_REGOFFSETGAP_MASK, ADC_AWD_TR12_REGOFFSETGAP_VAL, ADC_AWD_TRX_REGOFFSET_MASK, and ADC_AWD_TRX_REGOFFSET_POS.

__STATIC_INLINE uint32_t LL_ADC_GetAWDFilteringConfiguration ( ADC_TypeDef *  ADCx,
uint32_t  AWDy 
)

Get ADC analog watchdog filtering configuration.

Note:
On this STM32 series, this feature is only available on first analog watchdog (AWD1) Applicable on ADC3 of devices STM32H72xx and STM32H73xx.
Reference Manual to LL API cross reference:
TR1 AWDFILT LL_ADC_GetAWDFilteringConfiguration
Parameters:
ADCxADC instance
AWDyThis parameter can be one of the following values:
Return values:
Returnedvalue can be:

Definition at line 6167 of file stm32h7xx_ll_adc.h.

__STATIC_INLINE void LL_ADC_SetAnalogWDMonitChannels ( ADC_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.
In case of need to define a single channel to monitor with analog watchdog from sequencer channel definition, use helper macro __LL_ADC_ANALOGWD_CHANNEL_GROUP().
On this STM32 series, there are 2 kinds of analog watchdog instance:
  • AWD standard (instance AWD1):
    • channels monitored: can monitor 1 channel or all channels.
    • groups monitored: ADC groups regular and-or injected.
    • resolution: resolution is not limited (corresponds to ADC resolution configured).
  • 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: (LL_ADC_AWD_CHANNEL4_REG_INJ | LL_ADC_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: LL_ADC_AWD_CHANNELxx_REG_INJ (do not use parameters LL_ADC_AWD_CHANNELxx_REG and LL_ADC_AWD_CHANNELxx_INJ)
    • resolution: resolution is limited to 8 bits: if ADC resolution is 12 bits the 4 LSB are ignored, if ADC resolution is 10 bits the 2 LSB are ignored.
On this STM32 series, setting of this feature is conditioned to ADC state: ADC must be disabled or enabled without conversion on going on either groups regular or injected.
Reference Manual to LL API cross reference:
CFGR AWD1CH LL_ADC_SetAnalogWDMonitChannels
CFGR AWD1SGL LL_ADC_SetAnalogWDMonitChannels
CFGR AWD1EN LL_ADC_SetAnalogWDMonitChannels
CFGR JAWD1EN LL_ADC_SetAnalogWDMonitChannels
AWD2CR AWD2CH LL_ADC_SetAnalogWDMonitChannels
AWD3CR AWD3CH LL_ADC_SetAnalogWDMonitChannels
Parameters:
ADCxADC instance
AWDyThis parameter can be one of the following values:
AWDChannelGroupThis parameter can be one of the following values: (0) On STM32H7, parameter available only on analog watchdog number: AWD1.
(1) On STM32H7, parameter available only on ADC instance: ADC3.
(2) On STM32H7, parameter available only on ADC instance: ADC2.
Return values:
None

Definition at line 5707 of file stm32h7xx_ll_adc.h.

References __ADC_PTR_REG_OFFSET, ADC_AWD_CR12_REGOFFSETGAP_MASK, ADC_AWD_CR12_REGOFFSETGAP_VAL, ADC_AWD_CR_ALL_CHANNEL_MASK, ADC_AWD_CRX_REGOFFSET_MASK, and ADC_AWD_CRX_REGOFFSET_POS.

Referenced by HAL_ADC_AnalogWDGConfig().

__STATIC_INLINE void LL_ADC_SetAnalogWDThresholds ( ADC_TypeDef *  ADCx,
uint32_t  AWDy,
uint32_t  AWDThresholdsHighLow,
uint32_t  AWDThresholdValue 
)

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

Note:
In case of ADC resolution different of 12 bits, analog watchdog thresholds data require a specific shift. Use helper macro __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION().
On this STM32 series, there are 2 kinds of analog watchdog instance:
  • AWD standard (instance AWD1):
    • channels monitored: can monitor 1 channel or all channels.
    • groups monitored: ADC groups regular and-or injected.
    • resolution: resolution is not limited (corresponds to ADC resolution configured).
  • 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: (LL_ADC_AWD_CHANNEL4_REG_INJ | LL_ADC_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: LL_ADC_AWD_CHANNELxx_REG_INJ (do not use parameters LL_ADC_AWD_CHANNELxx_REG and LL_ADC_AWD_CHANNELxx_INJ)
    • resolution: resolution is limited to 8 bits: if ADC resolution is 12 bits the 4 LSB are ignored, if ADC resolution is 10 bits the 2 LSB are ignored.
If ADC oversampling is enabled, ADC analog watchdog thresholds are impacted: the comparison of analog watchdog thresholds is done on oversampling intermediate computation (after ratio, before shift application): intermediate register bitfield [32:7] (26 most significant bits).
On this STM32 series, setting of this feature is conditioned to ADC state: ADC must be disabled or enabled without conversion on going on either ADC groups regular or injected.
Reference Manual to LL API cross reference:
TR1 HT1 LL_ADC_SetAnalogWDThresholds
TR2 HT2 LL_ADC_SetAnalogWDThresholds
TR3 HT3 LL_ADC_SetAnalogWDThresholds
TR1 LT1 LL_ADC_SetAnalogWDThresholds
TR2 LT2 LL_ADC_SetAnalogWDThresholds
TR3 LT3 LL_ADC_SetAnalogWDThresholds
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 5955 of file stm32h7xx_ll_adc.h.

References __ADC_PTR_REG_OFFSET, ADC_AWD_TR12_REGOFFSETGAP_MASK, ADC_AWD_TR12_REGOFFSETGAP_VAL, ADC_AWD_TRX_BIT_HIGH_MASK, ADC_AWD_TRX_BIT_HIGH_SHIFT4, ADC_AWD_TRX_REGOFFSET_MASK, and ADC_AWD_TRX_REGOFFSET_POS.

__STATIC_INLINE void LL_ADC_SetAWDFilteringConfiguration ( ADC_TypeDef *  ADCx,
uint32_t  AWDy,
uint32_t  FilteringConfig 
)

Set ADC analog watchdog filtering configuration.

Note:
On this STM32 series, setting of this feature is conditioned to ADC state: ADC must be disabled or enabled without conversion on going on either groups regular or injected. Applicable on ADC3 of devices STM32H72xx and STM32H73xx.
On this STM32 series, this feature is only available on first analog watchdog (AWD1)
Reference Manual to LL API cross reference:
TR1 AWDFILT LL_ADC_SetAWDFilteringConfiguration
Parameters:
ADCxADC instance
AWDyThis parameter can be one of the following values:
FilteringConfigThis parameter can be one of the following values:
Return values:
None

Definition at line 6138 of file stm32h7xx_ll_adc.h.