Several sets of i²c buses are detected
[Email protected]:~# i2cdetect-li2c-0i2c OMAP i²c adapter i²c adapteri2c-1i2c OMAP i²c Adapter I²c Adapter[email protected]:~#
Check the online status of the device on each bus:-y means yes,0 represents/dev/i2c-0
[email protected]:~# i2cdetect -y -r 0 0 1 2 3 4 5 6 7 8 9 a b c d e f00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- uu -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: uu -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- [email protected]:~# UU says 0x50 has devices in use at this address.
View the contents of the EEPROM, the following 0 means/dev/i2c-0 bus, 0x50 is the address of the EEPROM
[email protected]:~# i2cdump -f -y 0 0x50no size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   &NBSP, .......... 10: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 20: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 30: ff ff ff ff ff ff ff ff ff ff FF FF FF FF FF FF   &NBSP, .......... 40: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 50: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 60: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 70: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 80: ff ff ff ff ff ff ff ff ff ff ff ff ff  FF FF FF   &NBSP, .......... 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff .......... a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff Ff ff ................e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff .......... f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   &NBSP, .......... [email protected]:~#
Gets/sets the No. 01 byte of data for the 0x24 device of the i2c0-0 bus
[Email protected]:~# i2cget-f-y 0 0x24 [email protected]:~# i2cset-f-y 0 0x24 0xaa #掉电后, the data written is invalid, pending investigation ... [Email protected]:~# i2cget-f-y 0 0x24 01
Beaglebone Black Read Write EEPROM from file, Permanent
[Email protected]:~# dd If=eeprom.bin Of=/sys/bus/i2c/devices/0-0050/eeprom #大约要等5分钟
This article is from the "Li Chunli" blog, make sure to keep this source http://990487026.blog.51cto.com/10133282/1977966
Linux ARM IIC i²c EEPROM Read and write operation