Skip to content
Merged
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
32 changes: 18 additions & 14 deletions documentation/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ A. Devicetree node: `/zephyr,user`
- **Type:** `io-channels` phandle-array specifiers
- **Meaning:** Declares the ADC controller/channel specifiers used by ArduinoCore-Zephyr.
- **Affects:** ADC channel provisioning (ADC availability).
- **Precedence:** primary/required provisioning source for ADC behavior.
- **Notes:** Without provisioning, ADC is considered unsupported regardless of pin association.
- **Precedence:** higher than connector `io-channel-map` (if present).
- **Notes:** If absent, ADC provisioning may be derived from connector `io-channel-map` (see below).

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states that ADC provisioning falls back to connector io-channel-map when /zephyr,user/io-channels is absent. However, the implementation in cores/arduino/zephyrCommon.cpp (line 293) checks for the presence of adc_pin_gpios, not io_channels. When adc_pin_gpios is present, the code uses io_channels for provisioning (line 294); when adc_pin_gpios is absent, it falls back to the connector's io_channel_map (line 296). This means the documentation should reference adc-pin-gpios as the condition, not io-channels.

Suggested change
- **Notes:** If absent, ADC provisioning may be derived from connector `io-channel-map` (see below).
- **Notes:** If `/zephyr,user/adc-pin-gpios` is absent, ADC provisioning may be derived from connector `io-channel-map` (see below); when `adc-pin-gpios` is present, the entries in `io-channels` are used for ADC provisioning.

Copilot uses AI. Check for mistakes.

#### `pwms`
- **Type:** PWM phandle-array specifiers
- **Meaning:** Declares PWM controller/channel specifiers used by ArduinoCore-Zephyr.
- **Affects:** PWM channel provisioning (PWM availability).
- **Precedence:** primary/required provisioning source for PWM behavior.
- **Notes:** Without provisioning, PWM output is considered unsupported regardless of pin association.
- **Precedence:** higher than connector `pwm-map` (if present).
- **Notes:** If absent, PWM provisioning may be derived from connector `pwm-map` (see below).



Expand All @@ -130,23 +130,27 @@ B. Board devicetree constructs (board-provided defaults)

---

### `io-channel-map` (connector ADC association)
### `io-channel-map` (connector ADC association and provisioning)
- **Location:** connector nexus node (board-defined)
- **Type:** nexus mapping (`io-channel-map`, `io-channel-map-mask`, `io-channel-map-pass-thru`, …)
- **Meaning:** Board-defined ADC pin association through connector mapping.
- **Affects:** ADC association when `/zephyr,user/adc-pin-gpios` is absent.
- **Precedence:** lower than `/zephyr,user/adc-pin-gpios`.
- **Notes:** Association only; ADC provisioning still requires `/zephyr,user/io-channels`.
- **Meaning:** Board-defined ADC pin association and provisioning through connector mapping.
- **Affects:**
- ADC pin association when `/zephyr,user/adc-pin-gpios` is absent.
- ADC channel provisioning when `/zephyr,user/io-channels` is absent.
- **Precedence:** lower than `/zephyr,user/adc-pin-gpios` (for association) and `/zephyr,user/io-channels` (for provisioning).
- **Notes:** When `/zephyr,user/io-channels` is absent, ADC channels are provisioned directly from this connector map.
Comment on lines +139 to +141

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states that when /zephyr,user/io-channels is absent, ADC channels are provisioned from the connector map. However, the implementation in cores/arduino/zephyrCommon.cpp (line 293) actually checks for adc_pin_gpios, not io_channels. The fallback to connector's io_channel_map happens when adc_pin_gpios is absent, regardless of whether io_channels is present or not. This should reference adc-pin-gpios as the condition.

Suggested change
- ADC channel provisioning when `/zephyr,user/io-channels` is absent.
- **Precedence:** lower than `/zephyr,user/adc-pin-gpios` (for association) and `/zephyr,user/io-channels` (for provisioning).
- **Notes:** When `/zephyr,user/io-channels` is absent, ADC channels are provisioned directly from this connector map.
- ADC channel provisioning when `/zephyr,user/adc-pin-gpios` is absent.
- **Precedence:** lower than `/zephyr,user/adc-pin-gpios` (for both association and provisioning).
- **Notes:** When `/zephyr,user/adc-pin-gpios` is absent, ADC channels are provisioned directly from this connector map, regardless of whether `/zephyr,user/io-channels` is present.

Copilot uses AI. Check for mistakes.
Comment on lines +139 to +141

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The precedence statement is inconsistent with the implementation. The code checks for adc_pin_gpios presence to determine which path to take, not io_channels. When adc_pin_gpios is present, io_channels is used for provisioning. When adc_pin_gpios is absent, the connector's io_channel_map provides both association and provisioning. The precedence for provisioning should be documented relative to adc-pin-gpios presence, not just io-channels presence.

Suggested change
- ADC channel provisioning when `/zephyr,user/io-channels` is absent.
- **Precedence:** lower than `/zephyr,user/adc-pin-gpios` (for association) and `/zephyr,user/io-channels` (for provisioning).
- **Notes:** When `/zephyr,user/io-channels` is absent, ADC channels are provisioned directly from this connector map.
- ADC channel provisioning:
- when `/zephyr,user/adc-pin-gpios` is present, provisioning comes from `/zephyr,user/io-channels`;
- when `/zephyr,user/adc-pin-gpios` is absent, this connector map provides both association and provisioning (regardless of `/zephyr,user/io-channels`).
- **Precedence:**
- For association, lower than `/zephyr,user/adc-pin-gpios`.
- For provisioning, this connector map is used only when `/zephyr,user/adc-pin-gpios` is absent; in that case it takes precedence over `/zephyr,user/io-channels`.
- **Notes:** When `/zephyr,user/adc-pin-gpios` is absent, ADC channels are provisioned directly from this connector map, and any `/zephyr,user/io-channels` entries are not used for those ADC pins.

Copilot uses AI. Check for mistakes.

---

### `pwm-map` (connector PWM association)
### `pwm-map` (connector PWM association and provisioning)
- **Location:** connector nexus node (board-defined)
- **Type:** nexus mapping (`pwm-map`, `pwm-map-mask`, `pwm-map-pass-thru`, …)
- **Meaning:** Board-defined PWM pin association through connector mapping.
- **Affects:** PWM association when `/zephyr,user/pwm-pin-gpios` is absent.
- **Precedence:** lower than `/zephyr,user/pwm-pin-gpios`.
- **Notes:** Association only; PWM provisioning still requires `/zephyr,user/pwms`.
- **Meaning:** Board-defined PWM pin association and provisioning through connector mapping.
- **Affects:**
- PWM pin association when `/zephyr,user/pwm-pin-gpios` is absent.
- PWM channel provisioning when `/zephyr,user/pwms` is absent.
- **Precedence:** lower than `/zephyr,user/pwm-pin-gpios` (for association) and `/zephyr,user/pwms` (for provisioning).
- **Notes:** When `/zephyr,user/pwms` is absent, PWM channels are provisioned directly from this connector map.

---

Expand Down
Loading