QUERY · ISSUE
RP2 SPI: Instantiating with spi=None does not behave sensibly.
bugport-rp2
The constructor accepts None as an arg to miso, but still instantiates the default pin.
The clear intent is to create an output-only interface. Either it should reject the arg or (preferably) it should not instantiate a pin. Current behaviour can lead to unexpected pin conflicts.
This should also apply to mosi.
CANDIDATE · PULL REQUEST
rp2/spi: Allow omitting of unused pins
port-rp2
Summary
The change makes it possible to omit unused SPI pins.
This can be achieved by setting a pin as None.
Testing
The change as been tested on a custom RP2040 board with only SCK and MOSI used to drive a SPI IC.
Trade-offs and Alternatives
The commit changes behavior if the constructor method.
Previously if a pin was set as None the default pin number for this interface has been used.