diff --git a/embassy-nrf-examples/src/bin/qspi.rs b/embassy-nrf-examples/src/bin/qspi.rs index 4e24a13d..2005b997 100644 --- a/embassy-nrf-examples/src/bin/qspi.rs +++ b/embassy-nrf-examples/src/bin/qspi.rs @@ -36,14 +36,7 @@ async fn run() { let io2 = p.P0_22; let io3 = p.P0_23; - let config = qspi::Config { - read_opcode: qspi::ReadOpcode::READ4IO, - write_opcode: qspi::WriteOpcode::PP4IO, - xip_offset: 0, - write_page_size: qspi::WritePageSize::_256BYTES, - deep_power_down: None, - }; - + let config = qspi::Config::default(); let irq = interrupt::take!(QSPI); let q = qspi::Qspi::new(p.QSPI, irq, sck, csn, io0, io1, io2, io3, config); pin_mut!(q); diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs index e05186ab..033c9e01 100644 --- a/embassy-nrf/src/qspi.rs +++ b/embassy-nrf/src/qspi.rs @@ -36,6 +36,7 @@ pub struct DeepPowerDownConfig { pub exit_time: u16, } +#[non_exhaustive] pub struct Config { pub xip_offset: u32, pub read_opcode: ReadOpcode, @@ -44,6 +45,18 @@ pub struct Config { pub deep_power_down: Option, } +impl Default for Config { + fn default() -> Self { + Self { + read_opcode: ReadOpcode::READ4IO, + write_opcode: WriteOpcode::PP4IO, + xip_offset: 0, + write_page_size: WritePageSize::_256BYTES, + deep_power_down: None, + } + } +} + pub struct Qspi<'d, T: Instance> { peri: T, irq: T::Interrupt,