hardware_pio: document struct pio_program (#2686)#2967
Open
anoshyn wants to merge 1 commit into
Open
Conversation
struct pio_program is a common parameter throughout the PIO API but had no doxygen, and its fields (origin, pio_version, used_gpio_ranges) are not self-explanatory. Add a brief for the struct and per-member \ref descriptions, including the meaning of the used_gpio_ranges bitmap and the pio_version / GPIO-base compatibility checks. Documentation only; no functional change. Closes raspberrypi#2686.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
struct pio_program/pio_program_tis passed to a large part of the PIO API (pio_add_program,pio_can_add_program, …) but carried no doxygen, and several of its fields aren't self-explanatory —origin,pio_version, and (on PIO v1)used_gpio_ranges. #2686 asks for it to be documented.This adds a
\brieffor the struct plus per-member///<descriptions:instructions/length— the encoded instruction array and its size (also the instruction-memory footprint).origin— required load offset, or-1if relocatable.pio_version— minimum required PIO hardware version (0= any); loading on too-old hardware fails withPICO_ERROR_VERSION_MISMATCH(matches the check inpio.c).used_gpio_ranges— bitmap of 16-pin GPIO ranges the program uses (bit 0 = pins 0-15, bit 1 = 16-31, bit 2 = 32-47), checked against the instance's GPIO base (pio_set_gpio_base). Bit layout and the compatibility rule are taken directly fromis_gpio_compatible()inpio.c.Documentation only — no functional change.
Test plan
hardware_pioon RP2350 (PICO_PIO_VERSION > 0, so theused_gpio_rangesmember is compiled) — header parses cleanly, no warnings from the new comments.\reftargets verified to exist:pio_add_program,pio_can_add_program,pio_set_gpio_base,PICO_ERROR_VERSION_MISMATCH.Closes #2686.