aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp/src/spi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-rp/src/spi.rs')
-rw-r--r--embassy-rp/src/spi.rs27
1 files changed, 26 insertions, 1 deletions
diff --git a/embassy-rp/src/spi.rs b/embassy-rp/src/spi.rs
index 559b3b909..39f128214 100644
--- a/embassy-rp/src/spi.rs
+++ b/embassy-rp/src/spi.rs
@@ -157,7 +157,7 @@ impl<'d, T: Instance, M: Mode> Spi<'d, T, M> {
157 157
158 /// Private function to apply SPI configuration (phase, polarity, frequency) settings. 158 /// Private function to apply SPI configuration (phase, polarity, frequency) settings.
159 /// 159 ///
160 /// Driver should be disabled before making changes and reenabled after the modifications 160 /// Driver should be disabled before making changes and re-enabled after the modifications
161 /// are applied. 161 /// are applied.
162 fn apply_config(inner: &Peri<'d, T>, config: &Config) { 162 fn apply_config(inner: &Peri<'d, T>, config: &Config) {
163 let p = inner.regs(); 163 let p = inner.regs();
@@ -308,6 +308,11 @@ impl<'d, T: Instance> Spi<'d, T, Blocking> {
308 ) 308 )
309 } 309 }
310 310
311 /// Create an SPI driver in blocking mode supporting writes only, without SCK pin.
312 pub fn new_blocking_txonly_nosck(inner: Peri<'d, T>, mosi: Peri<'d, impl MosiPin<T> + 'd>, config: Config) -> Self {
313 Self::new_inner(inner, None, Some(mosi.into()), None, None, None, None, config)
314 }
315
311 /// Create an SPI driver in blocking mode supporting reads only. 316 /// Create an SPI driver in blocking mode supporting reads only.
312 pub fn new_blocking_rxonly( 317 pub fn new_blocking_rxonly(
313 inner: Peri<'d, T>, 318 inner: Peri<'d, T>,
@@ -371,6 +376,26 @@ impl<'d, T: Instance> Spi<'d, T, Async> {
371 ) 376 )
372 } 377 }
373 378
379 /// Create an SPI driver in async mode supporting DMA write operations only,
380 /// without SCK pin.
381 pub fn new_txonly_nosck(
382 inner: Peri<'d, T>,
383 mosi: Peri<'d, impl MosiPin<T> + 'd>,
384 tx_dma: Peri<'d, impl Channel>,
385 config: Config,
386 ) -> Self {
387 Self::new_inner(
388 inner,
389 None,
390 Some(mosi.into()),
391 None,
392 None,
393 Some(tx_dma.into()),
394 None,
395 config,
396 )
397 }
398
374 /// Create an SPI driver in async mode supporting DMA read operations only. 399 /// Create an SPI driver in async mode supporting DMA read operations only.
375 pub fn new_rxonly( 400 pub fn new_rxonly(
376 inner: Peri<'d, T>, 401 inner: Peri<'d, T>,