STM32 library functions EXTI_GetFlagStatus and EXTI_GetIT

Publisher:Lihua1314520Latest update time:2015-11-19 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
One is for getting status and the other is for getting interrupts.

EXTI_GetFlagStatus simply reads the status of the interrupt flag, but does not necessarily respond to the interrupt (the EXT_IMR register masks the interrupt); while EXTI_GetITStatus, in addition to reading the interrupt flag, also checks whether the EXT_IMR register masks the interrupt. If the interrupt is pending & not masked, the interrupt will be responded to. Take a closer look at the code and you will know the difference.
FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line)
{
 FlagStatus bitstatus = RESET;
 
 assert_param(IS_GET_EXTI_LINE(EXTI_Line));
 
 if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET)
 {
   bitstatus = SET;
 }
 else
 {
   bitstatus = RESET;
 }
 return bitstatus ;
}

ITStatus EXTI_GetITStatus(uint32_t EXTI_Line)
{
 ITStatus bitstatus = RESET;
 uint32_t enablestatus = 0;
 
 assert_param(IS_GET_EXTI_LINE(EXTI_Line));
 
 enablestatus =  EXTI->IMR & EXTI_Line;
 if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET) && (enablestatus != (uint32_t)RESET))
 {
   bitstatus = SET;
 }
 else
 {
   bitstatus = RESET;
 }
 return bitstatus;
}


Keywords:STM32 Reference address:STM32 library functions EXTI_GetFlagStatus and EXTI_GetIT

Previous article:Detailed explanation of the use of STM32 CAN module
Next article:CAN bus communication program based on STM32

Recommended ReadingLatest update time:2024-11-16 13:30

ucos has been transplanted on stm32, and now DS18B20 is needed to collect temperature
The operation timing of DS18B20 requires delay. Should I use the delay function of ucos or write a delay in a loop myself? Now there is a problem: if I use the delay function of ucos, if a higher priority task appears, the task of reading DS18B20 will be suspended, which will destroy the timing operation of DS18B20
[Microcontroller]
Electro-hydraulic servo controller based on DSP and STM32
introduction Most servo control systems use traditional hardware structures, and the control algorithms are relatively fixed. In addition, they cannot realize high-performance control algorithms under different working conditions, which makes it difficult to meet the needs of modern industry. At present, there is an
[Microcontroller]
Electro-hydraulic servo controller based on DSP and STM32
STM32, floating input - default level
STM32, floating input (GPIO_Mode_IN_FLOATING) - the default level is high, measured with a multimeter is about 1.6v Related sentences:  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; //Floating input Pull-down input: The default is low level, and an external high level can detect a high level signal Related sen
[Microcontroller]
stm32 pointer variable without initial value causes program to run away
//Timer 3 interrupt service routine   void TIM3_IRQHandler(void) {          if(TIM3- SR&0X0001)//Overflow interrupt { char str ; //LED1=!LED1;       //TIM3- CR1 &= 0xfe; //Turn off timer 3                rx_all += rx_count;                tx_all += tx_count; sprintf(str,"%4d",rx_all); show_str(25,0,str); sprintf(str,"
[Microcontroller]
Use of STM32 ADC injection channel
By using the ADC injection channel, you can get the AD sampling values ​​of the 4 GPIO inputs in real time. See the specific code below.  Chip: STM32F205VCT6 STEP 1: Initialize GPIO void GPIO_Configuration ( void ) { //GPIO -PC0 PC1 PC2 PC3 -ADC3     GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 |
[Microcontroller]
STM32—printf function redefinition
  In order to facilitate debugging, we often need to use the printf function to print out debugging information. In Keil software, if you want to use the printf output function, please note that you need to select the use MicrolLIB option first, as shown below.   Next, add the declaration of the printf function b
[Microcontroller]
STM32—printf function redefinition
Summary of STM32 UART DMA transmission
Using DMA transmission, you can continuously obtain or send a piece of information without interruption or delay. It is very useful when communication is frequent or there is a large amount of information to be transmitted.   From the table above, we can see that to use USART1TX/RX we select channels 4 and 5 1. DMA t
[Microcontroller]
Study notes on USB enumeration process based on STM32 (I)
    Previously, I used the official ST library and online materials to complete the communication between STM32 and PC using USB HID class. Due to other reasons, I did not conduct in-depth analysis. Although the functions were implemented, I did not have a clear concept of USB device enumeration and specific communicat
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号