|
|
(2 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| <!-- Set release according to "release" parameter in URL and use RELEASE_SUMO_V1.0_VAR-SOM-MX8 as default
| | #REDIRECT [[LINUX-I2C]] |
| --> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
| |
| --> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_SUMO_V1.0_VAR-SOM-MX8}}}} <!--
| |
| --> {{PageHeader|{{#var:HARDWARE_NAME}} I2C}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME}}}} __toc__
| |
| | |
| = Available I2C buses =
| |
| {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X |
| |
| List available I2C buses:
| |
| <pre>
| |
| # ls -l /dev/i2c-*
| |
| crw------- 1 root root 89, 0 Jul 4 09:09 /dev/i2c-0
| |
| crw------- 1 root root 89, 1 Jul 4 09:09 /dev/i2c-1
| |
| crw------- 1 root root 89, 2 Jul 4 09:09 /dev/i2c-2
| |
| </pre>
| |
| |
| |
| List available I2C buses on VAR-SOM-MX8
| |
| <pre>
| |
| # ls -l /dev/i2c-*
| |
| crw------- 1 root root 89, 0 Jun 12 12:43 /dev/i2c-0
| |
| crw------- 1 root root 89, 1 Jun 12 12:43 /dev/i2c-1
| |
| crw------- 1 root root 89, 4 Jun 12 12:43 /dev/i2c-4
| |
| </pre>
| |
| | |
| <br>List available I2C buses on SPEAR-MX8
| |
| <pre>
| |
| # ls -l /dev/i2c-*
| |
| crw------- 1 root root 89, 0 Jul 16 12:22 /dev/i2c-0
| |
| crw------- 1 root root 89, 1 Jul 16 12:22 /dev/i2c-1
| |
| crw------- 1 root root 89, 2 Jul 16 12:22 /dev/i2c-2
| |
| crw------- 1 root root 89, 4 Jul 16 12:22 /dev/i2c-4
| |
| crw------- 1 root root 89, 5 Jul 16 12:22 /dev/i2c-5
| |
| crw------- 1 root root 89, 6 Jul 16 12:22 /dev/i2c-6
| |
| </pre>
| |
| }}
| |
| | |
| {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X |
| |
| System class:
| |
| <pre>
| |
| # ls /sys/class/i2c-dev/
| |
| i2c-0 i2c-1 i2c-2
| |
| </pre>
| |
| |
| |
| System class on VAR-SOM-MX8:
| |
| <pre>
| |
| # ls /sys/class/i2c-dev/
| |
| i2c-0 i2c-1 i2c-4
| |
| </pre>
| |
| | |
| <br> System class on SPEAR-MX8:
| |
| <pre>
| |
| # ls /sys/class/i2c-dev/
| |
| i2c-0 i2c-1 i2c-2 i2c-4 i2c-5 i2c-6
| |
| </pre>
| |
| }}
| |
| | |
| = I2C devices per bus =
| |
| {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X |
| |
| Scan bus 0:
| |
| <pre>
| |
| # i2cdetect -y -r 0
| |
| 0 1 2 3 4 5 6 7 8 9 a b c d e f
| |
| 00: -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
| |
| 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 50: -- -- 52 53 -- -- -- -- -- -- -- -- -- -- -- --
| |
| 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 70: -- -- -- -- -- -- -- --
| |
| </pre>
| |
| Scan bus 1:
| |
| <pre>
| |
| # i2cdetect -y -r 1
| |
| 0 1 2 3 4 5 6 7 8 9 a b c d e f
| |
| 00: -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 30: -- -- -- -- -- -- -- -- -- -- -- -- -- UU -- --
| |
| 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 70: -- -- -- -- -- -- -- --
| |
| </pre>
| |
| Scan bus 2:
| |
| <pre>
| |
| # i2cdetect -y -r 2
| |
| 0 1 2 3 4 5 6 7 8 9 a b c d e f
| |
| 00: -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 30: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
| |
| 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 50: -- -- -- -- 54 55 -- -- -- -- -- -- -- -- -- --
| |
| 60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
| |
| 70: -- -- -- -- -- -- -- --
| |
| </pre>
| |
| |
| |
| Scan bus 0:
| |
| <pre>
| |
| # i2cdetect -y -r 0 | |
| 0 1 2 3 4 5 6 7 8 9 a b c d e f
| |
| 00: -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
| |
| 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 50: -- -- 52 53 -- -- -- -- -- -- -- -- -- -- -- --
| |
| 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 70: -- -- -- -- -- -- -- --
| |
| </pre>
| |
| Scan bus 1:
| |
| <pre>
| |
| # i2cdetect -y -r 1
| |
| 0 1 2 3 4 5 6 7 8 9 a b c d e f
| |
| 00: -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 30: -- -- -- -- -- -- -- -- -- -- -- -- UU UU -- --
| |
| 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 70: -- -- -- -- -- -- -- --
| |
| </pre>
| |
| Scan bus 4:
| |
| <pre>
| |
| # i2cdetect -y -r 4
| |
| 0 1 2 3 4 5 6 7 8 9 a b c d e f
| |
| 00: -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 30: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
| |
| 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| |
| 50: -- -- -- -- 54 55 -- -- -- -- -- -- -- -- -- --
| |
| 60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
| |
| 70: -- -- -- -- -- -- -- --
| |
| </pre>
| |
| }}
| |
|
| |
| = Reading / Writing from an I2C device=
| |
| Variscite includes I2CTools as a part of the default file system build, examples of optional commands: <br>
| |
| i2cdump - dump the content of an I2C device <br>
| |
| i2cset - write a single character to an I2C device<br>
| |
| i2cget - read a single character to an I2C device.<br>
| |
| <br>
| |
| In addition follow 'C' code example as describe in the Linux kernel documentation: https://www.kernel.org/doc/Documentation/i2c/dev-interface
| |
| | |
| = Variscite system integrated I2C devices =
| |
| {{note|Note: Don't manipulate Variscite on-SOM EEPROM, or you will damage the SOM!|info}}
| |
| When the device is marked with "UU" it means that a driver is using it.
| |
| <br/>When the device is marked with numbers it means that no driver is using it.
| |
| | |
| {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X |
| |
| <br>Variscite devices:
| |
| <pre>
| |
| I2C-0 0x1a - Audio codec on SOM
| |
| I2C-0 0x52 - EEPROM on SOM. Don't modify!
| |
| I2C-0 0x53 - EEPROM on SOM. Don't modify!
| |
| | |
| I2C-1 0x20 – GPIO expander on carrier board
| |
| I2C-1 0x3c – MIPI-CSI camera on expansion board
| |
| I2C-1 0x3d – USB Type C controller on carrier board
| |
| | |
| I2C-2 0x38 – Capacitive touch controller on carrier board
| |
| I2C-2 0x54 - EEPROM on carrier board
| |
| I2C-2 0x55 - EEPROM on carrier board
| |
| I2C-2 0x68 – RTC on carrier board
| |
| </pre>
| |
| |
| |
| <br>Variscite devices on VAR-SOM-MX8:
| |
| <pre>
| |
| I2C-0 0x1a - Audio codec on SOM
| |
| I2C-0 0x52 - EEPROM on SOM. Don't modify!
| |
| I2C-0 0x53 - EEPROM on SOM. Don't modify!
| |
| | |
| I2C-1 0x20 – GPIO expander on carrier board
| |
| I2C-1 0x3c – MIPI-CSI camera on expansion board
| |
| I2C-1 0x3d – USB Type C controller on carrier board | |
| | |
| I2C-4 0x38 – Capacitive touch controller on kit display
| |
| I2C-4 0x54 - EEPROM on carrier board
| |
| I2C-4 0x55 - EEPROM on carrier board
| |
| I2C-4 0x68 – RTC on carrier board
| |
| </pre>
| |
| | |
| <br>Variscite devices on SPEAR-MX8:
| |
| <pre>
| |
| I2C-0 0x38 – Capacitive touch controller on kit display
| |
| I2C-0 0x54 - EEPROM on carrier board
| |
| I2C-0 0x55 - EEPROM on carrier board
| |
| I2C-0 0x68 – RTC on carrier board
| |
| | |
| I2C-1 0x3d – USB Type C controller on carrier board
| |
| | |
| I2C-2 0x08 – USB3 Hub
| |
| | |
| I2C-4 0x1a - Audio codec on SOM
| |
| | |
| I2C-5 0x3c – MIPI-CSI camera on expansion board
| |
| | |
| I2C-6 0x3c – MIPI-CSI camera on expansion board
| |
| | |
| </pre>
| |
| | |
| }}
| |