From eb70d744a9ad6c1a9747777eb32b7b22481e77ec Mon Sep 17 00:00:00 2001 From: ftilde Date: Thu, 4 Jan 2024 21:24:09 +0100 Subject: [PATCH] Expose rx_delay in nrf qspi config --- embassy-nrf/src/qspi.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs index 0171ceb0e..8eec09c96 100755 --- a/embassy-nrf/src/qspi.rs +++ b/embassy-nrf/src/qspi.rs @@ -80,6 +80,8 @@ pub struct Config { pub frequency: Frequency, /// Value is specified in number of 16 MHz periods (62.5 ns) pub sck_delay: u8, + /// Value is specified in number of 64 MHz periods (15.625 ns), valid values between 0 and 7 (inclusive) + pub rx_delay: u8, /// Whether data is captured on the clock rising edge and data is output on a falling edge (MODE0) or vice-versa (MODE3) pub spi_mode: SpiMode, /// Addressing mode (24-bit or 32-bit) @@ -98,6 +100,7 @@ impl Default for Config { deep_power_down: None, frequency: Frequency::M8, sck_delay: 80, + rx_delay: 2, spi_mode: SpiMode::MODE0, address_mode: AddressMode::_24BIT, capacity: 0, @@ -202,6 +205,11 @@ impl<'d, T: Instance> Qspi<'d, T> { w }); + r.iftiming.write(|w| unsafe { + w.rxdelay().bits(config.rx_delay & 0b111); + w + }); + r.xipoffset.write(|w| unsafe { w.xipoffset().bits(config.xip_offset); w