当前位置:网站首页>STM32GPIO
STM32GPIO
2022-06-26 01:17:00 【m0_ forty-six million three hundred and twenty-one thousand one】
GPIO Basic knowledge
STM32 Most owned GPIOA、GPIOB...GPIOG Seven ports , Each port has a maximum of Pin0、Pin1...Pin15 common 16 One pin .
STM32 Each I/O Ports can be freely programmed , but I/O The register must be pressed 32 Bit words are accessed
Two GPIO Output HAL Library function
1)GPIO Electric frequency output HAL Library function
GPIOx: The port number of the target pin
GPIO_Pin: The pin number of the target pin
PinState: High level ---GPIO_PIN_SET, Low level --GPIO_PIN_RESET
for example : towards PB8 Pin output high level HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
2)GPIO Level flip HAL Library function
Output the opposite level according to the current level
for example :PA3 Output level flip ,HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_3);
GPIO The functions and properties of the port
Normal output ( Push pull output and open floor output )
Analog input
Reuse output
I/O Interface circuit
To configure STM32cubeMX
To configure SYS as well as RCC
Configure clocks
The generated code , Name the file , And choose MDK-ARM V5
Check the box shown in the above figure , Then you can generate code , To MDK Editor in chief
stay mian Functional USER CODE Editor inside , When it's halfway through development , If you want to redefine the pins , Can return STMcubeMX edit , Instead of deleting all the original code .
Compile successfully
边栏推荐
- Optimized three-dimensional space positioning method and its fast implementation in C language
- [learn FPGA programming from scratch -44]: vision chapter - integrated circuit helps high-quality development in the digital era -1- main forms of integrated circuit chips
- idea配置
- QT cmake pure C code calls the system console to input scanf and Chinese output garbled code
- About the use of hc-12 radio frequency module
- Flex & Bison 开始
- DGUS新升级:全面支持数字视频播放功能
- .net使用Access 2010数据库
- ADC acquisition noise and comparison between RMS filter and Kalman filter
- 多接口调用,使用Promise.all、Promise.race和Promise.any
猜你喜欢
I2C protocol
制作3D浪漫炫酷相册【附源码】
Chapter VI exercises (678) [microcomputer principles] [exercises]
FIFO code implemented in C language
Idea configuration
QT cmake pure C code calls the system console to input scanf and Chinese output garbled code
ciscn_ 2019_ en_ two
SPI protocol
Vscode shortcut
From query database performance optimization to redis cache - talk about cache penetration, avalanche and breakdown
随机推荐
Cartoon shader
Freertos+stm32l+esp8266+mqtt protocol transmits temperature and humidity data to Tencent cloud IOT platform
Inheritance -- holy grail mode
开窍之问答
jarvisoj_ level2_ x64
FIFO code implemented in C language
Design and process analysis of anti backflow circuit for MOS transistor
Etcd database source code analysis -- inter cluster network layer server interface
Data analysis slicer, PivotTable and PivotChart (necessary in the workplace)
Msp430f5529lp official board (red) can not debug the problem
ETCD数据库源码分析——集群通信初始化
The cache page stores the initial parameters after the route jump under the react + router framework
Mpu6050 reads the ID incorrectly and 0xd1 occurs (the correct ID should be 0x68 or 0x69). Solution.
The kth largest element in the array
100ask seven day IOT training camp learning notes - bare metal program framework design
从查询数据库性能优化谈到redis缓存-谈一谈缓存的穿透、雪崩、击穿
信息收集的利器,Google骇客语法
毕业季你考虑好去留了吗
DGUS新升级:全面支持数字视频播放功能
Development and monitoring of fusion experiment pulse power supply by LabVIEW