diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-03-05 02:55:00 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-03-05 02:55:00 +0100 |
| commit | f7dfc49c5c40d70852d6d3c7313973adf97e4716 (patch) | |
| tree | 098db6120048536095b6b24e775dd62a187bc86f /examples | |
| parent | 8eb8ea617419726915834555266e37568b8504e0 (diff) | |
nrf/qspi: add _raw variants of methods that don't do bounds checks.
Useful for the nRF7002, which presents as a "fake" QSPI flash, and
the "capacity" concept doesn't really apply to it.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf52840/src/bin/qspi.rs | 3 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/qspi_lowpower.rs | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/examples/nrf52840/src/bin/qspi.rs b/examples/nrf52840/src/bin/qspi.rs index be665149a..21a10940d 100644 --- a/examples/nrf52840/src/bin/qspi.rs +++ b/examples/nrf52840/src/bin/qspi.rs | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::{assert_eq, info, unwrap}; | 5 | use defmt::{assert_eq, info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_nrf::qspi::Frequency; | ||
| 7 | use embassy_nrf::{interrupt, qspi}; | 8 | use embassy_nrf::{interrupt, qspi}; |
| 8 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 9 | 10 | ||
| @@ -19,6 +20,8 @@ async fn main(_spawner: Spawner) { | |||
| 19 | let p = embassy_nrf::init(Default::default()); | 20 | let p = embassy_nrf::init(Default::default()); |
| 20 | // Config for the MX25R64 present in the nRF52840 DK | 21 | // Config for the MX25R64 present in the nRF52840 DK |
| 21 | let mut config = qspi::Config::default(); | 22 | let mut config = qspi::Config::default(); |
| 23 | config.capacity = 8 * 1024 * 1024; // 8 MB | ||
| 24 | config.frequency = Frequency::M32; | ||
| 22 | config.read_opcode = qspi::ReadOpcode::READ4IO; | 25 | config.read_opcode = qspi::ReadOpcode::READ4IO; |
| 23 | config.write_opcode = qspi::WriteOpcode::PP4IO; | 26 | config.write_opcode = qspi::WriteOpcode::PP4IO; |
| 24 | config.write_page_size = qspi::WritePageSize::_256BYTES; | 27 | config.write_page_size = qspi::WritePageSize::_256BYTES; |
diff --git a/examples/nrf52840/src/bin/qspi_lowpower.rs b/examples/nrf52840/src/bin/qspi_lowpower.rs index 5008481c1..20c903914 100644 --- a/examples/nrf52840/src/bin/qspi_lowpower.rs +++ b/examples/nrf52840/src/bin/qspi_lowpower.rs | |||
| @@ -6,6 +6,7 @@ use core::mem; | |||
| 6 | 6 | ||
| 7 | use defmt::{info, unwrap}; | 7 | use defmt::{info, unwrap}; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_nrf::qspi::Frequency; | ||
| 9 | use embassy_nrf::{interrupt, qspi}; | 10 | use embassy_nrf::{interrupt, qspi}; |
| 10 | use embassy_time::{Duration, Timer}; | 11 | use embassy_time::{Duration, Timer}; |
| 11 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -23,6 +24,8 @@ async fn main(_p: Spawner) { | |||
| 23 | loop { | 24 | loop { |
| 24 | // Config for the MX25R64 present in the nRF52840 DK | 25 | // Config for the MX25R64 present in the nRF52840 DK |
| 25 | let mut config = qspi::Config::default(); | 26 | let mut config = qspi::Config::default(); |
| 27 | config.capacity = 8 * 1024 * 1024; // 8 MB | ||
| 28 | config.frequency = Frequency::M32; | ||
| 26 | config.read_opcode = qspi::ReadOpcode::READ4IO; | 29 | config.read_opcode = qspi::ReadOpcode::READ4IO; |
| 27 | config.write_opcode = qspi::WriteOpcode::PP4IO; | 30 | config.write_opcode = qspi::WriteOpcode::PP4IO; |
| 28 | config.write_page_size = qspi::WritePageSize::_256BYTES; | 31 | config.write_page_size = qspi::WritePageSize::_256BYTES; |
