@@ -503,7 +503,12 @@ impl<SPI: Instance, W: Word> Inner<SPI, W> {
503
503
self . spi . cr1 ( ) . modify ( |_, w| w. spe ( ) . enabled ( ) ) ;
504
504
}
505
505
506
- /// Enable SPI
506
+ #[ inline]
507
+ pub fn start_transfer ( & self ) {
508
+ self . spi . cr1 ( ) . modify ( |_, w| w. cstart ( ) . started ( ) ) ;
509
+ }
510
+
511
+ /// Disable SPI
507
512
fn disable ( & mut self ) {
508
513
self . spi . cr1 ( ) . modify ( |_, w| w. spe ( ) . disabled ( ) ) ;
509
514
}
@@ -583,13 +588,13 @@ impl<SPI: Instance, W: Word> Inner<SPI, W> {
583
588
/// Disable DMA for both Rx and Tx
584
589
#[ inline]
585
590
pub fn enable_tx_dma ( & self ) {
586
- self . spi . cfg1 ( ) . modify ( |_, w| w. txdmaen ( ) . disabled ( ) ) ;
591
+ self . spi . cfg1 ( ) . modify ( |_, w| w. txdmaen ( ) . enabled ( ) ) ;
587
592
}
588
593
589
594
/// Disable DMA for both Rx and Tx
590
595
#[ inline]
591
596
pub fn enable_rx_dma ( & self ) {
592
- self . spi . cfg1 ( ) . modify ( |_, w| w. rxdmaen ( ) . disabled ( ) ) ;
597
+ self . spi . cfg1 ( ) . modify ( |_, w| w. rxdmaen ( ) . enabled ( ) ) ;
593
598
}
594
599
595
600
/// Disable DMA for both Rx and Tx
@@ -598,11 +603,6 @@ impl<SPI: Instance, W: Word> Inner<SPI, W> {
598
603
self . spi . cfg1 ( ) . modify ( |_, w| w. rxdmaen ( ) . disabled ( ) . txdmaen ( ) . disabled ( ) ) ;
599
604
}
600
605
601
- #[ inline]
602
- pub fn start_transfer ( & self ) {
603
- self . spi . cr1 ( ) . modify ( |_, w| w. cstart ( ) . started ( ) ) ;
604
- }
605
-
606
606
/// Read a single word from the receive data register
607
607
#[ inline( always) ]
608
608
fn read_data_reg ( & mut self ) -> W {
0 commit comments