STM8L15x Standard Peripherals Drivers: Analog Watchdog configuration functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Analog Watchdog configuration functions

Analog Watchdog configuration functions. More...

Functions

void ADC_AnalogWatchdogChannelSelect (ADC_TypeDef *ADCx, ADC_AnalogWatchdogSelection_TypeDef ADC_AnalogWatchdogSelection)
 Configures the channel to be checked by the Analog watchdog.
void ADC_AnalogWatchdogConfig (ADC_TypeDef *ADCx, ADC_AnalogWatchdogSelection_TypeDef ADC_AnalogWatchdogSelection, uint16_t HighThreshold, uint16_t LowThreshold)
 Configures the Analog watchdog.
void ADC_AnalogWatchdogThresholdsConfig (ADC_TypeDef *ADCx, uint16_t HighThreshold, uint16_t LowThreshold)
 Configures the high and low thresholds of the Analog watchdog.

Detailed Description

Analog Watchdog configuration functions.

 ===============================================================================
                    Analog Watchdog configuration functions
 ===============================================================================  

  This section provides functions allowing to configure the Analog Watchdog
  (AWD) feature in the ADC.
  
  A typical configuration Analog Watchdog is done following these steps :
   1. the ADC guarded channel is selected using the 
      ADC_AnalogWatchdogChannelSelect() function.
   2. The Analog watchdog lower and higher threshold are configured using the  
      ADC_AnalogWatchdogThresholdsConfig() function.
   
   Note : Both AWD selection and thresholds can be configured with one unique 
          function ADC_AnalogWatchdogConfig(), which is kept for firmware 
          compatibility reason.


Function Documentation

void ADC_AnalogWatchdogChannelSelect ( ADC_TypeDef ADCx,
ADC_AnalogWatchdogSelection_TypeDef  ADC_AnalogWatchdogSelection 
)

Configures the channel to be checked by the Analog watchdog.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_AnalogWatchdogSelection: Specifies the channel to be checked by the Analog watchdog. This parameter can be one of the following values:
  • ADC_AnalogWatchdogSelection_Channel0: AWD affected to Channel 0
  • ADC_AnalogWatchdogSelection_Channel1: AWD affected to Channel 1
  • ADC_AnalogWatchdogSelection_Channel2: AWD affected to Channel 2
  • ADC_AnalogWatchdogSelection_Channel3: AWD affected to Channel 3
  • ADC_AnalogWatchdogSelection_Channel4: AWD affected to Channel 4
  • ADC_AnalogWatchdogSelection_Channel5: AWD affected to Channel 5
  • ADC_AnalogWatchdogSelection_Channel6: AWD affected to Channel 6
  • ADC_AnalogWatchdogSelection_Channel7: AWD affected to Channel 7
  • ADC_AnalogWatchdogSelection_Channel8: AWD affected to Channel 8
  • ADC_AnalogWatchdogSelection_Channel9: AWD affected to Channel 9
  • ADC_AnalogWatchdogSelection_Channel10: AWD affected to Channel 10
  • ADC_AnalogWatchdogSelection_Channel11: AWD affected to Channel 11
  • ADC_AnalogWatchdogSelection_Channel12: AWD affected to Channel 12
  • ADC_AnalogWatchdogSelection_Channel13: AWD affected to Channel 13
  • ADC_AnalogWatchdogSelection_Channel14: AWD affected to Channel 14
  • ADC_AnalogWatchdogSelection_Channel15: AWD affected to Channel 15
  • ADC_AnalogWatchdogSelection_Channel16: AWD affected to Channel 16
  • ADC_AnalogWatchdogSelection_Channel17: AWD affected to Channel 17
  • ADC_AnalogWatchdogSelection_Channel18: AWD affected to Channel 18
  • ADC_AnalogWatchdogSelection_Channel19: AWD affected to Channel 19
  • ADC_AnalogWatchdogSelection_Channel20: AWD affected to Channel 20
  • ADC_AnalogWatchdogSelection_Channel21: AWD affected to Channel 21
  • ADC_AnalogWatchdogSelection_Channel22: AWD affected to Channel 22
  • ADC_AnalogWatchdogSelection_Channel23: AWD affected to Channel 23 ADC_AnalogWatchdogSelection_TypeDef enumeration.
