Skip to content

Support RP2350B parallel high GPIO pins - #57

Merged
soypat merged 1 commit into
tinygo-org:mainfrom
davecheney:davecheney-parallel-gpiobase-support
Sep 10, 2026
Merged

soypat merged 1 commit into
tinygo-org:mainfrom
davecheney:davecheney-parallel-gpiobase-support

Conversation

@davecheney

Copy link
Copy Markdown
Contributor

Fixes #56; unlocks Tufty2350 support

Map physical GPIO pins to the correct PIO-relative GPIOBASE window before claiming resources in NewParallel, so the parallel bus can drive data lines above GPIO31 on RP2350B (e.g. Pimoroni Tufty 2350 using pico-plus2: WR on GPIO30, DB0..DB7 on GPIO32..GPIO39).

RP2040 and low-GPIO RP2350 behavior is preserved unchanged (GPIOBASE 0). RP2350 layouts spanning incompatible GPIOBASE windows, or exceeding the supported GPIO range, are rejected. Physical machine pins are configured with their original numbers; PIO pin masks and state-machine OUT/SIDESET bases use the mapped relative numbers. Target-specific pin mapping lives in build-tagged
parallel_pins_rp2040.go and parallel_pins_rp2350.go so RP2040 does not reference the RP2350-only SetGPIOBase method.

Also validate BusWidth == 0 before evaluating BitsPerPull % BusWidth, so invalid zero-width input returns an error instead of panicking.

Map physical GPIO pins to the correct PIO-relative GPIOBASE window
before claiming resources in NewParallel, so the parallel bus can
drive data lines above GPIO31 on RP2350B (e.g. Pimoroni Tufty 2350
using pico-plus2: WR on GPIO30, DB0..DB7 on GPIO32..GPIO39).

RP2040 and low-GPIO RP2350 behavior is preserved unchanged (GPIOBASE
0). RP2350 layouts spanning incompatible GPIOBASE windows, or
exceeding the supported GPIO range, are rejected. Physical machine
pins are configured with their original numbers; PIO pin masks and
state-machine OUT/SIDESET bases use the mapped relative numbers.
Target-specific pin mapping lives in build-tagged
parallel_pins_rp2040.go and parallel_pins_rp2350.go so RP2040 does not
reference the RP2350-only SetGPIOBase method.

Also validate BusWidth == 0 before evaluating BitsPerPull % BusWidth,
so invalid zero-width input returns an error instead of panicking.
@soypat
soypat merged commit 6982692 into tinygo-org:main Sep 10, 2026
1 check passed
@davecheney
davecheney deleted the davecheney-parallel-gpiobase-support branch September 10, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

piolib: support RP2350B PIO GPIOBASE for high GPIO pins

2 participants