当前位置:网站首页>Stm32f103c8t6 firmware library lighting
Stm32f103c8t6 firmware library lighting
2022-07-03 16:01:00 【Big golden hair】
summary : Configure lighting graphic description through firmware library
1. In the firmware library folder USER Create a folder in LED, stay LED Create text in folder ,LED.C,LED.H
2. stay keil Middle double click user The folder will c Add the file
3. stay c Add the required header file to the file , This time we need
#include "led.h"
#include "stm32f10x.h"
Compile once after adding
4. open led.h, Add... To it
#include "stm32f10x.h"
5. Add a path to the magic wand
7. Write led-init Function configuration GPIO Structure
It can be seen from the schematic diagram that LED Corresponding PC13, We need to configure GPIOc The clock of ,GPIOc Mounted on APB2 On , So it needs to be turned on APB2 The clock on the computer .
GPIO_InitTypeDef It includes
Pin , Speed ( You can choose any one for the time being ), The output mode ( Push pull output )
Use GPIO_Init(); Function initialization on GPIO, The first parameter is GPIOX, The second is the address of the structure variable
stay h Relevant functions are described in the document
8. stay main.c Initialization function used in
9. You need to use two functions ,GPIO_SetBit()[ Set up 1] and GPIO_RsetBit()[ Set up 0]
From the schematic diagram, you want LED bright GPIO One end should be placed 0 In order to have enough pressure difference to make LED bright
GPIO_ResetBits(GPIOC,GPIO_Pin_13);
10. compile , Swipe after no error
边栏推荐
- How are integer and floating-point types stored in memory
- Go language self-study series | if else if statement in golang
- App移动端测试【3】ADB命令
- From the 18th line to the first line, the new story of the network security industry
- Custom annotation
- 深度学习之三维重建
- Unity function - unity offline document download and use
- Digital image processing -- popular Canny edge detection
- Intelij idea efficient skills (III)
- 子类隐藏父类的同名函数
猜你喜欢
Redis installation under windows and Linux systems
Redis在Windows以及Linux系统下的安装
Automatic generation of client code from flask server code -- Introduction to flask native stubs Library
[redis foundation] understand redis master-slave architecture, sentinel mode and cluster together (Demo detailed explanation)
Seckill system 3- product list and product details
【Proteus仿真】74HC595+74LS154驱动显示16X16点阵
Popular understanding of ovo and ovr
Microservice API gateway zuul
Creation and destruction of function stack frames
ASEMI整流桥UMB10F参数,UMB10F规格,UMB10F封装
随机推荐
How are integer and floating-point types stored in memory
How idea starts run dashboard
[200 opencv routines] 217 Mouse interaction to obtain polygon area (ROI)
uploads-labs靶场(附源码分析)(更新中)
Persisting in output requires continuous learning
Go语言自学系列 | golang switch语句
几种常见IO模型的原理
Redis high availability and persistence
Second kill system 3 - list of items and item details
《微服务设计》读书笔记(上)
Find mapping relationship
do{}while()的妙用
Pyinstaller is not an internal or external command, nor is it a runnable program or batch file
“用Android复刻Apple产品UI”(2)——丝滑的AppStore卡片转场动画
Tensorflow realizes verification code recognition (III)
Custom annotation
Redis高可用与持久化
Microservice - Nacos registration center and configuration center
嵌入式开发:避免开源软件的7个理由
Why can't strings be directly compared with equals; Why can't some integers be directly compared with the equal sign