rp2: allow SPI transmit-only without SDI#5437
Open
rdon-key wants to merge 2 commits into
Open
Conversation
eliasnaur
reviewed
May 30, 2026
Contributor
eliasnaur
left a comment
There was a problem hiding this comment.
LGTM, but why not do the same for SDO?
Contributor
Author
|
@eliasnaur I limited this PR to SDI=NoPin because I could verify the transmit-only case on real hardware with a MAX7219 LED matrix. I don't currently have a concrete use case or hardware test setup for SDO=NoPin. If there is a common receive-only SPI use case, I would appreciate a pointer and can look into it as a follow-up. |
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.
This allows SPI transmit-only configurations on RP2040/RP2350 with SDI set to machine.NoPin.
The RP2040/RP2350 SPI implementation already supports transmit-only SPI through spi.Tx(tx, nil), where only SDO is used and received data is ignored. However, Configure still required SDI to be a valid physical pin. As a result, SDI: machine.NoPin returned invalid SPI SDI pin, even for transmit-only SPI.
This change keeps SCK and SDO validation unchanged, allows SDI: machine.NoPin, and skips SDI pin configuration when NoPin is used.
This PR intentionally only covers the transmit-only case. It does not change SDO handling.
Testing
Tested on Raspberry Pi Pico / RP2040:
Tested on Raspberry Pi Pico 2 / RP2350A:
test code
RP2040 version:
Details
RP2350 version:
Details