当前位置:网站首页>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 .

边栏推荐
- [fh-gfsk] fh-gfsk signal analysis and blind demodulation research
- tail -f 、tail -F、tailf的区别
- CF1617B Madoka and the Elegant Gift、CF1654C Alice and the Cake、 CF1696C Fishingprince Plays With Arr
- C application interface development foundation - form control (4) - selection control
- C#应用程序界面开发基础——窗体控制(1)——Form窗体
- Arduino DY-SV17F自动语音播报
- Leetcode 2097 - Legal rearrangement of pairs
- The thread reuse problem of PageHelper using ThreadLocal, did you use it correctly?
- 英语常用词汇
- High-Resolution Network (篇一):原理刨析
猜你喜欢

Qtablewidget lazy load remaining memory, no card!
![[shutter] animation animation (basic process of shutter animation | create animation controller | create animation | set value listener | set state listener | use animation values in layout | animatio](/img/70/54eb9359ac91aa43383b240eb036b7.gif)
[shutter] animation animation (basic process of shutter animation | create animation controller | create animation | set value listener | set state listener | use animation values in layout | animatio

【面试题】1369- 什么时候不能使用箭头函数?

MySQL - database query - condition query

【数据挖掘】任务1:距离计算

Leetcode 6103 - minimum fraction to delete an edge from the tree
![[机缘参悟-36]:鬼谷子-飞箝篇 - 面对捧杀与诱饵的防范之道](/img/c6/9aee30cb935b203c7c62b12c822085.jpg)
[机缘参悟-36]:鬼谷子-飞箝篇 - 面对捧杀与诱饵的防范之道

MySQL foundation 05 DML language

Detailed explanation of Q-learning examples of reinforcement learning

High resolution network (Part 1): Principle Analysis
随机推荐
LeetCode 987. Vertical order transverse of a binary tree - Binary Tree Series Question 7
Do not log in or log in to solve the problem that the Oracle database account is locked.
leetcode 6103 — 从树中删除边的最小分数
What operations need attention in the spot gold investment market?
LDC Build Shared Library
A simple tool for analyzing fgui dependencies
2022 Jiangxi Provincial Safety Officer B certificate reexamination examination and Jiangxi Provincial Safety Officer B certificate simulation examination question bank
Mathematical knowledge: Nim game game theory
How is the mask effect achieved in the LPL ban/pick selection stage?
MySQL foundation 07-dcl
After reading this article, I will teach you to play with the penetration test target vulnhub - drivetingblues-9
Concise analysis of redis source code 11 - Main IO threads and redis 6.0 multi IO threads
【数据挖掘】任务3:决策树分类
Button wizard play strange learning - automatic return to the city route judgment
电信客户流失预测挑战赛
Related concepts of GDB in embedded system
串口抓包/截断工具的安装及使用详解
MySQL --- 数据库查询 - 基本查询
Mathematical knowledge: divisible number inclusion exclusion principle
Introduction to flask tutorial