drivers/periph/gpio(_ll): Enhance and fix the documentation #21538
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This PR aims to add a little bit of documentation about the
gpio_get_pin_num
andgpio_get_port
, which are not really documented but incredibly important if you want to use a function likegpio_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_codeblockTesting procedure
Make sure the documentation still looks good.
Issues/PRs references
None.