aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/src/qspi/mod.rs51
1 files changed, 27 insertions, 24 deletions
diff --git a/embassy-stm32/src/qspi/mod.rs b/embassy-stm32/src/qspi/mod.rs
index c0cd216f0..0ed661115 100644
--- a/embassy-stm32/src/qspi/mod.rs
+++ b/embassy-stm32/src/qspi/mod.rs
@@ -62,6 +62,8 @@ pub struct Config {
62 pub cs_high_time: ChipSelectHighTime, 62 pub cs_high_time: ChipSelectHighTime,
63 /// Shift sampling point of input data (none, or half-cycle) 63 /// Shift sampling point of input data (none, or half-cycle)
64 pub sample_shifting: SampleShifting, 64 pub sample_shifting: SampleShifting,
65 /// GPIO Speed
66 pub gpio_speed: Speed,
65} 67}
66 68
67impl Default for Config { 69impl Default for Config {
@@ -73,6 +75,7 @@ impl Default for Config {
73 fifo_threshold: FIFOThresholdLevel::_17Bytes, 75 fifo_threshold: FIFOThresholdLevel::_17Bytes,
74 cs_high_time: ChipSelectHighTime::_5Cycle, 76 cs_high_time: ChipSelectHighTime::_5Cycle,
75 sample_shifting: SampleShifting::None, 77 sample_shifting: SampleShifting::None,
78 gpio_speed: Speed::VeryHigh,
76 } 79 }
77 } 80 }
78} 81}
@@ -286,14 +289,14 @@ impl<'d, T: Instance> Qspi<'d, T, Blocking> {
286 ) -> Self { 289 ) -> Self {
287 Self::new_inner( 290 Self::new_inner(
288 peri, 291 peri,
289 new_pin!(d0, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 292 new_pin!(d0, AfType::output(OutputType::PushPull, config.gpio_speed)),
290 new_pin!(d1, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 293 new_pin!(d1, AfType::output(OutputType::PushPull, config.gpio_speed)),
291 new_pin!(d2, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 294 new_pin!(d2, AfType::output(OutputType::PushPull, config.gpio_speed)),
292 new_pin!(d3, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 295 new_pin!(d3, AfType::output(OutputType::PushPull, config.gpio_speed)),
293 new_pin!(sck, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 296 new_pin!(sck, AfType::output(OutputType::PushPull, config.gpio_speed)),
294 new_pin!( 297 new_pin!(
295 nss, 298 nss,
296 AfType::output_pull(OutputType::PushPull, Speed::VeryHigh, Pull::Up) 299 AfType::output_pull(OutputType::PushPull, config.gpio_speed, Pull::Up)
297 ), 300 ),
298 None, 301 None,
299 config, 302 config,
@@ -314,14 +317,14 @@ impl<'d, T: Instance> Qspi<'d, T, Blocking> {
314 ) -> Self { 317 ) -> Self {
315 Self::new_inner( 318 Self::new_inner(
316 peri, 319 peri,
317 new_pin!(d0, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 320 new_pin!(d0, AfType::output(OutputType::PushPull, config.gpio_speed)),
318 new_pin!(d1, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 321 new_pin!(d1, AfType::output(OutputType::PushPull, config.gpio_speed)),
319 new_pin!(d2, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 322 new_pin!(d2, AfType::output(OutputType::PushPull, config.gpio_speed)),
320 new_pin!(d3, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 323 new_pin!(d3, AfType::output(OutputType::PushPull, config.gpio_speed)),
321 new_pin!(sck, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 324 new_pin!(sck, AfType::output(OutputType::PushPull, config.gpio_speed)),
322 new_pin!( 325 new_pin!(
323 nss, 326 nss,
324 AfType::output_pull(OutputType::PushPull, Speed::VeryHigh, Pull::Up) 327 AfType::output_pull(OutputType::PushPull, config.gpio_speed, Pull::Up)
325 ), 328 ),
326 None, 329 None,
327 config, 330 config,
@@ -345,14 +348,14 @@ impl<'d, T: Instance> Qspi<'d, T, Async> {
345 ) -> Self { 348 ) -> Self {
346 Self::new_inner( 349 Self::new_inner(
347 peri, 350 peri,
348 new_pin!(d0, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 351 new_pin!(d0, AfType::output(OutputType::PushPull, config.gpio_speed)),
349 new_pin!(d1, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 352 new_pin!(d1, AfType::output(OutputType::PushPull, config.gpio_speed)),
350 new_pin!(d2, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 353 new_pin!(d2, AfType::output(OutputType::PushPull, config.gpio_speed)),
351 new_pin!(d3, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 354 new_pin!(d3, AfType::output(OutputType::PushPull, config.gpio_speed)),
352 new_pin!(sck, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 355 new_pin!(sck, AfType::output(OutputType::PushPull, config.gpio_speed)),
353 new_pin!( 356 new_pin!(
354 nss, 357 nss,
355 AfType::output_pull(OutputType::PushPull, Speed::VeryHigh, Pull::Up) 358 AfType::output_pull(OutputType::PushPull, config.gpio_speed, Pull::Up)
356 ), 359 ),
357 new_dma!(dma), 360 new_dma!(dma),
358 config, 361 config,
@@ -374,14 +377,14 @@ impl<'d, T: Instance> Qspi<'d, T, Async> {
374 ) -> Self { 377 ) -> Self {
375 Self::new_inner( 378 Self::new_inner(
376 peri, 379 peri,
377 new_pin!(d0, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 380 new_pin!(d0, AfType::output(OutputType::PushPull, config.gpio_speed)),
378 new_pin!(d1, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 381 new_pin!(d1, AfType::output(OutputType::PushPull, config.gpio_speed)),
379 new_pin!(d2, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 382 new_pin!(d2, AfType::output(OutputType::PushPull, config.gpio_speed)),
380 new_pin!(d3, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 383 new_pin!(d3, AfType::output(OutputType::PushPull, config.gpio_speed)),
381 new_pin!(sck, AfType::output(OutputType::PushPull, Speed::VeryHigh)), 384 new_pin!(sck, AfType::output(OutputType::PushPull, config.gpio_speed)),
382 new_pin!( 385 new_pin!(
383 nss, 386 nss,
384 AfType::output_pull(OutputType::PushPull, Speed::VeryHigh, Pull::Up) 387 AfType::output_pull(OutputType::PushPull, config.gpio_speed, Pull::Up)
385 ), 388 ),
386 new_dma!(dma), 389 new_dma!(dma),
387 config, 390 config,