当前位置:网站首页>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
边栏推荐
猜你喜欢

物联网?快来看 Arduino 上云啦

ADC acquisition noise and comparison between RMS filter and Kalman filter

C#使用MySql进行操作

Development and monitoring of fusion experiment pulse power supply by LabVIEW

智慧家——全家具功能

C # operate with MySQL

Nacos注册中心

.net使用Access 2010数据库

Essence and thoughts of 30 lectures on product thinking

下载安装Flume
随机推荐
填鸭数据即时收集解决方案资源
Px4 system terminal for pixhawk
Error 65:access violation at 0x58024400: no 'read' permission
物联网?快来看 Arduino 上云啦
单选框互斥且可同时取消选中
halcon之区域:多种区域(Region)生成(4)
C#使用MySql进行操作
Classic interview questions: mouse drug test and Hamming code
ADC acquisition noise and comparison between RMS filter and Kalman filter
Simple deepclone
FIFO code implemented in C language
使用Gin框架运行Demo时报错“ listen tcp :8080: bind: An attempt was made to access a socket in a way forbidden”
智慧家——全家具功能
The maze of God's perspective in robot vision
[understanding of opportunity -30]: Guiguzi - internal "chapter - empathy, stand on the other side's position and narrow the psychological distance with the other side
FreeRTOS+STM32L+ESP8266+MQTT协议传输温湿度数据到腾讯云物联网平台
Implementation notes of least square fitting conic in stm32
Online gadget sharing (updated from time to time, current quantity: 2)
Flex & Bison 开始
卡通shader