GPIO
来源:互联网 发布:js获取单选框是否选中 编辑:程序博客网 时间:2024/06/13 06:01
GPIO引脚控制
硬件:一般有控制器,控制引脚是输入 输出 中断功能。
DATA控制寄存器,是输出 0 还是 1.
user manual:
GPFDAT bits[0-7]
When the port is configured as an input port, the corresponding bit is the
pin state. When the port is configured as an output port, the pin state is
the same as the corresponding bit.
When the port is configured as functional pin, the undefined value will be
read
If GPF0–GPF7 will be used for wake-up signals at power down mode, the ports will be set in interrupt mode.
#define GPFC (*(volatile unsigned long *)0x56000050)
#define GPFDAT (*(volatile unsigned long *)0x56000054)
#define GPF4 (1<<8) //configure the bits 8 bit9 8 01 output bit 8 equal 1
#define GPF5 (1<<(5*2)) 配置GPIOF 4 5 6 引脚 配置bit8 10 12 位
#define GPF6 (1<<(6*2))
在配置data寄存器
wait(3000);
//GPFDAT = (~(1<<4)); // 根据i的值,点亮LED1,2,4
wait(6000);
GPFDAT = (~(1<<5)); 把每个bit位 配置 都是把1<<5,就是配置bit5,~为0
/*wait(9000); (0<<5) 这样是行不通的
GPFDAT = (~(1<<6));
*/
- gpio
- gpio
- GPIO
- GPIO
- GPIO
- GPIO
- GPIO
- GPIO
- GPIO
- GPIO
- GPIO
- gpio
- GPIO
- gpio
- GPIO
- gpio
- GPIO
- gpio
- 学会如何使用一个新的模块
- AndroidStudio2.3 导入环信IM 3.x Demo
- Android Resource相关
- 高精度运算--进制转换.POJ.1120
- C#解析 居委会的 XML 文件方法
- GPIO
- 高光谱图像中的目标检测(一)
- Mybatis自定义二级缓存-下
- LeetCode算法题——Palindrome Number
- eclipse环境下配置黑色主题 非代码区
- 动态规划
- C#多线程
- Oracle千万条记录插入与查询小结
- mysql 使用过程中遇到的错误