官网站内推广内容,国外浏览器搜索引擎入口,工商登记信息查询平台,某服装企业网站建设方案目录 1、理解GPIO的开漏#xff08;OD#xff09;和开集#xff08;OC#xff09; 2、查询io寄存器地址及定义 3、配置可调寄存器接口dev/mem author daisy.skye的博客_CSDN博客-嵌入式,Qt,Linux领域博主 daisy.skye_嵌入式,Linux,Qt-CSDN博客daisy.skye擅长嵌入式,Linux,Q… 目录 1、理解GPIO的开漏OD和开集OC 2、查询io寄存器地址及定义 3、配置可调寄存器接口dev/mem author daisy.skye的博客_CSDN博客-嵌入式,Qt,Linux领域博主 daisy.skye_嵌入式,Linux,Qt-CSDN博客daisy.skye擅长嵌入式,Linux,Qt,等方面的知识https://blog.csdn.net/qq_40715266?typeblog 1、理解GPIO的开漏OD和开集OC 参考链接GPIO口有关上拉电阻和下拉电阻推挽输出开漏OD和开集OC 实测中遇到的是i2c问题但是uart或者电平转换芯片都会遇到首先保证外部是否有1k电阻的上拉当然具体的电阻可以自行进行调节其次需要满足开漏模式的输出OD。 2、查询io寄存器地址及定义 根据原理图的地址查询rk3568的手册得到gpio的OD配置及地址 主要是为了后续能够进行io操作指令对具体gpio的寄存器值进行改写测试 3116位电平要求与150一致才能写使能生效 GRF_GPIO4B_OPD Address: Operational Base offset (0x0134) 根据当前参数的章节找到隶属于3.7SYS_GRF 后就找到了基地址 3.7 SYS_GRF Register Description 3.7.1 Registers Summary 基地址SYS_GRF 0xFDC60000 0xFDC60000 0x0134 0xFDC60134 3、配置可调寄存器接口dev/mem makefile kernel/drivers/char/Makefile obj-$(CONFIG_DEVMEM) mem.o config kernel/arch/arm64/configs/rockchip_defconfig CONFIG_DEVMEMy CONFIG_STRICT_DEVMEMn CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWEDn mem.c 驱动 drivers/char/mem.c // #ifdef CONFIG_DEVMEM // [1] { mem, 0, mem_fops, FMODE_UNSIGNED_OFFSET }, // #endif 单独编译boot.img uboot编译$ cd u-boot $ ./make.sh rk3568 kernel编译单编 boot.img 同步骤$ cd .. $ cd kernel $ make ARCHarm64 rockchip_evb3568_v2b_defconfig $ ./mk_kernel.sh ido-evb3568-v2b-dsi0-mipi.img 1|rk3568_r:/ # ls -l /dev/mem
crw------- 1 media media 1, 1 2023-12-01 21:13 /dev/mem
1|rk3568_r:/ # io
Raw memory i/o utility - $Revision: 1.5 $io -v -1|2|4 -r|w [-l len] [-f file] addr [value] -v Verbose, asks for confirmation-1|2|4 Sets memory access size in bytes (default byte)-l len Length in bytes of area to access (defaults toone access, or whole file length)-r|w Read from or Write to memory (default read)-f file File to write on memory read, orto read on memory writeaddr The memory address to accessval The value to write (implies -w)Examples:io 0x1000 Reads one byte from 0x1000io 0x1000 0x12 Writes 0x12 to location 0x1000io -2 -l 8 0x1000 Reads 8 words from 0x1000io -r -f dmp -l 100 200 Reads 100 bytes from addr 200 to fileio -w -f img 0x10000 Writes the whole of file to memoryNote access size (-1|2|4) does not apply to file based accesses.1|rk3568_r:/ # io -4 -l 0x30 0xFDC60000
open /dev/mem: No such file or directory
rk3568_r:/ # io -4 -w 0xFDC60134 0x040004
rk3568_r:/ # io -4 -r 0xFDC60134#0x040004