Skip to content

Commit 5f83853

Browse files
committed
documentation: Add document about i2cs
Add a description for `i2cs` Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
1 parent d09e429 commit 5f83853

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

documentation/variants.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,27 @@ uses [the Arduino header definitions](https://github.com/zephyrproject-rtos/zeph
8383
};
8484
```
8585

86+
### Configure I2C devices
87+
88+
The `i2cs` node defines the I2C devices to use.
89+
It instantiate the `Wire` with the i2c device that contained in the node.
90+
Also instantiate as `Wire1`, `Wire2`, .. `WireN` with the devices
91+
that is after the second in the case of the array contains plural devices.
92+
93+
If the `i2cs` node is not defined, Use the node labeled `arduino-i2c`.
94+
Boards with Arduino-shield style connectors usually label `arduino-i2c`
95+
to i2c exposed in the connector.
96+
97+
The following example instantiates `Wire` and `Wire2` with each `i2c0` and `i2c1`.
98+
99+
```
100+
/ {
101+
zephyr,user {
102+
i2cs = <&i2c0, &i2c1>;
103+
};
104+
};
105+
```
106+
86107
### Overlays from scratch
87108

88109
You can see in the example above that there is no mapping for `LED0` in the

0 commit comments

Comments
 (0)