当前位置:网站首页>GPIO novice
GPIO novice
2022-06-23 09:12:00 【July meteor】
1,GPIO Seven registers of :
Two 32 Bit configuration register :GPIOx_CRL,GPIOx_CRH (x=A,B,C,D,E)
Two 32 Bit data register :GPIOx_IDR,GPIOx_ODR
One 16 Position position / Reset register :GPIOx_BSRR
One 16 Bit reset register :GPIOx_BRR
One 32 Bit lock register :GPIOx_LCKR
2,GOIO operation :
Output drive circuit :
Inside ( Write operations )--> Bit settings / Reset register --> Output data register --> Output control --
Input drive circuit :
Analog input , Both pull-up and pull-down switches are off , Floating input
Universal (GPIO) And reuse (AFIO) function
Input : Enter the float , Input pull-up , Type in the dropdown , Analog input
Output : Open drain output , Push pull output , Push pull multiplexed output , Open drain multiplexing
3,GPIO Port bit configuration
CRL Control register , Two bits control one pin ,CRL Control the lower eight digits ,CRH Control high eight bits
IDR Input data register , Use only low 16 One bit data , Each bit controls one pin
ODR The function of output data register is the same as above , high 16 Bit function reserved .
GPIO Register operation :
1. High pin output / Low level
GPIOA->CRL = 0x33;
GPIOA->ODR = 0x0000; //0
GPIOA->ODR = 0x3; //1
2.GPIOA_Pin_0 Status of with GPIOA_Pin_8 The state of change
1.GPIOA Of 0 Feet as output ,50MHZ;GPIOA Of 8 Feet as input
2.GPIOA_Pin_0 == GPIOA_Pin_8
GPIOA->CRL = 0x03; //0 Foot push-pull output ,50MHZ
GPIOA->CRH = 0x04; //8 Foot float input
while(1)
{
if((GPIOA->IDR&0x0100) == 0x0100)
GPIOA->ODR = 0x01;
else
GPIOA->ODR = 0x00;
}
边栏推荐
- In depth interpretation of poca smart contract platform gear: the road to parallel architecture public chain
- 如何在 FlowUs、Notion 等笔记软件中使用「番茄工作法」?
- Redis学习笔记—Redis与Lua
- @Response
- [qnx hypervisor 2.2 user manual]6.1 using the QNX hypervisor system
- 4sum of leetcode topic analysis
- Leetcode topic analysis contains duplicate III
- How to use "tomato working method" in flowus, notation and other note taking software?
- Redis学习笔记—主从复制
- Node request module cookie usage
猜你喜欢

Zone d'entrée du formulaire ionic5 et boutons radio
Redis学习笔记—持久化机制之AOF

297. Serialize and Deserialize Binary Tree

一个采用直接映射方式的32KB缓存......存储器课后习题

Learn SCI thesis drawing skills (E)

多线程初学

Custom tag - JSP tag Foundation
Redis学习笔记—Redis与Lua

【活动报名】SOFAStack × CSDN 联合举办开源系列 Meetup ,6 月 24 日火热开启
Redis learning notes pipeline
随机推荐
S5P4418裸机编程的实现(替换2ndboot)
Click Add drop-down box
'教练,我想打篮球!' —— 给做系统的同学们准备的 AI 学习系列小册
Quartz Crystal Drive Level Calculation
Redis learning notes - redis and Lua
【云原生 | Kubernetes篇】Kubernetes原理与安装(二)
How to use "tomato working method" in flowus, notation and other note taking software?
Longest substring without repeated characters (C language)
Leetcode topic analysis 3sum
2022.6.22-----leetcode. five hundred and thirteen
"Coach, I want to play basketball" -- AI Learning Series booklet for students who are making systems
Kotlin Series 1: getting started with basics
438. Find All Anagrams in a String
ARM处理器与51单片机程序编写的区别
使用base64,展示图片
Redis learning notes - slow query analysis
Redis学习笔记—客户端通讯协议RESP
2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。
2022.6.22-----leetcode.513
1、 Software architecture evaluation