Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@
DT_STRING_UPPER_TOKEN_BY_IDX(node, compatible, 0), _PIN_NAME_A_)), num)

#define ZARD_CHECK_GPIO_CTLR(node_id) \
COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_controller), (node_id,), ())
COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_controller), \
(COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(node_id), (node_id,), ())), ())

#define ZARD_ALL_GPIO_CTLR DT_FOREACH_NODE(ZARD_CHECK_GPIO_CTLR)

Expand Down
3 changes: 2 additions & 1 deletion cores/arduino/zephyrCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ static constexpr struct gpio_dt_spec arduino_pins[] = {DT_FOREACH_PROP_ELEM_SEP(

#define GET_GPIO_NGPIOS(node_id) \
COND_CODE_1(DT_NODE_HAS_PROP(node_id, gpio_controller), \
(DT_PROP_OR(node_id, ngpios, 0),), ())
(COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(node_id), \
(DT_PROP_OR(node_id, ngpios, 0),), (0,))), ())

static constexpr const struct device *gpio_ports[] = {DT_FOREACH_NODE(GET_GPIO_DEVICES)};
static constexpr uint32_t gpio_ngpios[] = {DT_FOREACH_NODE(GET_GPIO_NGPIOS)};
Expand Down
2 changes: 1 addition & 1 deletion documentation/configuration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This guide targets Level 4, which supports standard Arduino functions.
A well-configured board DTS typically includes:

- An Arduino-compatible connector definition,
labeled as `arduino_header` (or other supported connectors)
labeled as `arduino_header` (`compatible = "arduino-header-r3"`)
- Optionally, connector mapping nodes for PWM/ADC pin association and channel derivation (commonly `arduino_pwm` and `arduino_adc`)
- Bus defaults via node labels such as `arduino_serial`, `arduino_i2c`, `arduino_spi`
- A built-in LED via the `led0` alias (recommended)
Expand Down
Loading