STM32 学习记录
I
目 录
1 基础知识 ............................................................................................................................ 3
1.1 基础概念 ...................................................................................................................... 3
1.2 GPIO ............................................................................................................................ 4
1.2.1 概念和结构 ........................................................................................................... 4
1.2.2 GPIO 的使用 ......................................................................................................... 6
1.3 C 语言知识 .................................................................................................................. 6
2 软件配置 ............................................................................................................................ 8
2.1 新建工程(配置寄存器,还未配置库函数) .......................................................... 8
2.2 配置库函数 ................................................................................................................ 11
2.3 小技巧 ........................................................................................................................ 13
3 点亮板上灯 ...................................................................................................................... 16
3.1 基础知识 .................................................................................................................... 16
3.2 寄存器点灯 ................................................................................................................ 16
3.3 库函数点灯 ................................................................................................................ 16
4 GPIO 的输出 .................................................................................................................... 17
4.1 外设 LED 的亮灭 ...................................................................................................... 17
4.1.1 知识补充 ............................................................................................................. 17
4.1.2 代码编写 ............................................................................................................. 17
4.2 外设 LED 的闪烁 ...................................................................................................... 20
4.3 外设 LED 流水灯 ...................................................................................................... 21
4.4 软件操作 .................................................................................................................... 22
5 GPIO 输入 ........................................................................................................................ 23
5.1 按键的使用 ................................................................................................................ 23
5.1.1 知识补充 ............................................................................................................. 23
5.1.2 操作 ..................................................................................................................... 24
6 EXTI 外部中断 ................................................................................................................ 27
6.1 知识补充 .................................................................................................................... 27