aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/spi
diff options
context:
space:
mode:
authorJoël Schulz-Ansres <[email protected]>2024-05-15 14:12:44 +0200
committerJoël Schulz-Ansres <[email protected]>2024-05-15 14:12:44 +0200
commitcc6998be30856d05a4a6a975f35fd0e5df2ea807 (patch)
treecefa81c230da45b7e6227f971c5540de03a720d4 /embassy-stm32/src/spi
parentdb56c4fe6fb919e89edda37fc5acb2fb05f45745 (diff)
Cargo format
Diffstat (limited to 'embassy-stm32/src/spi')
-rw-r--r--embassy-stm32/src/spi/mod.rs27
1 files changed, 18 insertions, 9 deletions
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs
index bcd6b0bf4..76d58def6 100644
--- a/embassy-stm32/src/spi/mod.rs
+++ b/embassy-stm32/src/spi/mod.rs
@@ -283,11 +283,12 @@ impl<'d, T: Instance, M: PeriMode> Spi<'d, T, M> {
283 283
284 let miso_pullup = match &self.miso { 284 let miso_pullup = match &self.miso {
285 None => false, 285 None => false,
286 Some(pin) => 286 Some(pin) => {
287 if pin.pull() == Pull::Up { 287 if pin.pull() == Pull::Up {
288 true 288 true
289 } else { 289 } else {
290 false 290 false
291 }
291 } 292 }
292 }; 293 };
293 294
@@ -426,11 +427,15 @@ impl<'d, T: Instance> Spi<'d, T, Blocking> {
426 peri, 427 peri,
427 new_pin!(sck, AFType::OutputPushPull, Speed::VeryHigh, config.sck_pull_mode()), 428 new_pin!(sck, AFType::OutputPushPull, Speed::VeryHigh, config.sck_pull_mode()),
428 new_pin!(mosi, AFType::OutputPushPull, Speed::VeryHigh), 429 new_pin!(mosi, AFType::OutputPushPull, Speed::VeryHigh),
429 new_pin!(miso, AFType::Input, Speed::Input, 430 new_pin!(
431 miso,
432 AFType::Input,
433 Speed::Input,
430 match config.miso_pullup { 434 match config.miso_pullup {
431 true => Pull::Up, 435 true => Pull::Up,
432 false => Pull::None, 436 false => Pull::None,
433 }), 437 }
438 ),
434 None, 439 None,
435 None, 440 None,
436 config, 441 config,
@@ -448,11 +453,15 @@ impl<'d, T: Instance> Spi<'d, T, Blocking> {
448 peri, 453 peri,
449 new_pin!(sck, AFType::OutputPushPull, Speed::VeryHigh, config.sck_pull_mode()), 454 new_pin!(sck, AFType::OutputPushPull, Speed::VeryHigh, config.sck_pull_mode()),
450 None, 455 None,
451 new_pin!(miso, AFType::Input, Speed::Input, 456 new_pin!(
457 miso,
458 AFType::Input,
459 Speed::Input,
452 match config.miso_pullup { 460 match config.miso_pullup {
453 true => Pull::Up, 461 true => Pull::Up,
454 false => Pull::None, 462 false => Pull::None,
455 }), 463 }
464 ),
456 None, 465 None,
457 None, 466 None,
458 config, 467 config,