diff options
Diffstat (limited to 'embassy-rp')
| -rw-r--r-- | embassy-rp/src/pio_programs/spi.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/embassy-rp/src/pio_programs/spi.rs b/embassy-rp/src/pio_programs/spi.rs index 6b97cd0f3..b10fc6628 100644 --- a/embassy-rp/src/pio_programs/spi.rs +++ b/embassy-rp/src/pio_programs/spi.rs | |||
| @@ -121,10 +121,6 @@ impl<'d, PIO: Instance, const SM: usize, M: Mode> Spi<'d, PIO, SM, M> { | |||
| 121 | clk_pin.set_output_inversion(false); | 121 | clk_pin.set_output_inversion(false); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | sm.set_pins(Level::Low, &[&clk_pin, &mosi_pin]); | ||
| 125 | sm.set_pin_dirs(Direction::Out, &[&clk_pin, &mosi_pin]); | ||
| 126 | sm.set_pin_dirs(Direction::In, &[&miso_pin]); | ||
| 127 | |||
| 128 | let mut cfg = crate::pio::Config::default(); | 124 | let mut cfg = crate::pio::Config::default(); |
| 129 | 125 | ||
| 130 | cfg.use_program(&program.prg, &[&clk_pin]); | 126 | cfg.use_program(&program.prg, &[&clk_pin]); |
| @@ -142,6 +138,11 @@ impl<'d, PIO: Instance, const SM: usize, M: Mode> Spi<'d, PIO, SM, M> { | |||
| 142 | cfg.clock_divider = calculate_clock_divider(config.frequency); | 138 | cfg.clock_divider = calculate_clock_divider(config.frequency); |
| 143 | 139 | ||
| 144 | sm.set_config(&cfg); | 140 | sm.set_config(&cfg); |
| 141 | |||
| 142 | sm.set_pins(Level::Low, &[&clk_pin, &mosi_pin]); | ||
| 143 | sm.set_pin_dirs(Direction::Out, &[&clk_pin, &mosi_pin]); | ||
| 144 | sm.set_pin_dirs(Direction::In, &[&miso_pin]); | ||
| 145 | |||
| 145 | sm.set_enable(true); | 146 | sm.set_enable(true); |
| 146 | 147 | ||
| 147 | Self { | 148 | Self { |
