Skip to content

Conversation

kartben
Copy link
Contributor

@kartben kartben commented Sep 2, 2025

Document Arduino MKR, ST Morpho etc. so as to have them conveniently visible in the API reference

https://builds.zephyrproject.io/zephyr/pr/95349/docs/doxygen/html/group__devicetree-gpio-pin-headers.html

This builds on top of #95320 as I basically realized it would be nice to have all GPIO nexuses showing up in the docs. I will rebase once the other PR is merged but would appreciate feedback on everything but the first 3 commits in this PR.

Add doxygen documentation for this header.

Signed-off-by: Benjamin Cabé <[email protected]>
Add doxygen documentation for this header.
Also fix typo for ARDUINO_NANO_HEADER_A5.

Signed-off-by: Benjamin Cabé <[email protected]>
Add doxygen documentation for this header.

Signed-off-by: Benjamin Cabé <[email protected]>
Add doxygen documentation for this header.

Signed-off-by: Benjamin Cabé <[email protected]>
Add doxygen documentation for this header.

Signed-off-by: Benjamin Cabé <[email protected]>
For all GPIO headers/connectors, add a short mention of the header file
that can be used to access pin numbers macros.

Signed-off-by: Benjamin Cabé <[email protected]>
@kartben kartben force-pushed the document_all_gpio_headers_ branch from 5f805e0 to f2e4c37 Compare September 4, 2025 14:45
@kartben kartben requested review from pillo79 and mniestroj and removed request for yasinustunerg and mathieuchopstm September 4, 2025 14:50
Copy link

sonarqubecloud bot commented Sep 4, 2025

Copy link
Contributor

@pillo79 pillo79 left a comment

Choose a reason for hiding this comment

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

LGTM and thanks! Since we're making this more visible, I would take the opportunity to add a note to the Uno R3 layout that mentions something along those lines:

Usually Arduino pins are numbered starting from the digital pins, and the analog pins follow. Note the sequence here instead starts from the analog pins, so D0 == 6.

(unfortunate choice when it was added; not sure we can switch now without breaking compatibility).

@kartben
Copy link
Contributor Author

kartben commented Sep 4, 2025

LGTM and thanks! Since we're making this more visible, I would take the opportunity to add a note to the Uno R3 layout that mentions something along those lines:

Usually Arduino pins are numbered starting from the digital pins, and the analog pins follow. Note the sequence here instead starts from the analog pins, so D0 == 6.

(unfortunate choice when it was added; not sure we can switch now without breaking compatibility).

I think I might be missing your point. Isn't the whole point of now having macros that folks won't really have to worry about the underlying actual value, and hence why we clearly encourage folks to use the constants? https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/bindings/gpio/arduino-header-r3.yaml#L47-L48

@kartben kartben merged commit af2eaf4 into zephyrproject-rtos:main Sep 4, 2025
28 checks passed
@kartben kartben deleted the document_all_gpio_headers_ branch September 4, 2025 19:09
@pillo79
Copy link
Contributor

pillo79 commented Sep 5, 2025

LGTM and thanks! Since we're making this more visible, I would take the opportunity to add a note to the Uno R3 layout that mentions something along those lines:

Usually Arduino pins are numbered starting from the digital pins, and the analog pins follow. Note the sequence here instead starts from the analog pins, so D0 == 6.

(unfortunate choice when it was added; not sure we can switch now without breaking compatibility).

I think I might be missing your point. Isn't the whole point of now having macros that folks won't really have to worry about the underlying actual value, and hence why we clearly encourage folks to use the constants? https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/bindings/gpio/arduino-header-r3.yaml#L47-L48

Sure, but Arduino users have been trained to numbers unfortunately, so it is extremely tempting for people interested in the Arduino connectors to try using them anyway. I was pointing out that while other connectors happen to match with our standard numbering, arduino-header-r3 does not. (And that choice was made 5 years before the macros, so downstream will break if we change it. 🙁)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants