当前位置:网站首页>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;
}
边栏推荐
- General paging (1)
- ARM处理器与51单片机程序编写的区别
- [event registration] sofastack × CSDN jointly held the open source series meetup, which was launched on June 24
- MySQL fault case | error 1071 (42000): specified key was too long
- Redis学习笔记—慢查询分析
- Unity grid programming 06
- 什么是闭包函数
- Quartz Crystal Drive Level Calculation
- 一元函数求极限三大方法---洛必达法则,泰勒公式
- node request模块cookie使用
猜你喜欢

Quartz Crystal Drive Level Calculation

Ionic5 form input box and radio button

Redis学习笔记—客户端通讯协议RESP

学习SCI论文绘制技巧(F)

js 用**遮罩身份证以及手机号的重要数据

线性表(SequenceList)的顺序表示与实现----线性结构

Redis学习笔记—持久化机制之RDB

986. Interval List Intersections

'coach, I want to play basketball!'—— AI Learning Series booklet for system students

"Coach, I want to play basketball" -- AI Learning Series booklet for students who are making systems
随机推荐
Mysql 数据库入门总结
Unity grid programming 06
Redis学习笔记—单个键管理
MySQL fault case | mysqldump: couldn't execute 'select column_ NAME
C#之Lambda不得不说的用法
Mqtt+flink to subscribe and publish real-time messages
【NanoPi2试用体验】裸机第一步
ARM中常见的英文解释
社区文章|MOSN 构建 Subset 优化思路分享
Redis学习笔记—事务
An idea of using keep alive to cache data in vue3 form pages
Typora设置图片上传服务
16.系统启动流程
Lua的基本使用
Custom tags - JSP tag enhancements
通用分页(1)
@Response
Basic process of code scanning login
1、 Software architecture evaluation
线性表(LinkList)的链式表示和实现----线性结构