STM32F0 Standard Peripheral bibliotheek  1.0
ST Microelectronics standard peripheral bibliotheek documentatie voor de STM32F0 familie
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
Interrupts and flags management functions

Interrupts and flags management functions. More...

Functions

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

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 provide 6 Interrupts sources and 11 Flags which can be divided into 
         3 groups:

  *** Flags for ADC status ***
  ======================================================
    [..]
        (+)Flags :
           (##) ADC_FLAG_ADRDY : This flag is set after the ADC has been enabled (bit ADEN=1)
               and when the ADC reaches a state where it is ready to accept conversion requests
           (##) ADC_FLAG_ADEN : This flag is set by software to enable the ADC.
                The ADC will be effectively ready to operate once the ADRDY flag has been set.
           (##) ADC_FLAG_ADDIS : This flag is cleared once the ADC is effectively
                disabled.
           (##) ADC_FLAG_ADSTART : This flag is cleared after the execution of
                ADC_StopOfConversion() function, at the same time as the ADSTP bit is
                cleared by hardware
           (##) ADC_FLAG_ADSTP : This flag is cleared by hardware when the conversion
                is effectively discarded and the ADC is ready to accept a new start conversion
           (##) ADC_FLAG_ADCAL : This flag is set once the calibration is complete.

        (+)Interrupts 
           (##) ADC_IT_ADRDY : specifies the interrupt source for ADC ready event.

  *** Flags and Interrupts for ADC channel conversion ***
  =====================================================
    [..]
        (+)Flags :
           (##) ADC_FLAG_EOC : This flag is set by hardware at the end of each conversion
                of a channel when a new data result is available in the data register
           (##) ADC_FLAG_EOSEQ : This bit is set by hardware at the end of the conversion
                of a sequence of channels selected by ADC_ChannelConfig() function.
           (##) ADC_FLAG_EOSMP : This bit is set by hardware at the end of the sampling phase.
           (##) ADC_FLAG_OVR : This flag is set by hardware when an overrun occurs,
                meaning that a new conversion has complete while the EOC flag was already set.

        (+)Interrupts :
           (##) ADC_IT_EOC : specifies the interrupt source for end of conversion event.
           (##) ADC_IT_EOSEQ : specifies the interrupt source for end of sequence event.
           (##) ADC_IT_EOSMP : specifies the interrupt source for end of sampling event.
           (##) ADC_IT_OVR : specifies the interrupt source for Overrun detection 
                event.

  *** Flags and Interrupts for the Analog Watchdog ***
  ================================================
    [..]
        (+)Flags :
           (##) ADC_FLAG_AWD: This flag is set by hardware when the converted
                voltage crosses the values programmed thrsholds

        (+)Interrupts :
           (##) ADC_IT_AWD : specifies the interrupt source for Analog watchdog 
                event.
  
    [..] The user should identify which mode will be used in his application to 
         manage the ADC controller events: Polling mode or Interrupt mode.
  
    [..] In the Polling Mode it is advised to use the following functions:
         (+) ADC_GetFlagStatus() : to check if flags events occur.
         (+) ADC_ClearFlag()     : to clear the flags events.
  
    [..] In the Interrupt Mode it is advised to use the following functions:
         (+) ADC_ITConfig()       : to enable or disable the interrupt source.
         (+) ADC_GetITStatus()    : to check if Interrupt occurs.
         (+) ADC_ClearITPendingBit() : to clear the Interrupt pending Bit 
             (corresponding Flag).

Function Documentation

void ADC_ClearFlag ( ADC_TypeDef *  ADCx,
uint32_t  ADC_FLAG 
)

Clears the ADCx's pending flags.

Parameters
ADCx,:where x can be 1 to select the ADC1 peripheral.
ADC_FLAG,:specifies the flag to clear. This parameter can be any combination of the following values:
  • ADC_FLAG_AWD: Analog watchdog flag
  • ADC_FLAG_EOC: End of conversion flag
  • ADC_FLAG_ADRDY: ADC Ready flag
  • ADC_FLAG_EOSMP: End of sampling flag
  • ADC_FLAG_EOSEQ: End of Sequence flag
  • ADC_FLAG_OVR: Overrun flag
Return values
None
void ADC_ClearITPendingBit ( ADC_TypeDef *  ADCx,
uint32_t  ADC_IT 
)

Clears the ADCx's interrupt pending bits.

Parameters
ADCx,:where x can be 1 to select the ADC1 peripheral.
ADC_IT,:specifies the ADC interrupt pending bit to clear. This parameter can be one of the following values:
  • ADC_IT_ADRDY: ADC ready interrupt
  • ADC_IT_EOSMP: End of sampling interrupt
  • ADC_IT_EOC: End of conversion interrupt
  • ADC_IT_EOSEQ: End of sequence of conversion interrupt
  • ADC_IT_OVR: overrun interrupt
  • ADC_IT_AWD: Analog watchdog interrupt
Return values
None
FlagStatus ADC_GetFlagStatus ( ADC_TypeDef *  ADCx,
uint32_t  ADC_FLAG 
)

Checks whether the specified ADC flag is set or not.

Parameters
ADCx,:where x can be 1 to select the ADC1 peripheral.
ADC_FLAG,:specifies the flag to check. This parameter can be one of the following values:
  • ADC_FLAG_AWD: Analog watchdog flag
  • ADC_FLAG_OVR: Overrun flag
  • ADC_FLAG_EOSEQ: End of Sequence flag
  • ADC_FLAG_EOC: End of conversion flag
  • ADC_FLAG_EOSMP: End of sampling flag
  • ADC_FLAG_ADRDY: ADC Ready flag
  • ADC_FLAG_ADEN: ADC enable flag
  • ADC_FLAG_ADDIS: ADC disable flag
  • ADC_FLAG_ADSTART: ADC start flag
  • ADC_FLAG_ADSTP: ADC stop flag
  • ADC_FLAG_ADCAL: ADC Calibration flag
Return values
Thenew state of ADC_FLAG (SET or RESET).
ITStatus ADC_GetITStatus ( ADC_TypeDef *  ADCx,
uint32_t  ADC_IT 
)

Checks whether the specified ADC interrupt has occurred or not.

Parameters
ADCx,:where x can be 1 to select the ADC1 peripheral
ADC_IT,:specifies the ADC interrupt source to check. This parameter can be one of the following values:
  • ADC_IT_ADRDY: ADC ready interrupt
  • ADC_IT_EOSMP: End of sampling interrupt
  • ADC_IT_EOC: End of conversion interrupt
  • ADC_IT_EOSEQ: End of sequence of conversion interrupt
  • ADC_IT_OVR: overrun interrupt
  • ADC_IT_AWD: Analog watchdog interrupt
Return values
Thenew state of ADC_IT (SET or RESET).
void ADC_ITConfig ( ADC_TypeDef *  ADCx,
uint32_t  ADC_IT,
FunctionalState  NewState 
)

Enables or disables the specified ADC interrupts.

Parameters
ADCx,:where x can be 1 to select the 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_ADRDY: ADC ready interrupt
  • ADC_IT_EOSMP: End of sampling interrupt
  • ADC_IT_EOC: End of conversion interrupt
  • ADC_IT_EOSEQ: End of sequence of conversion interrupt
  • ADC_IT_OVR: overrun interrupt
  • ADC_IT_AWD: Analog watchdog interrupt
NewState,:new state of the specified ADC interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None