diff options
Diffstat (limited to 'embassy-rp/src/spi.rs')
| -rw-r--r-- | embassy-rp/src/spi.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/embassy-rp/src/spi.rs b/embassy-rp/src/spi.rs index d9410e78d..39f128214 100644 --- a/embassy-rp/src/spi.rs +++ b/embassy-rp/src/spi.rs | |||
| @@ -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>, |
