This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:common:applications:gpio:i2c [2022/07/12 04:28] nick |
products:sbc:common:applications:gpio:i2c [2023/11/07 04:51] (current) nick [Enable I2C] |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | This document mainly | + | This page introduces |
===== I2C Information ===== | ===== I2C Information ===== | ||
- | < | + | | |
- | **I2C A** \\ | + | ^ |
- | '' | + | | ::: | ::: | 23(SDA) |
- | '' | + | | ::: |
- | '' | + | | ::: | ::: | 26(SDA) |
- | '' | + | ^ |
- | **I2C B** \\ | + | | ::: | ::: | 23(SDA) |
- | '' | + | | ::: |
- | '' | + | | ::: | ::: | 26(SDA) |
- | '' | + | ^ |
- | '' | + | | ::: | ::: | 23(SDA) |
- | < | + | | ::: |
- | **I2C 3** \\ | + | | ::: | ::: | 26(SDA) |
- | '' | + | ^ VIM1S | |
- | '' | + | | ::: | ::: | 23(SDA) | GPIOD_6 |
- | '' | + | | ::: |
- | '' | + | | ::: | ::: | 26(SDA) |
- | **I2C 4** \\ | + | |
- | '' | + | |
- | '' | + | |
- | '' | + | |
- | '' | + | |
- | <tabbox VIM4> | + | |
- | + | ||
- | ^ | + | |
- | | I2CM A | SCL - PIN25 - GPIOT_20 | + | |
- | | I2CM F | SCL - PIN22 - GPIOY_17 | + | |
- | + | ||
- | </ | + | |
- | ===== Enabel | + | ===== Enable |
In order to use the I2C, you need to enable the I2C function via [[products: | In order to use the I2C, you need to enable the I2C function via [[products: | ||
Line 43: | Line 31: | ||
<tabbox VIM1/ | <tabbox VIM1/ | ||
- | Edit ''/ | + | Edit ''/ |
- | Take VIM3 as an example to enable '' | + | Take VIM3 as an example to enable |
```shell | ```shell | ||
Line 57: | Line 45: | ||
/dev/i2c-3 | /dev/i2c-3 | ||
``` | ``` | ||
+ | |||
+ | <tabbox VIM3 with 5.15 kernel> | ||
+ | |||
+ | Edit ''/ | ||
+ | |||
+ | |||
+ | e.g. To enable '' | ||
+ | |||
+ | ```shell | ||
+ | fdt_overlays=i2c3 | ||
+ | |||
+ | ``` | ||
+ | |||
+ | After reboot, you will see the I2C device node. | ||
+ | |||
+ | <tabbox VIM3L with 5.15 kernel> | ||
+ | |||
+ | Edit ''/ | ||
+ | |||
+ | |||
+ | e.g. To enable '' | ||
+ | |||
+ | ```shell | ||
+ | fdt_overlays=i2c3 | ||
+ | |||
+ | ``` | ||
+ | |||
+ | After reboot, you will see the I2C device node. | ||
<tabbox VIM4> | <tabbox VIM4> | ||
- | Edit ''/ | + | Edit ''/ |
- | e.g. Enable | + | e.g. To enable |
```shell | ```shell | ||
Line 75: | Line 91: | ||
$ ls /dev/i2c-0 | $ ls /dev/i2c-0 | ||
/dev/i2c-0 | /dev/i2c-0 | ||
+ | ``` | ||
+ | |||
+ | <tabbox VIM1S> | ||
+ | |||
+ | Edit ''/ | ||
+ | |||
+ | |||
+ | e.g. To enable '' | ||
+ | |||
+ | ```shell | ||
+ | fdt_overlays=i2cm_e | ||
+ | |||
+ | ``` | ||
+ | |||
+ | After reboot, you will see the I2C device node. | ||
+ | |||
+ | ```shell | ||
+ | $ ls /dev/i2c-4 | ||
+ | /dev/i2c-4 | ||
``` | ``` | ||
</ | </ | ||
+ | |||
+ | ===== I2C Usage ===== | ||
+ | |||
+ | Please check the [[https:// | ||
===== Disable I2C to Use GPIO ===== | ===== Disable I2C to Use GPIO ===== | ||
- | If you want to use normal GPIO instead of I2C, you can remove the I2C node in device tree overlays configration file. | + | If you want to use normal GPIO instead of I2C, you can remove the I2C node in [[products: |