diff options
| author | Ulf Lilleengen <[email protected]> | 2022-04-19 14:39:59 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2022-04-19 19:06:36 +0200 |
| commit | e966125d62db32ba4ca7136d96a31d2cb7e7775d (patch) | |
| tree | 903f63818316556770ed4f13ab2d2978d38ce9ba /examples | |
| parent | 00c51c8fd57603a4c0336abda023060671f96f55 (diff) | |
Add embedded-storage trait impls for QSPI
* Adds implementations of embedded-storage and embedded-storage-async
for QSPI
* Add blocking implementations of QSPI
* Use blocking implementation in new() and embedded-storage impls
* Use async implementation in embedded-storage-async impls
* Add FLASH_SIZE const generic parameter
* Own IRQ in Qspi to disable it on drop
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf/src/bin/qspi.rs | 5 | ||||
| -rw-r--r-- | examples/nrf/src/bin/qspi_lowpower.rs | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/examples/nrf/src/bin/qspi.rs b/examples/nrf/src/bin/qspi.rs index ba60716c8..8673b7961 100644 --- a/examples/nrf/src/bin/qspi.rs +++ b/examples/nrf/src/bin/qspi.rs | |||
| @@ -26,10 +26,9 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 26 | config.write_page_size = qspi::WritePageSize::_256BYTES; | 26 | config.write_page_size = qspi::WritePageSize::_256BYTES; |
| 27 | 27 | ||
| 28 | let irq = interrupt::take!(QSPI); | 28 | let irq = interrupt::take!(QSPI); |
| 29 | let mut q = qspi::Qspi::new( | 29 | let mut q: qspi::Qspi<_, 67108864> = qspi::Qspi::new( |
| 30 | p.QSPI, irq, p.P0_19, p.P0_17, p.P0_20, p.P0_21, p.P0_22, p.P0_23, config, | 30 | p.QSPI, irq, p.P0_19, p.P0_17, p.P0_20, p.P0_21, p.P0_22, p.P0_23, config, |
| 31 | ) | 31 | ); |
| 32 | .await; | ||
| 33 | 32 | ||
| 34 | let mut id = [1; 3]; | 33 | let mut id = [1; 3]; |
| 35 | unwrap!(q.custom_instruction(0x9F, &[], &mut id).await); | 34 | unwrap!(q.custom_instruction(0x9F, &[], &mut id).await); |
diff --git a/examples/nrf/src/bin/qspi_lowpower.rs b/examples/nrf/src/bin/qspi_lowpower.rs index a8184cd63..255ce5d5e 100644 --- a/examples/nrf/src/bin/qspi_lowpower.rs +++ b/examples/nrf/src/bin/qspi_lowpower.rs | |||
| @@ -32,7 +32,7 @@ async fn main(_spawner: Spawner, mut p: Peripherals) { | |||
| 32 | exit_time: 3, // tRDP = 35uS | 32 | exit_time: 3, // tRDP = 35uS |
| 33 | }); | 33 | }); |
| 34 | 34 | ||
| 35 | let mut q = qspi::Qspi::new( | 35 | let mut q: qspi::Qspi<_, 67108864> = qspi::Qspi::new( |
| 36 | &mut p.QSPI, | 36 | &mut p.QSPI, |
| 37 | &mut irq, | 37 | &mut irq, |
| 38 | &mut p.P0_19, | 38 | &mut p.P0_19, |
| @@ -42,8 +42,7 @@ async fn main(_spawner: Spawner, mut p: Peripherals) { | |||
| 42 | &mut p.P0_22, | 42 | &mut p.P0_22, |
| 43 | &mut p.P0_23, | 43 | &mut p.P0_23, |
| 44 | config, | 44 | config, |
| 45 | ) | 45 | ); |
| 46 | .await; | ||
| 47 | 46 | ||
| 48 | let mut id = [1; 3]; | 47 | let mut id = [1; 3]; |
| 49 | unwrap!(q.custom_instruction(0x9F, &[], &mut id).await); | 48 | unwrap!(q.custom_instruction(0x9F, &[], &mut id).await); |
