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

边栏推荐
- Button wizard play strange learning - automatic return to the city route judgment
- MySQL --- 数据库查询 - 基本查询
- 串口抓包/截断工具的安装及使用详解
- C#应用程序界面开发基础——窗体控制(2)——MDI窗体
- 數學知識:臺階-Nim遊戲—博弈論
- Dotconnect for PostgreSQL data provider
- C#应用程序界面开发基础——窗体控制(1)——Form窗体
- 看疫情之下服装企业如何顺势而为
- Leetcode skimming questions_ Sum of two numbers II - enter an ordered array
- C#应用程序界面开发基础——窗体控制(4)——选择类控件
猜你喜欢

【数据挖掘】任务4:20Newsgroups聚类

【C语言】指针与数组笔试题详解

Using tensorboard to visualize the model, data and training process

MySQL - database query - basic query
![[Androd] Gradle 使用技巧之模块依赖替换](/img/5f/968db696932f155a8c4a45f67135ac.png)
[Androd] Gradle 使用技巧之模块依赖替换

SSL flood attack of DDoS attack
![[error record] the shutter component reports an error (no directionality widget found. | richtext widgets require a directionality)](/img/3c/93ef853784d4e7cef63f30be0b0bf2.jpg)
[error record] the shutter component reports an error (no directionality widget found. | richtext widgets require a directionality)

C#应用程序界面开发基础——窗体控制(1)——Form窗体

串口抓包/截断工具的安装及使用详解

强化学习 Q-learning 实例详解
随机推荐
Using tensorboard to visualize the model, data and training process
Main features of transport layer TCP and TCP connection
A simple tool for analyzing fgui dependencies
[system analyst's road] Chapter V double disk software engineering (development model development method)
Tâche 6: regroupement DBSCAN
Mathematical Knowledge: Steps - Nim Games - Game Theory
2022 coal mine gas drainage examination question bank and coal mine gas drainage examination questions and analysis
英语常用词汇
Kivy tutorial how to create drop-down lists in Kivy
数学知识:台阶-Nim游戏—博弈论
[technology development-23]: application of DSP in future converged networks
【数据挖掘】任务5:K-means/DBSCAN聚类:双层正方形
Pytest learning notes (12) -allure feature · @allure Step () and allure attach
uniapp组件-uni-notice-bar通告栏
Detailed explanation of Q-learning examples of reinforcement learning
一比特苦逼程序員的找工作經曆
Makefile中wildcard、patsubst、notdir的含义
LeetCode 987. Vertical order transverse of a binary tree - Binary Tree Series Question 7
MySQL foundation 07-dcl
【數據挖掘】任務6:DBSCAN聚類