Return values:
None

Definition at line 333 of file stm8l15x_adc.c.

References ADC_CR3_CHSEL, ADC_struct::CR3, and IS_ADC_ANALOGWATCHDOG_SELECTION.

void ADC_AnalogWatchdogConfig ( ADC_TypeDef ADCx,
ADC_AnalogWatchdogSelection_TypeDef  ADC_AnalogWatchdogSelection,
uint16_t  HighThreshold,
uint16_t  LowThreshold 
)

Configures the Analog watchdog.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_AnalogWatchdogSelection: Specifies the channel to be checked by the Analog watchdog. This parameter can be one of the following values:
  • ADC_AnalogWatchdogSelection_Channel0: AWD affected to Channel 0
  • ADC_AnalogWatchdogSelection_Channel1: AWD affected to Channel 1
  • ADC_AnalogWatchdogSelection_Channel2: AWD affected to Channel 2
  • ADC_AnalogWatchdogSelection_Channel3: AWD affected to Channel 3
  • ADC_AnalogWatchdogSelection_Channel4: AWD affected to Channel 4
  • ADC_AnalogWatchdogSelection_Channel5: AWD affected to Channel 5
  • ADC_AnalogWatchdogSelection_Channel6: AWD affected to Channel 6
  • ADC_AnalogWatchdogSelection_Channel7: AWD affected to Channel 7
  • ADC_AnalogWatchdogSelection_Channel8: AWD affected to Channel 8
  • ADC_AnalogWatchdogSelection_Channel9: AWD affected to Channel 9
  • ADC_AnalogWatchdogSelection_Channel10: AWD affected to Channel 10
  • ADC_AnalogWatchdogSelection_Channel11: AWD affected to Channel 11
  • ADC_AnalogWatchdogSelection_Channel12: AWD affected to Channel 12
  • ADC_AnalogWatchdogSelection_Channel13: AWD affected to Channel 13
  • ADC_AnalogWatchdogSelection_Channel14: AWD affected to Channel 14
  • ADC_AnalogWatchdogSelection_Channel15: AWD affected to Channel 15
  • ADC_AnalogWatchdogSelection_Channel16: AWD affected to Channel 16
  • ADC_AnalogWatchdogSelection_Channel17: AWD affected to Channel 17
  • ADC_AnalogWatchdogSelection_Channel18: AWD affected to Channel 18
  • ADC_AnalogWatchdogSelection_Channel19: AWD affected to Channel 19
  • ADC_AnalogWatchdogSelection_Channel20: AWD affected to Channel 20
  • ADC_AnalogWatchdogSelection_Channel21: AWD affected to Channel 21
  • ADC_AnalogWatchdogSelection_Channel22: AWD affected to Channel 22
  • ADC_AnalogWatchdogSelection_Channel23: AWD affected to Channel 23
HighThreshold,:Analog watchdog High threshold value. This parameter must be a 12bit value.
LowThreshold,:Analog watchdog Low threshold value. This parameter must be a 12bit value.
Return values:
None

Definition at line 406 of file stm8l15x_adc.c.

References ADC_CR3_CHSEL, ADC_struct::CR3, ADC_struct::HTRH, ADC_struct::HTRL, IS_ADC_ANALOGWATCHDOG_SELECTION, IS_ADC_THRESHOLD, ADC_struct::LTRH, and ADC_struct::LTRL.

void ADC_AnalogWatchdogThresholdsConfig ( ADC_TypeDef ADCx,
uint16_t  HighThreshold,
uint16_t  LowThreshold 
)

Configures the high and low thresholds of the Analog watchdog.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
HighThreshold,:Analog watchdog High threshold value. This parameter must be a 12bit value.
LowThreshold,:Analog watchdog Low threshold value. This parameter must be a 12bit value.
Return values:
None

Definition at line 355 of file stm8l15x_adc.c.

References ADC_struct::HTRH, ADC_struct::HTRL, IS_ADC_THRESHOLD, ADC_struct::LTRH, and ADC_struct::LTRL.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com