Linux command
i2cget 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Read
i2cget [i2cbus] [device_address] [register_address]
Example
i2cget -y [i2cbus] [device_address] [register_address]
Example
i2cget [i2cbus] [device_address] [register_address] [b|w|c|s|i]
说明
i2cget reads a single register value from an I2C device. This is useful for checking specific device configuration or status registers without dumping the entire register map. All addresses should be specified in hexadecimal notation. The i2cbus number identifies which I2C bus to use, and the device address specifies which device on that bus to communicate with.
参数
- -y
- Disable interactive confirmation (dangerous on some hardware)
- b
- Byte mode - read single byte (default)
- w
- Word mode - read 16-bit value
- c
- Consecutive byte mode
- s
- SMBus block mode
- i
- I2C block mode
FAQ
What is the i2cget command used for?
i2cget reads a single register value from an I2C device. This is useful for checking specific device configuration or status registers without dumping the entire register map. All addresses should be specified in hexadecimal notation. The i2cbus number identifies which I2C bus to use, and the device address specifies which device on that bus to communicate with.
How do I run a basic i2cget example?
Run `i2cget [i2cbus] [device_address] [register_address]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -y do in i2cget?
Disable interactive confirmation (dangerous on some hardware)