一、真题部分
![](https://img-blog.csdnimg.cn/img_convert/d492ec7ce40f3e89301a0d092edf15f7.png)
![](https://img-blog.csdnimg.cn/img_convert/4eb27ec8b190fbc782e12e8eb01d1847.png)
![](https://img-blog.csdnimg.cn/img_convert/23edca556195d792b1779445812a206c.png)
![](https://img-blog.csdnimg.cn/img_convert/1d9fba0c26d22d42d2211a7fb2806b18.png)
二、LoRa_A
1、配置根据试题的要求配置STM32CubeMX
(1)引脚配置
将PC14引脚配置为输入模式
PC14 用户按键引脚
将PA10引脚配置为中断模式
PA10 LoRa模块DIO0引脚
将以下引脚配置为输出模式
PC15 用户LED引脚
PB5 OLED电源控制引脚
PA11和PA12 继电器控制引脚
PA4和PA9 LoRa模块片选和复位引脚,初始为高电平
GPIO引脚初始化
![](https://img-blog.csdnimg.cn/img_convert/a8e3f50bc838dc15901e3eae2255b21e.png)
使能EXTI4_15中断
![](https://img-blog.csdnimg.cn/img_convert/d57d5f69bdf9d529ff3e656031a4d63e.png)
(2)配置I2C模块,因为新版数据资源包需要自己创建I2C模块的程序,所以利用STM32CubeMX配置硬件I2C模块
![](https://img-blog.csdnimg.cn/img_convert/7a65787718046e1f0cc299fab06e8c34.png)