stm32f10x_exti.cpp
来自「STM32 USB HID」· C++ 代码 · 共 28 行
CPP
28 行
#include"stm32f10x_rcc.h"
#include"stm32f10x_nvic.h"
#include"stm32f10x_gpio.h"
//-----------------------------------------------------------------------------
#include"stm32f10x_exti.hpp"
#include"stdio.h"
//-----------------------------------------------------------------------------
void EXTI_Configuration()
{
RCC_APB2ENR_BITS[GPIOA_EN] =1;
//相应引脚配置
{ //输入浮空
GPIOA_CRL_BITS[CNF2_1] =0;
GPIOA_CRL_BITS[CNF2_0] =1;
GPIOA_CRL_BITS[MODE2_1]=0;
GPIOA_CRL_BITS[MODE2_0]=0;
}
//EXIT
EXTI_IMR_BITS[MR2] =1;
EXTI_FTSR_BITS[TR2]=1;
//相应中断使能
NVIC_SETENA0|=EN_EXTI_2;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?