aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src
diff options
context:
space:
mode:
authorHaobo Gu <[email protected]>2024-10-26 23:41:30 +0800
committerHaobo Gu <[email protected]>2024-10-26 23:41:46 +0800
commitca6bcb4250fc294c2294265fbc83bf00398e089c (patch)
tree2ccf678f98307e381fb17abdc615b7877f49eef1 /embassy-stm32/src
parent7b62d70d184ca9e8e7c6864d6ed39b4e8f75f02f (diff)
feat(ospi): add ospi example
Signed-off-by: Haobo Gu <[email protected]>
Diffstat (limited to 'embassy-stm32/src')
-rw-r--r--embassy-stm32/src/ospi/mod.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/embassy-stm32/src/ospi/mod.rs b/embassy-stm32/src/ospi/mod.rs
index 7ccafe361..f8ef66216 100644
--- a/embassy-stm32/src/ospi/mod.rs
+++ b/embassy-stm32/src/ospi/mod.rs
@@ -180,7 +180,7 @@ pub struct Ospi<'d, T: Instance, M: PeriMode> {
180 180
181impl<'d, T: Instance, M: PeriMode> Ospi<'d, T, M> { 181impl<'d, T: Instance, M: PeriMode> Ospi<'d, T, M> {
182 /// Enter memory mode. 182 /// Enter memory mode.
183 /// The Input `TransferConfig` is used to configure the read operation in memory mode 183 /// The Input `read_config` is used to configure the read operation in memory mode
184 pub fn enable_memory_mapped_mode( 184 pub fn enable_memory_mapped_mode(
185 &mut self, 185 &mut self,
186 read_config: TransferConfig, 186 read_config: TransferConfig,
@@ -190,9 +190,7 @@ impl<'d, T: Instance, M: PeriMode> Ospi<'d, T, M> {
190 self.configure_command(&read_config, None)?; 190 self.configure_command(&read_config, None)?;
191 191
192 let reg = T::REGS; 192 let reg = T::REGS;
193 while reg.sr().read().busy() { 193 while reg.sr().read().busy() {}
194 info!("wait ospi busy");
195 }
196 194
197 reg.ccr().modify(|r| { 195 reg.ccr().modify(|r| {
198 r.set_dqse(false); 196 r.set_dqse(false);
@@ -229,9 +227,6 @@ impl<'d, T: Instance, M: PeriMode> Ospi<'d, T, M> {
229 /// Quit from memory mapped mode 227 /// Quit from memory mapped mode
230 pub fn disable_memory_mapped_mode(&mut self) { 228 pub fn disable_memory_mapped_mode(&mut self) {
231 let reg = T::REGS; 229 let reg = T::REGS;
232 while reg.sr().read().busy() {
233 info!("wait ospi busy");
234 }
235 230
236 reg.cr().modify(|r| { 231 reg.cr().modify(|r| {
237 r.set_fmode(crate::ospi::vals::FunctionalMode::INDIRECTWRITE); 232 r.set_fmode(crate::ospi::vals::FunctionalMode::INDIRECTWRITE);