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

边栏推荐
- The meaning of wildcard, patsubst and notdir in makefile
- Androd Gradle 对其使用模块依赖的替换
- MySQL --- 数据库查询 - 基本查询
- Summary of interval knowledge
- Mathematical knowledge: divisible number inclusion exclusion principle
- MySQL foundation 06 DDL
- 看疫情之下服装企业如何顺势而为
- The difference between tail -f, tail -f and tail
- Kivy tutorial how to create drop-down lists in Kivy
- SwiftUI 组件大全之使用 SceneKit 和 SwiftUI 构建交互式 3D 饼图(教程含源码)
猜你喜欢

Why is it not recommended to use BeanUtils in production?
![[data mining] task 5: k-means/dbscan clustering: double square](/img/e7/678197e703d1a28b765a0e3afd5580.png)
[data mining] task 5: k-means/dbscan clustering: double square

MySQL --- 数据库查询 - 基本查询

High resolution network (Part 1): Principle Analysis

Force buckle 204 Count prime

Top ten regular spot trading platforms 2022

【數據挖掘】任務6:DBSCAN聚類

How is the mask effect achieved in the LPL ban/pick selection stage?

SSL flood attack of DDoS attack

MySQL - database query - condition query
随机推荐
Why is it not recommended to use BeanUtils in production?
【QT】自定义控件的封装
2022 coal mine gas drainage examination question bank and coal mine gas drainage examination questions and analysis
Canvas drawing -- bingdd
对非ts/js文件模块进行类型扩充
Top ten regular spot trading platforms 2022
Give you an array numbers that may have duplicate element values. It was originally an array arranged in ascending order, and it was rotated once according to the above situation. Please return the sm
[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
GDB 在嵌入式中的相关概念
给你一个可能存在 重复 元素值的数组 numbers ,它原来是一个升序排列的数组,并按上述情形进行了一次旋转。请返回旋转数组的最小元素。【剑指Offer】
Dotconnect for PostgreSQL data provider
Meituan dynamic thread pool practice ideas, open source
Now that the teenager has returned, the world's fireworks are the most soothing and ordinary people return to work~
SSL flood attack of DDoS attack
Related concepts of GDB in embedded system
2022 Jiangxi Provincial Safety Officer B certificate reexamination examination and Jiangxi Provincial Safety Officer B certificate simulation examination question bank
串口抓包/截断工具的安装及使用详解
tail -f 、tail -F、tailf的区别
看完这篇 教你玩转渗透测试靶机Vulnhub——DriftingBlues-9
一位苦逼程序员的找工作经历