当前位置:网站首页>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
边栏推荐
- About EF page turning query database
- 智慧家——全家具功能
- Comment promouvoir efficacement les produits
- Mpu6050 reads the ID incorrectly and 0xd1 occurs (the correct ID should be 0x68 or 0x69). Solution.
- Classic interview questions: mouse drug test and Hamming code
- Native DOM vs. virtual DOM
- 简单 deepclone
- Radio boxes are mutually exclusive and can be deselected at the same time
- New library launched | cnopendata wholesale price data of agricultural products
- Web information collection, naked runners on the Internet
猜你喜欢
![Chapter VI exercises (678) [microcomputer principles] [exercises]](/img/20/b02bccebfb245d4710f6f48dd0f5e4.png)
Chapter VI exercises (678) [microcomputer principles] [exercises]

制作3D浪漫炫酷相册【附源码】

From query database performance optimization to redis cache - talk about cache penetration, avalanche and breakdown

FIFO code implemented in C language

Establish a j-link GDB cross debugging environment for Px4

下载安装Flume

《网络是怎么样连接的》读书笔记 - 集线器、路由器和路由器(三)

ADC acquisition noise and comparison between RMS filter and Kalman filter

Dgus new upgrade: fully support digital video playback function

数据分析——切片器、数据透视表与数据透视图(职场必备)
随机推荐
随便画画的
Multiple interface calls, using promise all、Promise. Race and promise any
Case: drawing Matplotlib dynamic graph
模板引擎——FreeMarker初体验
[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
生信周刊第33期
Dgus new upgrade: fully support digital video playback function
每日一问:线程和进程的区别
剑指 Offer II 096. 字符串交织
Zhihuijia - full furniture function
Typescript for Web Learning
FreeRTOS+STM32L+ESP8266+MQTT协议传输温湿度数据到腾讯云物联网平台
[从零开始学习FPGA编程-44]:视野篇 - 集成电路助力数字化时代高质量发展-1-集成电路芯片主要形态
Digital circuit - adder
100ask seven day IOT training camp learning notes - bare metal program framework design
WIN10系统C盘清理策略
Music spectrum display toy -- implementation and application of FFT in stm32
C another new class is ICO? And app Use of config
Casually painted
2022防爆电气操作证考试题库及模拟考试