11#include <drivers/nrfx_errors.h>
111 uint32_t spi_reserved[NRFX_MAX(
134#define NRF_SQSPI_PINS_UNUSED \
393#define NRF_SQSPI_FLAG_HOLD_XFER (1UL << 0)
nrf_sqspi_spi_lines_t
Number of data lines used during each part of an SPI transfer.
Definition nrf_sqspi.h:219
@ NRF_SQSPI_SPI_LINES_OCTAL_1_8_8
Definition nrf_sqspi.h:242
@ NRF_SQSPI_SPI_LINES_OCTAL_8_8_8
Definition nrf_sqspi.h:237
@ NRF_SQSPI_SPI_LINES_SINGLE
Classic SPI.
Definition nrf_sqspi.h:220
@ NRF_SQSPI_SPI_LINES_DUAL_1_1_2
Definition nrf_sqspi.h:223
@ NRF_SQSPI_SPI_LINES_DUAL_2_2_2
Definition nrf_sqspi.h:221
@ NRF_SQSPI_SPI_LINES_OCTAL_1_1_8
Definition nrf_sqspi.h:239
@ NRF_SQSPI_SPI_LINES_QUAD_4_4_4
Definition nrf_sqspi.h:229
@ NRF_SQSPI_SPI_LINES_QUAD_1_4_4
Definition nrf_sqspi.h:234
@ NRF_SQSPI_SPI_LINES_QUAD_1_1_4
Definition nrf_sqspi.h:231
@ NRF_SQSPI_SPI_LINES_DUAL_1_2_2
Definition nrf_sqspi.h:226
bool nrf_sqspi_init_check(nrf_sqspi_t const *p_qspi)
Check if the QSPI driver instance is initialized.
nrfx_err_t nrf_sqspi_activate(nrf_sqspi_t const *p_qspi)
Function for activating the QSPI driver instance.
nrf_sqspi_spi_xip_mode_t
Allowed access modes for XIP (read or write).
Definition nrf_sqspi.h:262
@ NRF_SQSPI_SPI_XIP_MODE_READ_ONLY
Definition nrf_sqspi.h:264
@ NRF_SQSPI_SPI_XIP_MODE_READ_WRITE
Definition nrf_sqspi.h:266
@ NRF_SQSPI_SPI_XIP_MODE_DISABLED
XIP feature is disabled.
Definition nrf_sqspi.h:263
void(* nrf_sqspi_callback_t)(nrf_sqspi_t const *p_qspi, nrf_sqspi_evt_t *p_event, void *p_context)
Callback function called when an asynchronous operation ends.
Definition nrf_sqspi.h:77
uint32_t * nrf_sqspi_start_task_address_get(nrf_sqspi_t const *p_qspi)
Get an address of the task register to start the prepared transfer.
nrf_sqspi_proto_t
Protocols and roles of this device.
Definition nrf_sqspi.h:207
@ NRF_SQSPI_PROTO_MW_T
Microwire target.
Definition nrf_sqspi.h:214
@ NRF_SQSPI_PROTO_SSP_C
Synchronous Serial Protocol controller.
Definition nrf_sqspi.h:211
@ NRF_SQSPI_PROTO_SPI_C
Definition nrf_sqspi.h:208
@ NRF_SQSPI_PROTO_SSP_T
Synchronous Serial Protocol target.
Definition nrf_sqspi.h:212
@ NRF_SQSPI_PROTO_SPI_T
SPI target, including multi-line SPI protocols.
Definition nrf_sqspi.h:210
@ NRF_SQSPI_PROTO_MW_C
Microwire controller.
Definition nrf_sqspi.h:213
nrfx_err_t nrf_sqspi_init(nrf_sqspi_t const *p_qspi, nrf_sqspi_cfg_t const *p_config)
Initialize the QSPI driver instance.
nrf_sqspi_evt_xfer_done_t
Results of the QSPI transfer reported when the transfer is done.
Definition nrf_sqspi.h:59
@ NRF_SQSPI_RESULT_ABORTED
Operation was aborted.
Definition nrf_sqspi.h:61
@ NRF_SQSPI_RESULT_OK
Operation finished successfully.
Definition nrf_sqspi.h:60
nrf_sqspi_xfer_dir_t
Direction of a single data transfer.
Definition nrf_sqspi.h:359
@ NRF_SQSPI_XFER_DIR_TX
Transmit data only.
Definition nrf_sqspi.h:362
@ NRF_SQSPI_XFER_DIR_RX
Definition nrf_sqspi.h:363
@ NRF_SQSPI_XFER_DIR_TXRX
Definition nrf_sqspi.h:360
nrf_sqspi_evt_type_t
Asynchronous QSPI events.
Definition nrf_sqspi.h:52
@ NRF_SQSPI_EVT_XFER_DONE
Transfer operation has finished.
Definition nrf_sqspi.h:53
@ NRF_SQSPI_EVT_XFER_STARTED
The operation has been accepted and scheduled to be started.
Definition nrf_sqspi.h:54
nrfx_err_t nrf_sqspi_xfer_prepare(nrf_sqspi_t const *p_qspi, nrf_sqspi_xfer_t const *p_xfer, size_t xfer_count)
Prepare the serial interface to transfer the data.
nrf_sqspi_sample_sync_t
Modes of the timing synchronization of sampling the input signal.
Definition nrf_sqspi.h:179
@ NRF_SQSPI_SAMPLE_SYNC_SCK
Definition nrf_sqspi.h:180
@ NRF_SQSPI_SAMPLE_SYNC_DELAY
Definition nrf_sqspi.h:182
@ NRF_SQSPI_SAMPLE_SYNC_CLK_IN
Definition nrf_sqspi.h:185
nrfx_err_t nrf_sqspi_reconfigure(nrf_sqspi_t const *p_qspi, nrf_sqspi_cfg_t const *p_config)
Reconfigure the QSPI driver instance.
nrfx_err_t nrf_sqspi_dev_data_fmt_set(nrf_sqspi_t const *p_qspi, nrf_sqspi_data_fmt_t *p_data_fmt)
Configure the data format for the device.
void nrf_sqspi_uninit(nrf_sqspi_t const *p_qspi)
Uninitialize the QSPI driver instance.
nrf_sqspi_data_fmt_pad_t
Configuration of data padding in the memory and serial protocol interface.
Definition nrf_sqspi.h:406
@ NRF_SQSPI_DATA_FMT_PAD_MEM_16B_WIRE_32B
Definition nrf_sqspi.h:417
@ NRF_SQSPI_DATA_FMT_PAD_RAW
Data is transferred as is to/from the memory.
Definition nrf_sqspi.h:407
@ NRF_SQSPI_DATA_FMT_PAD_MEM_8B_WIRE_32B
Definition nrf_sqspi.h:414
@ NRF_SQSPI_DATA_FMT_PAD_MEM_4B_WIRE_32B
Definition nrf_sqspi.h:411
@ NRF_SQSPI_DATA_FMT_PAD_MEM_32B_WIRE_8B
Definition nrf_sqspi.h:408
nrfx_err_t nrf_sqspi_dev_cfg(nrf_sqspi_t const *p_qspi, nrf_sqspi_dev_cfg_t const *p_config, nrf_sqspi_callback_t callback, void *p_context)
Configure a device attached to the QSPI-controlled bus.
nrf_sqspi_spi_cpolpha_t
Modes of clock polairty and phase for the SPI protocol.
Definition nrf_sqspi.h:194
@ NRF_SQSPI_SPI_CPOLPHA_3
Definition nrf_sqspi.h:201
@ NRF_SQSPI_SPI_CPOLPHA_0
Definition nrf_sqspi.h:195
@ NRF_SQSPI_SPI_CPOLPHA_1
Definition nrf_sqspi.h:197
@ NRF_SQSPI_SPI_CPOLPHA_2
Definition nrf_sqspi.h:199
nrf_sqspi_data_fmt_bit_order_t
Bit order on the serial protocol interface.
Definition nrf_sqspi.h:397
@ NRF_SQSPI_DATA_FMT_BIT_ORDER_LSB_FIRST
Command bits are sent LSB first.
Definition nrf_sqspi.h:400
@ NRF_SQSPI_DATA_FMT_BIT_ORDER_MSB_FIRST
Definition nrf_sqspi.h:398
nrfx_err_t nrf_sqspi_xfer(nrf_sqspi_t const *p_qspi, nrf_sqspi_xfer_t const *p_xfer, size_t xfer_count, uint32_t flags)
Transfer data using the serial interface.
void nrf_sqspi_irq_handler(void)
IRQ handler function for the QSPI driver.
nrf_sqspi_spi_ddr_t
Single or dual data rate modes used during each part of an SPI transfer.
Definition nrf_sqspi.h:250
@ NRF_SQSPI_SPI_DDR_S_S_D
Definition nrf_sqspi.h:252
@ NRF_SQSPI_SPI_DDR_DUAL
Definition nrf_sqspi.h:256
@ NRF_SQSPI_SPI_DDR_S_D_D
Definition nrf_sqspi.h:254
@ NRF_SQSPI_SPI_DDR_SINGLE
Classic SPI, single data rate.
Definition nrf_sqspi.h:251
nrfx_err_t nrf_sqspi_deactivate(nrf_sqspi_t const *p_qspi)
Function for deactivating the QSPI driver instance.
#define NRF_SQSPI_MAX_NUM_DATA_LINES
NRF_SQSPI_MAX_NUM_DATA_LINES - Maximal number of data lines used by the QSPI peripheral.
Definition nrf_config_sqspi.h:25
nrf_sqspi_pins_t pins
Pin configuration structure.
Definition nrf_sqspi.h:140
bool skip_gpio_cfg
Skip GPIO configuration of pins.
Definition nrf_sqspi.h:141
bool skip_pmux_cfg
Skip pin multiplexing configuration.
Definition nrf_sqspi.h:154
uint8_t irq_priority
Interrupt priority.
Definition nrf_sqspi.h:170
QSPI driver instance configuration structure.
Definition nrf_sqspi.h:139
nrf_sqspi_data_fmt_bit_order_t data_bit_order
Bit order for the data.
Definition nrf_sqspi.h:427
uint8_t data_container
Definition nrf_sqspi.h:433
uint8_t data_swap_unit
Definition nrf_sqspi.h:464
nrf_sqspi_data_fmt_bit_order_t addr_bit_order
Bit order for the address.
Definition nrf_sqspi.h:426
nrf_sqspi_data_fmt_pad_t data_padding
Definition nrf_sqspi.h:506
nrf_sqspi_data_fmt_bit_order_t cmd_bit_order
Bit order for the command.
Definition nrf_sqspi.h:425
uint8_t data_bit_reorder_unit
Definition nrf_sqspi.h:428
Data formatting configuration.
Definition nrf_sqspi.h:424
uint32_t csn_pin
CSN pin connected to the device being configured.
Definition nrf_sqspi.h:296
uint16_t sample_delay_cyc
Definition nrf_sqspi.h:301
nrf_sqspi_proto_t protocol
Serial protocol for this device.
Definition nrf_sqspi.h:298
nrf_sqspi_spi_cpolpha_t spi_cpolpha
Clock line polarization and phase.
Definition nrf_sqspi.h:319
nrf_sqspi_spi_xip_cfg_t xip_cfg
Configuration of the memory-mapped accesses.
Definition nrf_sqspi.h:334
char ssp_dummy_field
Dummy field to make the union non-empty.
Definition nrf_sqspi.h:343
nrf_sqspi_spi_ddr_t mspi_ddr
Definition nrf_sqspi.h:323
bool spi_clk_stretch
Definition nrf_sqspi.h:325
nrf_sqspi_spi_lines_t mspi_lines
Definition nrf_sqspi.h:321
nrf_sqspi_sample_sync_t sample_sync
Synchronization of the input signal sampling.
Definition nrf_sqspi.h:300
uint32_t sck_freq_khz
SCK clock frequency in kHz.
Definition nrf_sqspi.h:297
char mw_dummy_field
Dummy field to make the union non-empty.
Definition nrf_sqspi.h:352
QSPI device configuration structure.
Definition nrf_sqspi.h:295
nrf_sqspi_evt_type_t type
Event type.
Definition nrf_sqspi.h:67
nrf_sqspi_evt_xfer_done_t xfer_done
Data for NRF_SQSPI_EVT_XFER_DONE event.
Definition nrf_sqspi.h:72
QSPI event reported by a nrf_sqspi_callback_t function.
Definition nrf_sqspi.h:66
uint32_t miso
SPI MISO line.
Definition nrf_sqspi.h:110
uint32_t data
Data line in one-line protocols like Microwire or SSP.
Definition nrf_sqspi.h:125
uint32_t strobe
Definition nrf_sqspi.h:94
uint32_t sck
Definition nrf_sqspi.h:92
uint32_t mosi
SPI MOSI line.
Definition nrf_sqspi.h:109
Pins selection for the QSPI peripheral.
Definition nrf_sqspi.h:91
uint32_t write_cmd
Definition nrf_sqspi.h:287
uint32_t address_offset
Definition nrf_sqspi.h:279
uint32_t size
Size of the memory mapped region.
Definition nrf_sqspi.h:284
uint8_t address_size
Size of the address, in bits.
Definition nrf_sqspi.h:290
uint8_t cmd_size
Size of the SPI command, in bits.
Definition nrf_sqspi.h:289
nrf_sqspi_spi_xip_mode_t mode
Required state of the XIP feature.
Definition nrf_sqspi.h:278
uint32_t read_cmd
SPI command to read data from the memory.
Definition nrf_sqspi.h:286
Execute-in-place (XIP) configuration.
Definition nrf_sqspi.h:277
void * p_reg
Pointer to a structure with QSPI registers.
Definition nrf_sqspi.h:45
uint8_t drv_inst_idx
Index of the driver instance. For internal use only.
Definition nrf_sqspi.h:47
QSPI2 driver instance structure.
Definition nrf_sqspi.h:44
uint64_t address
Address to be accessed (only for controller mode).
Definition nrf_sqspi.h:376
void * p_data
Pointer to the data buffer for transmission or reception.
Definition nrf_sqspi.h:377
uint8_t cmd_length
Length of the command in bits (only for controller mode).
Definition nrf_sqspi.h:382
uint8_t dummy_length
Definition nrf_sqspi.h:385
uint8_t addr_length
Definition nrf_sqspi.h:383
nrf_sqspi_xfer_dir_t dir
Direction of the transfer (TX, RX, or TXRX).
Definition nrf_sqspi.h:389
size_t data_length
Length of the data buffer in bytes.
Definition nrf_sqspi.h:380
uint32_t cmd
Command to be sent (only for controller mode).
Definition nrf_sqspi.h:375
Configuration of a single data transfer.
Definition nrf_sqspi.h:374