Skip to content

drivers/periph/gpio(_ll): Enhance and fix the documentation #21538

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

Merged
merged 2 commits into from
Jun 4, 2025

Conversation

crasbe
Copy link
Contributor

@crasbe crasbe commented Jun 4, 2025

Contribution description

This PR aims to add a little bit of documentation about the gpio_get_pin_num and gpio_get_port, which are not really documented but incredibly important if you want to use a function like gpio_ll_init.

The issue first came up during the development of #21332, because the nRF52 microcontrollers don't actually distinguish between port P0 and P1 internally, there are just 32 registers for the pins and P1 has the fifth bit set in the pin number (Mask 0x1F).
Therefore, if you try to initialize a P1 pin with gpio_ll_init and just naively use numbers for the pins, you will actually modify the pins on P0.
It just came up in our seminar again, therefore I decided to finally add some documentation.

Also I fixed the documentation for gpio_irq_enable, which was accidentally rendered as a code block instead of text. See: https://www.doxygen.nl/manual/markdown.html#md_codeblock

image

Testing procedure

Make sure the documentation still looks good.

Issues/PRs references

None.

@crasbe crasbe requested a review from MrKevinWeiss as a code owner June 4, 2025 14:10
@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Jun 4, 2025
@github-actions github-actions bot added the Area: drivers Area: Device drivers label Jun 4, 2025
@riot-ci
Copy link

riot-ci commented Jun 4, 2025

Murdock results

✔️ PASSED

6210aff drivers/gpio: fix doc for gpio_irq_enable

Success Failures Total Runtime
1 0 1 01m:30s

Artifacts

@maribu
Copy link
Member

maribu commented Jun 4, 2025

Only needs a rebase to get in

@crasbe
Copy link
Contributor Author

crasbe commented Jun 4, 2025

Doxygen did not recognize the function references in the General section. 🤔

@maribu maribu enabled auto-merge June 4, 2025 16:26
@maribu maribu disabled auto-merge June 4, 2025 16:26
@crasbe
Copy link
Contributor Author

crasbe commented Jun 4, 2025

Now I'm happy. Can I squash?

@maribu
Copy link
Member

maribu commented Jun 4, 2025

Yes, sure

@crasbe crasbe enabled auto-merge June 4, 2025 19:12
@crasbe crasbe added this pull request to the merge queue Jun 4, 2025
Merged via the queue into RIOT-OS:master with commit 268e2fc Jun 4, 2025
25 checks passed
@crasbe crasbe deleted the pr/gpio_ll_doc branch June 5, 2025 13:51
@Teufelchen1 Teufelchen1 added this to the Release 2025.07 milestone Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants