Usage: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST] i2cdetect -F I2CBUS(i2c总线编号) i2cdetect -l I2CBUS is an integer or an I2C bus name If provided, FIRST and LAST limit the probing range. -y:关闭交互式,不会显示警告信息(指令执行自动yes,否则会提示确认执行Continue? [Y/n] Y,不加参数y会有很多执行提示,可以帮助判断) -a:扫描总线上所有设备(输出总线上所有地址(00-7f),没有 -a,只显示 03-77) -q:使用SMBus的"quick write"命令进行检测,不建议使用(快速写指令) -r:使用SMBus的"receive byte"命令进行检测,不建议使用(读指令) -q和-r不能同时使用 i2cbus:指定查询某个总线编号 first、last:扫描的地址范围
i2cdetect -l 列出我们系统目前使用了几组i2c总线,格式为
1 2
i2cdetect -l i2c-0 i2c rk3x-i2c
i2cdetect -V
打印使用的i2c-tools版本
i2cdetect -F I2CBUS
查询总线支持的功能
i2cdetect [-y/-a/-r] I2CBUS
查询总线上使用的设备地址
--表示这个地址被检测到,但是没有芯片应答;
UU表示这个地址被内核驱动使用
数字表示这个地址被芯片使用并应答
i2cdump
i2cdump读取设备上所有寄存器的值
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Usage: i2cdump [-f] [-y] [-r first-last] I2CBUS ADDRESS [MODE [BANK [BANKREG]]] I2CBUS is an integer or an I2C bus name ADDRESS is an integer (0x03 - 0x77) MODE(读方式) is one of: b (byte, default) w (word) W (word on even register addresses) s (SMBus block) i (I2C block) c (consecutive byte) Append p for SMBus PEC
Usage: i2cget [-f] [-y] [-a] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]] I2CBUS is an integer or an I2C bus name ADDRESS is an integer (0x03 - 0x77, or 0x00 - 0x7f if -a is given) MODE is one of: b (read byte data, default) w (read word data) c (write byte/read byte) Append p for SMBus PEC -f:同i2cdetect -y:同i2cdetect -a:允许使用0x00-0x02和0x78-0x7f之间的地址
Usage: i2cset [-f] [-y] [-m MASK] [-r] [-a] I2CBUS CHIP-ADDRESS DATA-ADDRESS [VALUE] ... [MODE] I2CBUS is an integer or an I2C bus name ADDRESS is an integer (0x03 - 0x77, or 0x00 - 0x7f if -a is given) MODE is one of: c (byte, no value) b (byte data, default) w (word data) i (I2C block data) s (SMBus block data) Append p for SMBus PEC