https://gitee.com/xushicheng1202/stm32-cube-mx_LL.git
1、SYS选择debug模式
![](https://i-blog.csdnimg.cn/blog_migrate/8cc4785f6f96158b06ef4f60ac0e260b.png)
2、RCC选择晶振模式:内部晶振、外部晶振
![](https://i-blog.csdnimg.cn/blog_migrate/d9b708abdfac80bc75791170bfbbc2df.png)
3、设置GPIO属性
![](https://i-blog.csdnimg.cn/blog_migrate/7f4ecdff08feedebbc4f076a099c863b.png)
4、配置Clock时钟
![](https://i-blog.csdnimg.cn/blog_migrate/31d2c82ec2f9f9bc34315df9f41021cb.png)
5、设置项目名称、位置和IDE
![](https://i-blog.csdnimg.cn/blog_migrate/ae86a07a1d927a748c68f0ec357999a9.png)
6、Advance Setting,选择LL库
![](https://i-blog.csdnimg.cn/blog_migrate/3f28bd82ca4d981c76045a685f27d82f.png)
7、生成外设初始化(.c或.h)并生成代码
![](https://i-blog.csdnimg.cn/blog_migrate/c08b33377e7df766f2611ba332480db0.png)
8、生成工程后在main函数while(1)下添加如下代码即可实现简单的IO反转
(注意:一定要在BEGIN和END之间写代码,否则重新生成工程代码会覆盖!!!)
/* 你应该把你的代码写在在BEGIN与END之间 */
LL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
LL_mDelay(500);
/* You can also write this, uncomment the code below and then comment the code above */
/* 或者你可以这样写,把下面的代码反注释然后把上面的代码注释 */
// LL_GPIO_ResetOutputPin(LED_GPIO_Port, LED_Pin);
// LL_mDelay(500);
// LL_GPIO_SetOutputPin(LED_GPIO_Port, LED_Pin);
// LL_mDelay(500);