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
This commit is contained in:
Ulf Lilleengen
2022-04-19 14:39:59 +02:00
parent 00c51c8fd5
commit e966125d62
4 changed files with 207 additions and 37 deletions

View File

@ -26,10 +26,9 @@ async fn main(_spawner: Spawner, p: Peripherals) {
config.write_page_size = qspi::WritePageSize::_256BYTES;
let irq = interrupt::take!(QSPI);
let mut q = qspi::Qspi::new(
let mut q: qspi::Qspi<_, 67108864> = qspi::Qspi::new(
p.QSPI, irq, p.P0_19, p.P0_17, p.P0_20, p.P0_21, p.P0_22, p.P0_23, config,
)
.await;
);
let mut id = [1; 3];
unwrap!(q.custom_instruction(0x9F, &[], &mut id).await);