diff options
| -rw-r--r-- | embassy-stm32/src/hspi/mod.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/embassy-stm32/src/hspi/mod.rs b/embassy-stm32/src/hspi/mod.rs index 62bc0e979..3b73062a2 100644 --- a/embassy-stm32/src/hspi/mod.rs +++ b/embassy-stm32/src/hspi/mod.rs | |||
| @@ -116,7 +116,7 @@ pub struct TransferConfig { | |||
| 116 | 116 | ||
| 117 | /// Data width (DMODE) | 117 | /// Data width (DMODE) |
| 118 | pub dwidth: HspiWidth, | 118 | pub dwidth: HspiWidth, |
| 119 | /// Data buffer | 119 | /// Data Double Transfer rate enable |
| 120 | pub ddtr: bool, | 120 | pub ddtr: bool, |
| 121 | 121 | ||
| 122 | /// Number of dummy cycles (DCYC) | 122 | /// Number of dummy cycles (DCYC) |
| @@ -395,11 +395,6 @@ impl<'d, T: Instance, M: PeriMode> Hspi<'d, T, M> { | |||
| 395 | // Configure alternate bytes | 395 | // Configure alternate bytes |
| 396 | if let Some(ab) = command.alternate_bytes { | 396 | if let Some(ab) = command.alternate_bytes { |
| 397 | T::REGS.abr().write(|v| v.set_alternate(ab)); | 397 | T::REGS.abr().write(|v| v.set_alternate(ab)); |
| 398 | T::REGS.ccr().modify(|w| { | ||
| 399 | w.set_abmode(command.abwidth.into()); | ||
| 400 | w.set_abdtr(command.abdtr); | ||
| 401 | w.set_absize(command.absize.into()); | ||
| 402 | }) | ||
| 403 | } | 398 | } |
| 404 | 399 | ||
| 405 | // Configure dummy cycles | 400 | // Configure dummy cycles |
| @@ -411,14 +406,14 @@ impl<'d, T: Instance, M: PeriMode> Hspi<'d, T, M> { | |||
| 411 | if let Some(data_length) = data_len { | 406 | if let Some(data_length) = data_len { |
| 412 | T::REGS.dlr().write(|v| { | 407 | T::REGS.dlr().write(|v| { |
| 413 | v.set_dl((data_length - 1) as u32); | 408 | v.set_dl((data_length - 1) as u32); |
| 414 | }) | 409 | }); |
| 415 | } else { | 410 | } else { |
| 416 | T::REGS.dlr().write(|v| { | 411 | T::REGS.dlr().write(|v| { |
| 417 | v.set_dl((0) as u32); | 412 | v.set_dl((0) as u32); |
| 418 | }) | 413 | }); |
| 419 | } | 414 | } |
| 420 | 415 | ||
| 421 | // Configure instruction/address/data modes | 416 | // Configure instruction/address/alternate bytes/data modes |
| 422 | T::REGS.ccr().modify(|w| { | 417 | T::REGS.ccr().modify(|w| { |
| 423 | w.set_imode(command.iwidth.into()); | 418 | w.set_imode(command.iwidth.into()); |
| 424 | w.set_idtr(command.idtr); | 419 | w.set_idtr(command.idtr); |
| @@ -428,6 +423,10 @@ impl<'d, T: Instance, M: PeriMode> Hspi<'d, T, M> { | |||
| 428 | w.set_addtr(command.addtr); | 423 | w.set_addtr(command.addtr); |
| 429 | w.set_adsize(command.adsize.into()); | 424 | w.set_adsize(command.adsize.into()); |
| 430 | 425 | ||
| 426 | w.set_abmode(command.abwidth.into()); | ||
| 427 | w.set_abdtr(command.abdtr); | ||
| 428 | w.set_absize(command.absize.into()); | ||
| 429 | |||
| 431 | w.set_dmode(command.dwidth.into()); | 430 | w.set_dmode(command.dwidth.into()); |
| 432 | w.set_ddtr(command.ddtr); | 431 | w.set_ddtr(command.ddtr); |
| 433 | }); | 432 | }); |
