Interrupts and flags management functions.
More...
|
void | ADC_ClearCommonFlag (ADC_TypeDef *ADCx, uint32_t ADC_FLAG) |
| Clears the ADCx's pending flags. More...
|
|
void | ADC_ClearFlag (ADC_TypeDef *ADCx, uint8_t ADC_FLAG) |
| Clears the ADCx's pending flags. More...
|
|
void | ADC_ClearFlag (ADC_TypeDef *ADCx, uint32_t ADC_FLAG) |
| Clears the ADCx's pending flags. More...
|
|
void | ADC_ClearITPendingBit (ADC_TypeDef *ADCx, uint16_t ADC_IT) |
| Clears the ADCx's interrupt pending bits. More...
|
|
void | ADC_ClearITPendingBit (ADC_TypeDef *ADCx, uint32_t ADC_IT) |
| Clears the ADCx's interrupt pending bits. More...
|
|
FlagStatus | ADC_GetCommonFlagStatus (ADC_TypeDef *ADCx, uint32_t ADC_FLAG) |
| Checks whether the specified ADC flag is set or not. More...
|
|
FlagStatus | ADC_GetFlagStatus (ADC_TypeDef *ADCx, uint8_t ADC_FLAG) |
| Checks whether the specified ADC flag is set or not. More...
|
|
FlagStatus | ADC_GetFlagStatus (ADC_TypeDef *ADCx, uint32_t ADC_FLAG) |
| Checks whether the specified ADC flag is set or not. More...
|
|
ITStatus | ADC_GetITStatus (ADC_TypeDef *ADCx, uint16_t ADC_IT) |
| Checks whether the specified ADC interrupt has occurred or not. More...
|
|
ITStatus | ADC_GetITStatus (ADC_TypeDef *ADCx, uint32_t ADC_IT) |
| Checks whether the specified ADC interrupt has occurred or not. More...
|
|
void | ADC_ITConfig (ADC_TypeDef *ADCx, uint16_t ADC_IT, FunctionalState NewState) |
| Enables or disables the specified ADC interrupts. More...
|
|
void | ADC_ITConfig (ADC_TypeDef *ADCx, uint32_t ADC_IT, FunctionalState NewState) |
| Enables or disables the specified ADC interrupts. More...
|
|
Interrupts and flags management functions.
===============================================================================
##### Interrupts and flags management functions #####
===============================================================================
[..] This section provides functions allowing to configure the ADC Interrupts
and to get the status and clear flags and Interrupts pending bits.
[..] Each ADC provides 4 Interrupts sources and 6 Flags which can be divided
into 3 groups:
*** Flags and Interrupts for ADC regular channels ***
=====================================================
[..]
(+) Flags :
(##) ADC_FLAG_OVR : Overrun detection when regular converted data are lost
(##) ADC_FLAG_EOC : Regular channel end of conversion ==> to indicate
(depending on EOCS bit, managed by ADC_EOCOnEachRegularChannelCmd() )
the end of:
(+++) a regular CHANNEL conversion
(+++) sequence of regular GROUP conversions .
(##) ADC_FLAG_STRT: Regular channel start ==> to indicate when regular
CHANNEL conversion starts.
[..]
(+) Interrupts :
(##) ADC_IT_OVR : specifies the interrupt source for Overrun detection
event.
(##) ADC_IT_EOC : specifies the interrupt source for Regular channel end
of conversion event.
*** Flags and Interrupts for ADC Injected channels ***
======================================================
[..]
(+) Flags :
(##) ADC_FLAG_JEOC : Injected channel end of conversion ==> to indicate
at the end of injected GROUP conversion
(##) ADC_FLAG_JSTRT: Injected channel start ==> to indicate hardware when
injected GROUP conversion starts.
[..]
(+) Interrupts :
(##) ADC_IT_JEOC : specifies the interrupt source for Injected channel
end of conversion event.
*** General Flags and Interrupts for the ADC ***
================================================
[..]
(+)Flags :
(##) ADC_FLAG_AWD: Analog watchdog ==> to indicate if the converted voltage
crosses the programmed thresholds values.
[..]
(+) 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).
===============================================================================
##### Interrupts and flags management functions #####
===============================================================================
[..] This section provides functions allowing to configure the ADC Interrupts, get
the status and clear flags and Interrupts pending bits.
[..] The ADC provide 11 Interrupts sources and 11 Flags which can be divided into 3 groups:
(#) Flags and Interrupts for ADC regular channels
(##)Flags
(+) ADC_FLAG_RDY: ADC Ready flag
(+) ADC_FLAG_EOSMP: ADC End of Sampling flag
(+) ADC_FLAG_EOC: ADC End of Regular Conversion flag.
(+) ADC_FLAG_EOS: ADC End of Regular sequence of Conversions flag
(+) ADC_FLAG_OVR: ADC overrun flag
(##) Interrupts
(+) ADC_IT_RDY: ADC Ready interrupt source
(+) ADC_IT_EOSMP: ADC End of Sampling interrupt source
(+) ADC_IT_EOC: ADC End of Regular Conversion interrupt source
(+) ADC_IT_EOS: ADC End of Regular sequence of Conversions interrupt
(+) ADC_IT_OVR: ADC overrun interrupt source
(#) Flags and Interrupts for ADC regular channels
(##)Flags
(+) ADC_FLAG_JEOC: ADC Ready flag
(+) ADC_FLAG_JEOS: ADC End of Sampling flag
(+) ADC_FLAG_JQOVF: ADC End of Regular Conversion flag.
(##) Interrupts
(+) ADC_IT_JEOC: ADC End of Injected Conversion interrupt source
(+) ADC_IT_JEOS: ADC End of Injected sequence of Conversions interrupt source
(+) ADC_IT_JQOVF: ADC Injected Context Queue Overflow interrupt source
(#) General Flags and Interrupts for the ADC
(##)Flags
(+) ADC_FLAG_AWD1: ADC Analog watchdog 1 flag
(+) ADC_FLAG_AWD2: ADC Analog watchdog 2 flag
(+) ADC_FLAG_AWD3: ADC Analog watchdog 3 flag
(##)Flags
(+) ADC_IT_AWD1: ADC Analog watchdog 1 interrupt source
(+) ADC_IT_AWD2: ADC Analog watchdog 2 interrupt source
(+) ADC_IT_AWD3: ADC Analog watchdog 3 interrupt source
(#) Flags for ADC dual mode
(##)Flags for Master
(+) ADC_FLAG_MSTRDY: ADC master Ready (ADRDY) flag
(+) ADC_FLAG_MSTEOSMP: ADC master End of Sampling flag
(+) ADC_FLAG_MSTEOC: ADC master End of Regular Conversion flag
(+) ADC_FLAG_MSTEOS: ADC master End of Regular sequence of Conversions flag
(+) ADC_FLAG_MSTOVR: ADC master overrun flag
(+) ADC_FLAG_MSTJEOC: ADC master End of Injected Conversion flag
(+) ADC_FLAG_MSTJEOS: ADC master End of Injected sequence of Conversions flag
(+) ADC_FLAG_MSTAWD1: ADC master Analog watchdog 1 flag
(+) ADC_FLAG_MSTAWD2: ADC master Analog watchdog 2 flag
(+) ADC_FLAG_MSTAWD3: ADC master Analog watchdog 3 flag
(+) ADC_FLAG_MSTJQOVF: ADC master Injected Context Queue Overflow flag
(##) Flags for Slave
(+) ADC_FLAG_SLVRDY: ADC slave Ready (ADRDY) flag
(+) ADC_FLAG_SLVEOSMP: ADC slave End of Sampling flag
(+) ADC_FLAG_SLVEOC: ADC slave End of Regular Conversion flag
(+) ADC_FLAG_SLVEOS: ADC slave End of Regular sequence of Conversions flag
(+) ADC_FLAG_SLVOVR: ADC slave overrun flag
(+) ADC_FLAG_SLVJEOC: ADC slave End of Injected Conversion flag
(+) ADC_FLAG_SLVJEOS: ADC slave End of Injected sequence of Conversions flag
(+) ADC_FLAG_SLVAWD1: ADC slave Analog watchdog 1 flag
(+) ADC_FLAG_SLVAWD2: ADC slave Analog watchdog 2 flag
(+) ADC_FLAG_SLVAWD3: ADC slave Analog watchdog 3 flag
(+) ADC_FLAG_SLVJQOVF: ADC slave Injected Context Queue Overflow flag
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).
void ADC_ClearCommonFlag |
( |
ADC_TypeDef * |
ADCx, |
|
|
uint32_t |
ADC_FLAG |
|
) |
| |
Clears the ADCx's pending flags.
- Parameters
-
ADCx | where x can be 1, 2, 3 or 4 to select the ADC peripheral. |
ADC_FLAG | specifies the master or slave flag to clear. This parameter can be one of the following values:
- ADC_FLAG_MSTRDY: ADC master Ready (ADRDY) flag
- ADC_FLAG_MSTEOSMP: ADC master End of Sampling flag
- ADC_FLAG_MSTEOC: ADC master End of Regular Conversion flag
- ADC_FLAG_MSTEOS: ADC master End of Regular sequence of Conversions flag
- ADC_FLAG_MSTOVR: ADC master overrun flag
- ADC_FLAG_MSTJEOC: ADC master End of Injected Conversion flag
- ADC_FLAG_MSTJEOS: ADC master End of Injected sequence of Conversions flag
- ADC_FLAG_MSTAWD1: ADC master Analog watchdog 1 flag
- ADC_FLAG_MSTAWD2: ADC master Analog watchdog 2 flag
- ADC_FLAG_MSTAWD3: ADC master Analog watchdog 3 flag
- ADC_FLAG_MSTJQOVF: ADC master Injected Context Queue Overflow flag
- ADC_FLAG_SLVRDY: ADC slave Ready (ADRDY) flag
- ADC_FLAG_SLVEOSMP: ADC slave End of Sampling flag
- ADC_FLAG_SLVEOC: ADC slave End of Regular Conversion flag
- ADC_FLAG_SLVEOS: ADC slave End of Regular sequence of Conversions flag
- ADC_FLAG_SLVOVR: ADC slave overrun flag
- ADC_FLAG_SLVJEOC: ADC slave End of Injected Conversion flag
- ADC_FLAG_SLVJEOS: ADC slave End of Injected sequence of Conversions flag
- ADC_FLAG_SLVAWD1: ADC slave Analog watchdog 1 flag
- ADC_FLAG_SLVAWD2: ADC slave Analog watchdog 2 flag
- ADC_FLAG_SLVAWD3: ADC slave Analog watchdog 3 flag
- ADC_FLAG_SLVJQOVF: ADC slave Injected Context Queue Overflow flag
|
- Return values
-
Definition at line 2313 of file stm32f30x_adc.c.
void ADC_ClearFlag |
( |
ADC_TypeDef * |
ADCx, |
|
|
uint8_t |
ADC_FLAG |
|
) |
| |
Clears the ADCx's pending flags.
- Parameters
-
ADCx | where x can be 1, 2 or 3 to select the ADC 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_JEOC: End of injected group conversion flag
- ADC_FLAG_JSTRT: Start of injected group conversion flag
- ADC_FLAG_STRT: Start of regular group conversion flag
- ADC_FLAG_OVR: Overrun flag
|
- Return values
-
Definition at line 1652 of file stm32f4xx_adc.c.
void ADC_ClearFlag |
( |
ADC_TypeDef * |
ADCx, |
|
|
uint32_t |
ADC_FLAG |
|
) |
| |
Clears the ADCx's pending flags.
- Parameters
-
ADCx | where x can be 1, 2, 3 or 4 to select the ADC peripheral. |
ADC_FLAG | specifies the flag to clear. This parameter can be any combination of the following values:
- ADC_FLAG_RDY: ADC Ready (ADRDY) flag
- ADC_FLAG_EOSMP: ADC End of Sampling flag
- ADC_FLAG_EOC: ADC End of Regular Conversion flag
- ADC_FLAG_EOS: ADC End of Regular sequence of Conversions flag
- ADC_FLAG_OVR: ADC overrun flag
- ADC_FLAG_JEOC: ADC End of Injected Conversion flag
- ADC_FLAG_JEOS: ADC End of Injected sequence of Conversions flag
- ADC_FLAG_AWD1: ADC Analog watchdog 1 flag
- ADC_FLAG_AWD2: ADC Analog watchdog 2 flag
- ADC_FLAG_AWD3: ADC Analog watchdog 3 flag
- ADC_FLAG_JQOVF: ADC Injected Context Queue Overflow flag
|
- Return values
-
Definition at line 2214 of file stm32f30x_adc.c.
void ADC_ClearITPendingBit |
( |
ADC_TypeDef * |
ADCx, |
|
|
uint16_t |
ADC_IT |
|
) |
| |
Clears the ADCx's interrupt pending bits.
- Parameters
-
ADCx | where x can be 1, 2 or 3 to select the 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 mask
- ADC_IT_AWD: Analog watchdog interrupt mask
- ADC_IT_JEOC: End of injected conversion interrupt mask
- ADC_IT_OVR: Overrun interrupt mask
|
- Return values
-
Definition at line 1714 of file stm32f4xx_adc.c.
void ADC_ClearITPendingBit |
( |
ADC_TypeDef * |
ADCx, |
|
|
uint32_t |
ADC_IT |
|
) |
| |
Clears the ADCx's interrupt pending bits.
- Parameters
-
ADCx | where x can be 1, 2 or 3 to select the ADC peripheral. |
ADC_IT | specifies the ADC interrupt pending bit to clear. This parameter can be any combination of the following values:
- ADC_IT_RDY: ADC Ready (ADRDY) interrupt source
- ADC_IT_EOSMP: ADC End of Sampling interrupt source
- ADC_IT_EOC: ADC End of Regular Conversion interrupt source
- ADC_IT_EOS: ADC End of Regular sequence of Conversions interrupt source
- ADC_IT_OVR: ADC overrun interrupt source
- ADC_IT_JEOC: ADC End of Injected Conversion interrupt source
- ADC_IT_JEOS: ADC End of Injected sequence of Conversions interrupt source
- ADC_IT_AWD1: ADC Analog watchdog 1 interrupt source
- ADC_IT_AWD2: ADC Analog watchdog 2 interrupt source
- ADC_IT_AWD3: ADC Analog watchdog 3 interrupt source
- ADC_IT_JQOVF: ADC Injected Context Queue Overflow interrupt source
|
- Return values
-
Definition at line 2389 of file stm32f30x_adc.c.
Checks whether the specified ADC flag is set or not.
- Parameters
-
ADCx | where x can be 1, 2, 3 or 4 to select the ADC peripheral. |
ADC_FLAG | specifies the master or slave flag to check. This parameter can be one of the following values:
- ADC_FLAG_MSTRDY: ADC master Ready (ADRDY) flag
- ADC_FLAG_MSTEOSMP: ADC master End of Sampling flag
- ADC_FLAG_MSTEOC: ADC master End of Regular Conversion flag
- ADC_FLAG_MSTEOS: ADC master End of Regular sequence of Conversions flag
- ADC_FLAG_MSTOVR: ADC master overrun flag
- ADC_FLAG_MSTJEOC: ADC master End of Injected Conversion flag
- ADC_FLAG_MSTJEOS: ADC master End of Injected sequence of Conversions flag
- ADC_FLAG_MSTAWD1: ADC master Analog watchdog 1 flag
- ADC_FLAG_MSTAWD2: ADC master Analog watchdog 2 flag
- ADC_FLAG_MSTAWD3: ADC master Analog watchdog 3 flag
- ADC_FLAG_MSTJQOVF: ADC master Injected Context Queue Overflow flag
- ADC_FLAG_SLVRDY: ADC slave Ready (ADRDY) flag
- ADC_FLAG_SLVEOSMP: ADC slave End of Sampling flag
- ADC_FLAG_SLVEOC: ADC slave End of Regular Conversion flag
- ADC_FLAG_SLVEOS: ADC slave End of Regular sequence of Conversions flag
- ADC_FLAG_SLVOVR: ADC slave overrun flag
- ADC_FLAG_SLVJEOC: ADC slave End of Injected Conversion flag
- ADC_FLAG_SLVJEOS: ADC slave End of Injected sequence of Conversions flag
- ADC_FLAG_SLVAWD1: ADC slave Analog watchdog 1 flag
- ADC_FLAG_SLVAWD2: ADC slave Analog watchdog 2 flag
- ADC_FLAG_SLVAWD3: ADC slave Analog watchdog 3 flag
- ADC_FLAG_SLVJQOVF: ADC slave Injected Context Queue Overflow flag
|
- Return values
-
The | new state of ADC_FLAG (SET or RESET). |
Definition at line 2252 of file stm32f30x_adc.c.
Checks whether the specified ADC flag is set or not.
- Parameters
-
ADCx | where x can be 1, 2 or 3 to select the ADC 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_EOC: End of conversion flag
- ADC_FLAG_JEOC: End of injected group conversion flag
- ADC_FLAG_JSTRT: Start of injected group conversion flag
- ADC_FLAG_STRT: Start of regular group conversion flag
- ADC_FLAG_OVR: Overrun flag
|
- Return values
-
The | new state of ADC_FLAG (SET or RESET). |
Definition at line 1617 of file stm32f4xx_adc.c.
Checks whether the specified ADC flag is set or not.
- Parameters
-
ADCx | where x can be 1, 2, 3 or 4 to select the ADC peripheral. |
ADC_FLAG | specifies the flag to check. This parameter can be one of the following values:
- ADC_FLAG_RDY: ADC Ready (ADRDY) flag
- ADC_FLAG_EOSMP: ADC End of Sampling flag
- ADC_FLAG_EOC: ADC End of Regular Conversion flag
- ADC_FLAG_EOS: ADC End of Regular sequence of Conversions flag
- ADC_FLAG_OVR: ADC overrun flag
- ADC_FLAG_JEOC: ADC End of Injected Conversion flag
- ADC_FLAG_JEOS: ADC End of Injected sequence of Conversions flag
- ADC_FLAG_AWD1: ADC Analog watchdog 1 flag
- ADC_FLAG_AWD2: ADC Analog watchdog 2 flag
- ADC_FLAG_AWD3: ADC Analog watchdog 3 flag
- ADC_FLAG_JQOVF: ADC Injected Context Queue Overflow flag
|
- Return values
-
The | new state of ADC_FLAG (SET or RESET). |
Definition at line 2174 of file stm32f30x_adc.c.
Checks whether the specified ADC interrupt has occurred or not.
- Parameters
-
ADCx | where x can be 1, 2 or 3 to select the 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 mask
- ADC_IT_AWD: Analog watchdog interrupt mask
- ADC_IT_JEOC: End of injected conversion interrupt mask
- ADC_IT_OVR: Overrun interrupt mask
|
- Return values
-
The | new state of ADC_IT (SET or RESET). |
Definition at line 1673 of file stm32f4xx_adc.c.
Checks whether the specified ADC interrupt has occurred or not.
- Parameters
-
ADCx | where x can be 1, 2 or 3 to select the ADC peripheral. |
ADC_IT | specifies the ADC interrupt source to check. This parameter can be one of the following values:
- ADC_IT_RDY: ADC Ready (ADRDY) interrupt source
- ADC_IT_EOSMP: ADC End of Sampling interrupt source
- ADC_IT_EOC: ADC End of Regular Conversion interrupt source
- ADC_IT_EOS: ADC End of Regular sequence of Conversions interrupt source
- ADC_IT_OVR: ADC overrun interrupt source
- ADC_IT_JEOC: ADC End of Injected Conversion interrupt source
- ADC_IT_JEOS: ADC End of Injected sequence of Conversions interrupt source
- ADC_IT_AWD1: ADC Analog watchdog 1 interrupt source
- ADC_IT_AWD2: ADC Analog watchdog 2 interrupt source
- ADC_IT_AWD3: ADC Analog watchdog 3 interrupt source
- ADC_IT_JQOVF: ADC Injected Context Queue Overflow interrupt source
|
- Return values
-
The | new state of ADC_IT (SET or RESET). |
Definition at line 2349 of file stm32f30x_adc.c.
Enables or disables the specified ADC interrupts.
- Parameters
-
ADCx | where x can be 1, 2 or 3 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_EOC: End of conversion interrupt mask
- ADC_IT_AWD: Analog watchdog interrupt mask
- ADC_IT_JEOC: End of injected conversion interrupt mask
- ADC_IT_OVR: Overrun interrupt enable
|
NewState | new state of the specified ADC interrupts. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 1580 of file stm32f4xx_adc.c.
Enables or disables the specified ADC interrupts.
- Parameters
-
ADCx | where x can be 1, 2 or 3 to select the ADC peripheral. |
ADC_IT | specifies the ADC interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
- ADC_IT_RDY: ADC Ready (ADRDY) interrupt source
- ADC_IT_EOSMP: ADC End of Sampling interrupt source
- ADC_IT_EOC: ADC End of Regular Conversion interrupt source
- ADC_IT_EOS: ADC End of Regular sequence of Conversions interrupt source
- ADC_IT_OVR: ADC overrun interrupt source
- ADC_IT_JEOC: ADC End of Injected Conversion interrupt source
- ADC_IT_JEOS: ADC End of Injected sequence of Conversions interrupt source
- ADC_IT_AWD1: ADC Analog watchdog 1 interrupt source
- ADC_IT_AWD2: ADC Analog watchdog 2 interrupt source
- ADC_IT_AWD3: ADC Analog watchdog 3 interrupt source
- ADC_IT_JQOVF: ADC Injected Context Queue Overflow interrupt source
|
NewState | new state of the specified ADC interrupts. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 2137 of file stm32f30x_adc.c.