Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.5k
rp2/rp2_pio: Fix PIO support for pin wrapping and RP2350B upper-bank pins.#18343
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Code size report: |
@Gadgetoid@sfe-SparkFro@maholli Are any of you able to test if this resolves the issue? |
Thanks! Did |
It should be just as it was, only with upper-range GPIO pins now fully functional. |
Doh, my mistake! Was building for the Pico 2, which is not the RP2350B, so Can confirm that this works with the RP2350B! |
Uh oh!
There was an error while loading.Please reload this page.
Summary
The existing public pico-sdk API methods for
pio_sm_set_pins_with_mask/pio_sm_set_pindirs_with_mask, including the 64-bit variants, do not allow PIO "pin wrapping", i.e. using[30, 31, 0, 1]or[46, 47, 16, 17]as contiguous pin ranges for a PIO program, despite the documented support for this in the underlying hardware.This patch exposes the internal method that the existing 32- and 64-bit versions of these functions call to in order to skip the way the wrappers "helpfully" perform truncated bit-shifts on their arguments, and uses it to also resolve the outstanding issue with using upper-bank RP2350B pins for PIO.
Resolves:#16199
Closes:#16985
Testing
This still needs to be tested with real RP2350B hardware, not just the more common RP2350A --- as this is a key area where these two chips are different. At the moment I do not have suitable hardware to test on.