Skip to content

Commit 97ad03a

Browse files
pfzettojannic
authored andcommitted
rp235x-hal: implement ValidSpiPinout for CS pin.
Implements `ValidSpiPinout` trait on `(Tx,Rx,Sck,Cs)` to allow setting the Cs pon of the SPI device.
1 parent c84b2a5 commit 97ad03a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

rp235x-hal/src/spi/pins.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,17 @@ where
138138
type Sck = OptionTSome<Sck>;
139139
type Tx = OptionTSome<Tx>;
140140
}
141+
142+
impl<Spi, Tx, Rx, Sck, Cs> ValidSpiPinout<Spi> for (Tx, Rx, Sck, Cs)
143+
where
144+
Spi: SpiDevice,
145+
Tx: ValidPinTx<Spi>,
146+
Sck: ValidPinSck<Spi>,
147+
Rx: ValidPinRx<Spi>,
148+
Cs: ValidPinCs<Spi>,
149+
{
150+
type Rx = OptionTSome<Rx>;
151+
type Cs = OptionTSome<Cs>;
152+
type Sck = OptionTSome<Sck>;
153+
type Tx = OptionTSome<Tx>;
154+
}

0 commit comments

Comments
 (0)