Skip to content

Commit 20a342c

Browse files
soburiDhruvaG2000
authored andcommitted
documentation: Update about digital-pin-gpios
Update the document to follow the change in how to define digital pins. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent a24fbc4 commit 20a342c

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

documentation/variants.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ variants/
5050
### DeviceTree Overlay files for Arduino boards
5151

5252
This module requires that your Arduino header pins be mapped in the DeviceTree
53-
to a `zephyr,user` node using the `d0_gpios` format for each pin. Follow the
53+
to 'digital-pin-gpios' array that child of a `zephyr,user` node. Follow the
5454
examples in the variants directory to create an overlay file and a header file
5555
for your board.
5656

@@ -68,17 +68,18 @@ uses [the Arduino header definitions](https://github.com/zephyrproject-rtos/zeph
6868
```
6969
/ {
7070
zephyr,user {
71-
d0_gpios = <&arduino_header 6 0>; /* Digital */
72-
d1_gpios = <&arduino_header 7 0>;
73-
...
74-
d13_gpios = <&arduino_header 19 0>;
75-
d14_gpios = <&arduino_header 0 0>; /* Analog */
76-
d15_gpios = <&arduino_header 1 0>;
77-
...
78-
d19_gpios = <&arduino_header 5 0>;
79-
d20_gpios = <&arduino_header 20 0>; /* SDA */
80-
d21_gpios = <&arduino_header 21 0>; /* SCL */
81-
d22_gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; /* LED0 */
71+
digital-pin-gpios = <&arduino_header 6 0>, /* Digital */
72+
<&arduino_header 7 0>;
73+
...
74+
<&arduino_header 19 0>;
75+
<&arduino_header 0 0>; /* Analog */
76+
<&arduino_header 1 0>;
77+
...
78+
<&arduino_header 5 0>;
79+
<&arduino_header 20 0>; /* SDA */
80+
<&arduino_header 21 0>; /* SCL */
81+
<&gpio0 13 GPIO_ACTIVE_LOW>; /* LED0 */
82+
};
8283
};
8384
};
8485
```

variants/variants.h

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
? 1 \
2525
: 0)
2626

27+
/* Check all pins are defined only once */
2728
#define DIGITAL_PIN_CHECK_UNIQUE(i, _) \
2829
((DT_FOREACH_PROP_ELEM_SEP_VARGS( \
2930
DT_PATH(zephyr_user), digital_pin_gpios, DIGITAL_PIN_EXISTS, (+), \

0 commit comments

Comments
 (0)