diff --git a/embassy-nrf/src/spis.rs b/embassy-nrf/src/spis.rs index e202c6c27..16ac82e5f 100644 --- a/embassy-nrf/src/spis.rs +++ b/embassy-nrf/src/spis.rs @@ -105,7 +105,7 @@ impl<'d, T: Instance> Spis<'d, T> { Self::new_inner( spis, cs.map_into(), - sck.map_into(), + Some(sck.map_into()), Some(miso.map_into()), Some(mosi.map_into()), config, @@ -122,7 +122,14 @@ impl<'d, T: Instance> Spis<'d, T> { config: Config, ) -> Self { into_ref!(cs, sck, miso); - Self::new_inner(spis, cs.map_into(), sck.map_into(), Some(miso.map_into()), None, config) + Self::new_inner( + spis, + cs.map_into(), + Some(sck.map_into()), + Some(miso.map_into()), + None, + config, + ) } /// Create a new SPIS driver, capable of RX only (MOSI only). @@ -135,13 +142,32 @@ impl<'d, T: Instance> Spis<'d, T> { config: Config, ) -> Self { into_ref!(cs, sck, mosi); - Self::new_inner(spis, cs.map_into(), sck.map_into(), None, Some(mosi.map_into()), config) + Self::new_inner( + spis, + cs.map_into(), + Some(sck.map_into()), + None, + Some(mosi.map_into()), + config, + ) + } + + /// Create a new SPIS driver, capable of TX only (MISO only) without SCK pin. + pub fn new_txonly_nosck( + spis: impl Peripheral
+ 'd,
+ _irq: impl interrupt::typelevel::Binding + 'd,
+ miso: impl Peripheral + 'd,
+ config: Config,
+ ) -> Self {
+ into_ref!(cs, miso);
+ Self::new_inner(spis, cs.map_into(), None, Some(miso.map_into()), None, config)
}
fn new_inner(
spis: impl Peripheral + 'd,
cs: PeripheralRef<'d, AnyPin>,
- sck: PeripheralRef<'d, AnyPin>,
+ sck: Option