-
Notifications
You must be signed in to change notification settings - Fork 0
Reconcile connector map documentation with implementation behavior #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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). | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| #### `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). | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -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
|
||||||||||||||||||||||||||||||||||
| - 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
AI
Feb 10, 2026
There was a problem hiding this comment.
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.
| - 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. |
There was a problem hiding this comment.
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-mapwhen/zephyr,user/io-channelsis absent. However, the implementation incores/arduino/zephyrCommon.cpp(line 293) checks for the presence ofadc_pin_gpios, notio_channels. Whenadc_pin_gpiosis present, the code usesio_channelsfor provisioning (line 294); whenadc_pin_gpiosis absent, it falls back to the connector'sio_channel_map(line 296). This means the documentation should referenceadc-pin-gpiosas the condition, notio-channels.