STM8L15x Standard Peripherals Drivers: Interrupts and flags management functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Interrupts and flags management functions

Interrupts and flags management functions. More...

Functions

void ADC_ClearFlag (ADC_TypeDef *ADCx, ADC_FLAG_TypeDef ADC_FLAG)
 Clears the ADC's pending flags.
void ADC_ClearITPendingBit (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT)
 Clears the ADC�s interrupt pending bits.
FlagStatus ADC_GetFlagStatus (ADC_TypeDef *ADCx, ADC_FLAG_TypeDef ADC_FLAG)
 Checks whether the specified ADC flag is set or not.
ITStatus ADC_GetITStatus (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT)
 Checks whether the specified ADC interrupt has occurred or not.
void ADC_ITConfig (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT, FunctionalState NewState)
 Enables or disables the specified ADC interrupts.

Detailed Description

Interrupts and flags management functions.

 ===============================================================================
                   Interrupts and flags management functions
 ===============================================================================  

  This section provides functions allowing to configure the ADC Interrupts and 
  get the status and clear flags and Interrupts pending bits.
  
  The ADC provides 3 Interrupt sources and 3 Flags:
  
  Flags :
  ---------- 
     1. ADC_FLAG_OVR : Overrun detection when ADC channel converted data is lost

     2. ADC_FLAG_EOC : End of conversion�- to indicate the end of a regular 
                  CHANNEL conversion or a GROUP conversions, depending of the 
                  ADC Continuous Conversion Mode (Continuous or Single 
                  conversion) and of the DMA usage.
                  Note : if DMA is used, EOC occurs at the end of the sequence 
                         conversion, else it occurs after each conversion
     3. ADC_FLAG_AWD: to indicate if the converted voltage crosses the 
                programmed Analog watchdog thresholds values.

     
  Interrupts :
  ------------
     1. ADC_IT_OVR : specifies the interrupt source for the Overrun detection event.
     2. ADC_IT_EOC : specifies the interrupt source for the End of conversion event.
     3. ADC_IT_AWD : specifies the interrupt source for the Analog watchdog event.


Function Documentation

void ADC_ClearFlag ( ADC_TypeDef ADCx,
ADC_FLAG_TypeDef  ADC_FLAG 
)

Clears the ADC's pending flags.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_FLAG,:specifies the flag to clear. This parameter can be one of the following values:
  • ADC_FLAG_EOC: End of Conversion flag
  • ADC_FLAG_AWD: Analog WatchDog flag
  • ADC_FLAG_OVER: Over Run flag
Return values:
None

Definition at line 886 of file stm8l15x_adc.c.

References IS_ADC_CLEAR_FLAG, and ADC_struct::SR.

void ADC_ClearITPendingBit ( ADC_TypeDef ADCx,
ADC_IT_TypeDef  ADC_IT 
)

Clears the ADC�s interrupt pending bits.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_IT,:specifies the ADC interrupt pending bit to clear. This parameter can be one of the following values:
  • ADC_IT_EOC: End of Conversion Interrupt
  • ADC_IT_AWD: Analog WatchDog Interrupt
  • ADC_IT_OVER: Over Run Interrupt
Return values:
None

Definition at line 949 of file stm8l15x_adc.c.

References IS_ADC_IT, and ADC_struct::SR.

FlagStatus ADC_GetFlagStatus ( ADC_TypeDef ADCx,
ADC_FLAG_TypeDef  ADC_FLAG 
)

Checks whether the specified ADC flag is set or not.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_FLAG,:specifies the flag to check. This parameter can be one of the following values:
  • ADC_FLAG_EOC: End of Conversion flag
  • ADC_FLAG_AWD: Analog WatchDog flag
  • ADC_FLAG_OVER: Over Run flag
Return values:
Thenew state of ADC_FLAG (SET or RESET).

Definition at line 853 of file stm8l15x_adc.c.

References IS_ADC_GET_FLAG, RESET, SET, and ADC_struct::SR.

ITStatus ADC_GetITStatus ( ADC_TypeDef ADCx,
ADC_IT_TypeDef  ADC_IT 
)

Checks whether the specified ADC interrupt has occurred or not.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_IT,:specifies the ADC interrupt source to check. This parameter can be one of the following values:
  • ADC_IT_EOC: End of Conversion Interrupt
  • ADC_IT_AWD: Analog WatchDog Interrupt
  • ADC_IT_OVER: Over Run Interrupt
Return values:
Statusof ADC_IT (SET or RESET).

Definition at line 906 of file stm8l15x_adc.c.

References ADC_struct::CR1, IS_ADC_GET_IT, RESET, SET, and ADC_struct::SR.

void ADC_ITConfig ( ADC_TypeDef ADCx,
ADC_IT_TypeDef  ADC_IT,
FunctionalState  NewState 
)

Enables or disables the specified ADC interrupts.

Parameters:
ADCxwhere x can be 1 to select the specified ADC peripheral.
ADC_IT: specifies the ADC interrupt sources to be enabled or disabled. This parameter can be one of the following values:
  • ADC_IT_EOC: End of Conversion Interrupt
  • ADC_IT_AWD: Analog WatchDog Interrupt
  • ADC_IT_OVER: Over Run Interrupt
NewState: new state of the specified ADC interrupts. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 825 of file stm8l15x_adc.c.

References ADC_struct::CR1, DISABLE, IS_ADC_IT, and IS_FUNCTIONAL_STATE.

STM8S Firmware Library: Overview

 

 

 

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