当前位置:网站首页>STM32 - introduction of external interrupts exti and NVIC
STM32 - introduction of external interrupts exti and NVIC
2022-07-03 01:36:00 【Spade fish】
STM32—— External interrupt EXTI and NVIC Introduction to
List of articles
What interruption is ?
Stop what you are doing and get busy with something else , After you finish your work, come back and continue to do what you are doing
Interrupt what you did ——> Interrupt work
Keep the scene —— Keep the work progress
Handling interrupts ——> The conversation
Back to the scene ——> Keep working
How to configure interrupts
1、 Initializes the used to interrupt GPIO mouth
2、 initialization EXTI( What is? EXTI?)
Edge detection circuit ——> Rising edge / Falling edge trigger interrupt
EXTI Is an external interrupt source , Yes 20 Interrupt or event line
3、 To configure NVIC ( Interrupt priority )
Configure interrupt priority , Break nesting
4、 Write interrupt service function
EXTI Structure
1、EXTI_Line:EXTI interrupt / Event line selection , Optional EXTI0 to EXTI19(stm32f10x_exti.h)
2、EXTI_Mode: EXTI Mode selection , The optional mode is generate interrupt / Produce an event
3、EXTI_Trigger: EXTI Edge triggered events , Optional rising edge trigger , Falling edge trigger Or both rising and falling edges trigger
4、EXTI_LineCmd: Control whether to enable EXTI Line , Can make EXTI Line or disable .
typedef struct
{
uint32_t EXTI_Line; /* Select the break line */
EXTIMode_TypeDef EXTI_Mode; /* Select shielding ; Interrupt frequency closure 、 Event masking */
EXTITrigger_TypeDef EXTI_Trigger; /* Select trigger mode : Rising edge 、 Falling edge 、 Software interruption events */
FunctionalState EXTI_LineCmd; /* Can make */
}EXTI_InitTypeDef;
NVIC Structure
typedef struct
{
uint8_t NVIC_IRQChannel;
uint8_t NVIC_IRQChannelPreemptionPriority;
uint8_t NVIC_IRQChannelSubPriority;
FunctionalState NVIC_IRQChannelCmd;
} NVIC_InitTypeDef;
1、NVIC_IRQChannel: Set interrupt channel (misc.h)
2、NVIC_IRQChannelPreemptionPriority: Set preemption priority
3、NVIC_IRQChannelSubPriority: Set sub priority
4、NVIC_IRQChannelCmd: Control whether to enable Interrupt controller , Can make Or disable .
边栏推荐
- C language course information management system
- 产业互联网的产业范畴足够大 消费互联网时代仅是一个局限在互联网行业的存在
- d. LDC build shared library
- C application interface development foundation - form control (3) - file control
- Mathematical knowledge: Nim game game theory
- [机缘参悟-36]:鬼谷子-飞箝篇 - 面对捧杀与诱饵的防范之道
- MySQL --- 数据库查询 - 条件查询
- [Androd] Gradle 使用技巧之模块依赖替换
- wirehark数据分析与取证A.pacapng
- [Cao gongzatan] after working in goose factory for a year in 2021, some of my insights
猜你喜欢
【数据挖掘】任务1:距离计算
dotConnect for PostgreSQL数据提供程序
Installation and use of serial port packet capturing / cutting tool
Androd gradle's substitution of its use module dependency
Androd Gradle 对其使用模块依赖的替换
Three core issues of concurrent programming - "deep understanding of high concurrent programming"
传输层 TCP主要特点和TCP连接
软考信息系统项目管理师_历年真题_2019下半年错题集_上午综合知识题---软考高级之信息系统项目管理师053
Learn the five skills you need to master in cloud computing application development
MySQL - database query - condition query
随机推荐
Database SQL language 01 where condition
一位苦逼程序员的找工作经历
C#应用程序界面开发基础——窗体控制(4)——选择类控件
Androd Gradle 对其使用模块依赖的替换
GDB 在嵌入式中的相关概念
Is there anything in common between spot gold and spot silver
CF1617B Madoka and the Elegant Gift、CF1654C Alice and the Cake、 CF1696C Fishingprince Plays With Arr
How is the mask effect achieved in the LPL ban/pick selection stage?
Using tensorboard to visualize the model, data and training process
Test shift right: Elk practice of online quality monitoring
Force buckle 204 Count prime
wirehark数据分析与取证A.pacapng
What are the trading forms of spot gold and what are the profitable advantages?
Summary of interval knowledge
Druid database connection pool
C application interface development foundation - form control (2) - MDI form
Why can't the start method be called repeatedly? But the run method can?
tail -f 、tail -F、tailf的区别
Do not log in or log in to solve the problem that the Oracle database account is locked.
[FPGA tutorial case 6] design and implementation of dual port RAM based on vivado core