/usr/local/sbin/i2cget: invalid option -- '-'
Usage: i2cget [-f] [-y] [-a] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE [LENGTH]]]
I2CBUS is an integer or an I2C bus name
ADDRESS is an integer (0x08 - 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)
s (read SMBus block data)
i (read I2C block data)
Append p for SMBus PEC
LENGTH is the I2C block data length (between 1 and 32, default 32)
Options (5)
| Option | Description | Source |
|---|
-V | Display the version and exit. | man |
-h | Display the help and exit. | man |
-f | Force access to the device even if it is already busy. | man |
-y | Disable interactive mode. | man |
-a | Allow using addresses between 0x00 - 0x07 and 0x78 - 0x7f. | man |
Examples (5) from the manual page, untested
i2cget 1 0x2d 0x11
Get the value of 8-bit register 0x11 of the I2C device at 7-bit address 0x2d on bus 1 (i2c-1), after user confirmation:i2cget 1 0x48 0x00 w
Get the value of 16-bit register 0x00 of the I2C device at 7-bit address 0x48 on bus 1 (i2c-1), after user confirmation:i2cset -y 9 0x50 0x00 ; i2cget -y 9 0x50 ; i2cget -y 9 0x50
Set the internal pointer register of a 24C02 EEPROM at 7-bit address 0x50 on bus 9 (i2c-9) to 0x00, then read the first 2 bytes from that EEPROM:i2cset -y 9 0x53 0x00 0x00 ; i2cget -y 9 0x53 ; i2cget -y 9 0x53
Set the internal pointer register of a 24C32 EEPROM at 7-bit address 0x53 on bus 9 (i2c-9) to 0x0000, then read the first 2 bytes from that EEPROM:i2cget -y 4 0x50 0x00 i 8
Read the first 8 bytes of an EEPROM device at 7-bit address 0x50 on bus 4 (i2c-4):
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.