树莓派 IO 驱动

1.寄存器:

翻阅【树莓派博通BCM2835芯片手册】第6章(89页):
The GPIO has 41 registers. All accesses are assumed to be 32-bit.

Address(总线地址) FieldName Description Size Read/Write
0x 7E20 0000 GPFSEL0 GPIO Function Select 0 32 R/W
0x 7E20 0000 GPFSEL0 GPIO Function Select 0 32 R/W
0x 7E20 0004 GPFSEL1 GPIO Function Select 1 32 R/W
0x 7E20 0008 GPFSEL2 GPIO Function Select 2 32 R/W
0x 7E20 000C GPFSEL3 GPIO Function Select 3 32 R/W
0x 7E20 0010 GPFSEL4 GPIO Function Select 4 32 R/W
0x 7E20 0014 GPFSEL5 GPIO Function Select 5 32 R/W
0x 7E20 0018 - Reserved - -
0x 7E20 001C GPSET0 GPIO Pin Output Set 0 32 W
0x 7E20 0020 GPSET1 GPIO Pin Output Set 1 32 W
0x 7E20 0024 - Reserved - -
0x 7E20 0028 GPCLR0 GPIO Pin Output Clear 0 32 W
0x 7E20 002C GPCLR1 GPIO Pin Output Clear 1 32 W
0x 7E20 0030 - Reserved - -
0x 7E20 0034 GPLEV0 GPIO Pin Level 0 32 R
0x 7E20 0038 GPLEV1 GPIO Pin Level 1 32 R
0x 7E20 003C - Reserved - -
0x 7E20 0040 GPEDS0 GPIO Pin Event Detect Status 0 32 R/W
0x 7E20 0044 GPEDS1 GPIO Pin Event Detect Status 1 32 R/W
0x 7E20 0048 - Reserved - -
0x 7E20 004C GPREN0 GPIO Pin Rising Edge Detect Enable 0 32 R/W
0x 7E20 0050 GPREN1 GPIO Pin Rising Edge Detect Enable 1 32 R/W
0x 7E20 0054 - Reserved - -
0x 7E20 0058 GPFEN0 GPIO Pin Falling Edge Detect Enable 0 32 R/W
0x 7E20 005C GPFEN1 GPIO Pin Falling Edge Detect Enable 1 32 R/W
0x 7E20 0060 - Reserved - -
0x 7E20 0064 GPHEN0 GPIO Pin High Detect Enable 0 32 R/W
0x 7E20 0068 GPHEN1 GPIO Pin High Detect Enable 1 32 R/W
0x 7E20 006C - Reserved - -
0x 7E20 0070 GPLEN0 GPIO Pin Low Detect Enable 0 32 R/W
0x 7E20 0074 GPLEN1 GPIO Pin Low Detect Enable 1 32 R/W
0x 7E20 0078 - Reserved - -
0x 7E20 007C GPAREN0 GPIO Pin Async. Rising Edge Detect 0 32 R/W
0x 7E20 0080 GPAREN1 GPIO Pin Async. Rising Edge Detect 1 32 R/W
0x 7E20 0084 - Reserved - -
0x 7E20 0088 GPAFEN0 GPIO Pin Async. Falling Edge Detect 0 32 R/W
0x 7E20 008C GPAFEN1 GPIO Pin Async. Falling Edge Detect 1 32 R/W
0x 7E20 0090 - Reserved - -
0x 7E20 0094 GPPUD GPIO Pin Pull-up/down Enable 32 R/W
0x 7E20 0098 GPPUDCLK0 GPIO Pin Pull-up/down Enable Clock 0 32 R/W
0x 7E20 009C GPPUDCLK1 GPIO Pin Pull-up/down Enable Clock 1 32 R/W
0x 7E20 00A0 - Reserved - -
0x 7E20 00B0 - Test 4 R/W

2.寄存器类型:

(1)GPFSEL:GPIO Function Select Registers(功能选择寄存器)

翻阅【树莓派博通BCM2835芯片手册】第6章(91页):
在这里插入图片描述
在这里插入图片描述
此处 FSEL0 ~ FSEL9 表示引脚 0 ~ 9
此处表示操控 FSEL0 ~ FSEL9(引脚 0 ~ 9)则要操控寄存器 GPFSEL0 的 bit(s)0 ~ bit(s)29,按照手册以此类推

(2)GPSET:GPIO Pin Output
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

~莘莘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值