Connectivity - SPI - nordic,nrf-qspi
nRF5340 QSPI (quad SPI external flash interface)
Behavioral QSPI model with no external flash connected: every task (`ACTIVATE`, `DEACTIVATE`, erase tasks, `READ`, `WRITE`) latches `EVENTS_READY` immediately (IRQ when enabled). `TASKS_READ` fills the destination buffer with `0xFF` (erased flash) via EasyDMA; writes and erases are discarded. Custom events `nrf.qspi.transfer` and `nrf.qspi.erase` are emitted for host-side observation.
Events emitted
nrf.qspi.eraseEmitted when a QSPI erase task completes (TASKS_ERASESTART, TASKS_ERASE128, TASKS_ERASE4, or TASKS_ERASE). Carries the flash pointer and the erase length in bytes.
Payload
| Field | Type | Description |
|---|---|---|
len | u32 | Number of bytes erased (0 when the length register is 0). |
ptr | u32 | Flash address at which the erase began. |
nrf.qspi.transferEmitted when a QSPI read or write transfer completes (TASKS_READ or TASKS_WRITE). The `direction` field is `"read"` or `"write"`.
Payload
| Field | Type | Description |
|---|---|---|
direction | "read" | "write" | Transfer direction: `"read"` or `"write"`. |
dst | u32 | Destination address (SRAM address for reads, flash offset for writes). |
len | u32 | Transfer length in bytes. |
src | u32 | Source address (flash offset for reads, SRAM address for writes). |
Events accepted
No peripheral-specific input events. The peripheral is driven through MMIO register access.
Commands
This peripheral exposes no commands.
Snapshot fields
| Field | Type | Label |
|---|---|---|
| state_json | str | QSPI State Summary (JSON) |
| inten | u32 | INTEN |
| ev_ready | u32 | EVENTS_READY |
| enable | u32 | ENABLE |
| read_cnt | u32 | READ.CNT |
| write_cnt | u32 | WRITE.CNT |
| erase_ptr | u32 | ERASE.PTR |
| erase_len | u32 | ERASE.LEN |
Read at runtime with emulator.peripheral_snapshot(name).