diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-12-17 23:04:31 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-12-17 23:04:31 +0000 |
| commit | 341036a8b865609767fbf9015b482ea70ed4f23f (patch) | |
| tree | 47e7659bd47c28f4c08eece5eeda08b137e49a47 | |
| parent | 0c245892c6812538f4f51b784ed8afa1ce47f25d (diff) | |
| parent | bafcdedebe1b94a9eb35a397553ee9ecab237080 (diff) | |
Merge pull request #3661 from esden/fix-ospi-n-qspi-command-naming-convention
stm32/(o|q)spi: command naming convention fix
| -rw-r--r-- | embassy-stm32/src/ospi/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/qspi/mod.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/qspi.rs | 4 | ||||
| -rw-r--r-- | examples/stm32h7b0/src/bin/ospi_memory_mapped.rs | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/embassy-stm32/src/ospi/mod.rs b/embassy-stm32/src/ospi/mod.rs index f8ef66216..38217a9a4 100644 --- a/embassy-stm32/src/ospi/mod.rs +++ b/embassy-stm32/src/ospi/mod.rs | |||
| @@ -520,7 +520,7 @@ impl<'d, T: Instance, M: PeriMode> Ospi<'d, T, M> { | |||
| 520 | } | 520 | } |
| 521 | 521 | ||
| 522 | /// Function used to control or configure the target device without data transfer | 522 | /// Function used to control or configure the target device without data transfer |
| 523 | pub async fn command(&mut self, command: &TransferConfig) -> Result<(), OspiError> { | 523 | pub fn blocking_command(&mut self, command: &TransferConfig) -> Result<(), OspiError> { |
| 524 | // Wait for peripheral to be free | 524 | // Wait for peripheral to be free |
| 525 | while T::REGS.sr().read().busy() {} | 525 | while T::REGS.sr().read().busy() {} |
| 526 | 526 | ||
diff --git a/embassy-stm32/src/qspi/mod.rs b/embassy-stm32/src/qspi/mod.rs index 49836aa57..0c65d0556 100644 --- a/embassy-stm32/src/qspi/mod.rs +++ b/embassy-stm32/src/qspi/mod.rs | |||
| @@ -148,7 +148,7 @@ impl<'d, T: Instance, M: PeriMode> Qspi<'d, T, M> { | |||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | /// Do a QSPI command. | 150 | /// Do a QSPI command. |
| 151 | pub fn command(&mut self, transaction: TransferConfig) { | 151 | pub fn blocking_command(&mut self, transaction: TransferConfig) { |
| 152 | #[cfg(not(stm32h7))] | 152 | #[cfg(not(stm32h7))] |
| 153 | T::REGS.cr().modify(|v| v.set_dmaen(false)); | 153 | T::REGS.cr().modify(|v| v.set_dmaen(false)); |
| 154 | self.setup_transaction(QspiMode::IndirectWrite, &transaction, None); | 154 | self.setup_transaction(QspiMode::IndirectWrite, &transaction, None); |
diff --git a/examples/stm32f7/src/bin/qspi.rs b/examples/stm32f7/src/bin/qspi.rs index 90d319b7a..bd3287964 100644 --- a/examples/stm32f7/src/bin/qspi.rs +++ b/examples/stm32f7/src/bin/qspi.rs | |||
| @@ -72,7 +72,7 @@ impl<I: Instance> FlashMemory<I> { | |||
| 72 | address: None, | 72 | address: None, |
| 73 | dummy: DummyCycles::_0, | 73 | dummy: DummyCycles::_0, |
| 74 | }; | 74 | }; |
| 75 | self.qspi.command(transaction); | 75 | self.qspi.blocking_command(transaction); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | pub fn reset_memory(&mut self) { | 78 | pub fn reset_memory(&mut self) { |
| @@ -143,7 +143,7 @@ impl<I: Instance> FlashMemory<I> { | |||
| 143 | dummy: DummyCycles::_0, | 143 | dummy: DummyCycles::_0, |
| 144 | }; | 144 | }; |
| 145 | self.enable_write(); | 145 | self.enable_write(); |
| 146 | self.qspi.command(transaction); | 146 | self.qspi.blocking_command(transaction); |
| 147 | self.wait_write_finish(); | 147 | self.wait_write_finish(); |
| 148 | } | 148 | } |
| 149 | 149 | ||
diff --git a/examples/stm32h7b0/src/bin/ospi_memory_mapped.rs b/examples/stm32h7b0/src/bin/ospi_memory_mapped.rs index 9c397e507..dffb740a9 100644 --- a/examples/stm32h7b0/src/bin/ospi_memory_mapped.rs +++ b/examples/stm32h7b0/src/bin/ospi_memory_mapped.rs | |||
| @@ -223,7 +223,7 @@ impl<I: Instance> FlashMemory<I> { | |||
| 223 | dummy: DummyCycles::_0, | 223 | dummy: DummyCycles::_0, |
| 224 | ..Default::default() | 224 | ..Default::default() |
| 225 | }; | 225 | }; |
| 226 | self.ospi.command(&transaction).await.unwrap(); | 226 | self.ospi.blocking_command(&transaction).unwrap(); |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | async fn exec_command(&mut self, cmd: u8) { | 229 | async fn exec_command(&mut self, cmd: u8) { |
| @@ -238,7 +238,7 @@ impl<I: Instance> FlashMemory<I> { | |||
| 238 | ..Default::default() | 238 | ..Default::default() |
| 239 | }; | 239 | }; |
| 240 | // info!("Excuting command: {:x}", transaction.instruction); | 240 | // info!("Excuting command: {:x}", transaction.instruction); |
| 241 | self.ospi.command(&transaction).await.unwrap(); | 241 | self.ospi.blocking_command(&transaction).unwrap(); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | pub async fn reset_memory(&mut self) { | 244 | pub async fn reset_memory(&mut self) { |
| @@ -318,7 +318,7 @@ impl<I: Instance> FlashMemory<I> { | |||
| 318 | ..Default::default() | 318 | ..Default::default() |
| 319 | }; | 319 | }; |
| 320 | self.enable_write().await; | 320 | self.enable_write().await; |
| 321 | self.ospi.command(&transaction).await.unwrap(); | 321 | self.ospi.blocking_command(&transaction).unwrap(); |
| 322 | self.wait_write_finish(); | 322 | self.wait_write_finish(); |
| 323 | } | 323 | } |
| 324 | 324 | ||
