142#define NRF_SQSPI_PINS_UNUSED \
401#define NRF_SQSPI_FLAG_HOLD_XFER (1UL << 0)
687 const uint8_t * p_roles);
nrf_sqspi_spi_lines_t
Number of data lines used during each part of an SPI transfer.
Definition nrf_sqspi.h:227
@ NRF_SQSPI_SPI_LINES_OCTAL_1_8_8
Definition nrf_sqspi.h:250
@ NRF_SQSPI_SPI_LINES_OCTAL_8_8_8
Definition nrf_sqspi.h:245
@ NRF_SQSPI_SPI_LINES_SINGLE
Classic SPI.
Definition nrf_sqspi.h:228
@ NRF_SQSPI_SPI_LINES_DUAL_1_1_2
Definition nrf_sqspi.h:231
@ NRF_SQSPI_SPI_LINES_DUAL_2_2_2
Definition nrf_sqspi.h:229
@ NRF_SQSPI_SPI_LINES_OCTAL_1_1_8
Definition nrf_sqspi.h:247
@ NRF_SQSPI_SPI_LINES_QUAD_4_4_4
Definition nrf_sqspi.h:237
@ NRF_SQSPI_SPI_LINES_QUAD_1_4_4
Definition nrf_sqspi.h:242
@ NRF_SQSPI_SPI_LINES_QUAD_1_1_4
Definition nrf_sqspi.h:239
@ NRF_SQSPI_SPI_LINES_DUAL_1_2_2
Definition nrf_sqspi.h:234
bool nrf_sqspi_init_check(nrf_sqspi_t const *p_qspi)
Check if the QSPI driver instance is initialized.
nrf_sqspi_error_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_xip_mode_t
Allowed access modes for XIP (read or write).
Definition nrf_sqspi.h:270
@ NRF_SQSPI_SPI_XIP_MODE_READ_ONLY
Definition nrf_sqspi.h:272
@ NRF_SQSPI_SPI_XIP_MODE_READ_WRITE
Definition nrf_sqspi.h:274
@ NRF_SQSPI_SPI_XIP_MODE_DISABLED
XIP feature is disabled.
Definition nrf_sqspi.h:271
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:85
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_error_t nrf_sqspi_reconfigure(nrf_sqspi_t const *p_qspi, nrf_sqspi_cfg_t const *p_config)
Reconfigure the QSPI driver instance.
nrf_sqspi_proto_t
Protocols and roles of this device.
Definition nrf_sqspi.h:215
@ NRF_SQSPI_PROTO_MW_T
Microwire target.
Definition nrf_sqspi.h:222
@ NRF_SQSPI_PROTO_SSP_C
Synchronous Serial Protocol controller.
Definition nrf_sqspi.h:219
@ NRF_SQSPI_PROTO_SPI_C
Definition nrf_sqspi.h:216
@ NRF_SQSPI_PROTO_SSP_T
Synchronous Serial Protocol target.
Definition nrf_sqspi.h:220
@ NRF_SQSPI_PROTO_SPI_T
SPI target, including multi-line SPI protocols.
Definition nrf_sqspi.h:218
@ NRF_SQSPI_PROTO_MW_C
Microwire controller.
Definition nrf_sqspi.h:221
nrf_sqspi_evt_xfer_done_t
Results of the QSPI transfer reported when the transfer is done.
Definition nrf_sqspi.h:57
@ NRF_SQSPI_RESULT_ABORTED
Operation was aborted.
Definition nrf_sqspi.h:59
@ NRF_SQSPI_RESULT_OK
Operation finished successfully.
Definition nrf_sqspi.h:58
nrf_sqspi_xfer_dir_t
Direction of a single data transfer.
Definition nrf_sqspi.h:367
@ NRF_SQSPI_XFER_DIR_TX
Transmit data only.
Definition nrf_sqspi.h:370
@ NRF_SQSPI_XFER_DIR_RX
Definition nrf_sqspi.h:371
@ NRF_SQSPI_XFER_DIR_TXRX
Definition nrf_sqspi.h:368
nrf_sqspi_evt_type_t
Asynchronous QSPI events.
Definition nrf_sqspi.h:50
@ NRF_SQSPI_EVT_XFER_DONE
Transfer operation has finished.
Definition nrf_sqspi.h:51
@ NRF_SQSPI_EVT_XFER_STARTED
The operation has been accepted and scheduled to be started.
Definition nrf_sqspi.h:52
nrf_sqspi_error_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.
nrf_sqspi_sample_sync_t
Modes of the timing synchronization of sampling the input signal.
Definition nrf_sqspi.h:187
@ NRF_SQSPI_SAMPLE_SYNC_SCK
Definition nrf_sqspi.h:188
@ NRF_SQSPI_SAMPLE_SYNC_DELAY
Definition nrf_sqspi.h:190
@ NRF_SQSPI_SAMPLE_SYNC_CLK_IN
Definition nrf_sqspi.h:193
void nrf_sqspi_uninit(nrf_sqspi_t const *p_qspi)
Uninitialize the QSPI driver instance.
nrf_sqspi_error_t nrf_sqspi_dppi_role_map_set(nrf_sqspi_t const *p_qspi, const uint8_t *p_roles)
Bind the soft peripheral's tasks to handler roles, as one map.
nrf_sqspi_error_t nrf_sqspi_init(nrf_sqspi_t const *p_qspi, nrf_sqspi_cfg_t const *p_config)
Initialize 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:414
@ NRF_SQSPI_DATA_FMT_PAD_MEM_16B_WIRE_32B
Definition nrf_sqspi.h:425
@ NRF_SQSPI_DATA_FMT_PAD_RAW
Data is transferred as is to/from the memory.
Definition nrf_sqspi.h:415
@ NRF_SQSPI_DATA_FMT_PAD_MEM_8B_WIRE_32B
Definition nrf_sqspi.h:422
@ NRF_SQSPI_DATA_FMT_PAD_MEM_4B_WIRE_32B
Definition nrf_sqspi.h:419
@ NRF_SQSPI_DATA_FMT_PAD_MEM_32B_WIRE_8B
Definition nrf_sqspi.h:416
nrf_sqspi_error_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_error_t
Definition nrf_sqspi.h:63
@ NRF_SQSPI_ERROR_UNSUPPORTED
Definition nrf_sqspi.h:66
@ NRF_SQSPI_ERROR_INVALID_STATE
Definition nrf_sqspi.h:68
@ NRF_SQSPI_ERROR_HW_FAULT
Definition nrf_sqspi.h:69
@ NRF_SQSPI_ERROR_INVALID_PARAM
Definition nrf_sqspi.h:67
@ NRF_SQSPI_ERROR_BUSY
Definition nrf_sqspi.h:65
@ NRF_SQSPI_SUCCESS
Definition nrf_sqspi.h:64
nrf_sqspi_spi_cpolpha_t
Modes of clock polairty and phase for the SPI protocol.
Definition nrf_sqspi.h:202
@ NRF_SQSPI_SPI_CPOLPHA_3
Definition nrf_sqspi.h:209
@ NRF_SQSPI_SPI_CPOLPHA_0
Definition nrf_sqspi.h:203
@ NRF_SQSPI_SPI_CPOLPHA_1
Definition nrf_sqspi.h:205
@ NRF_SQSPI_SPI_CPOLPHA_2
Definition nrf_sqspi.h:207
nrf_sqspi_error_t nrf_sqspi_deactivate(nrf_sqspi_t const *p_qspi)
Function for deactivating the QSPI driver instance.
nrf_sqspi_data_fmt_bit_order_t
Bit order on the serial protocol interface.
Definition nrf_sqspi.h:405
@ NRF_SQSPI_DATA_FMT_BIT_ORDER_LSB_FIRST
Command bits are sent LSB first.
Definition nrf_sqspi.h:408
@ NRF_SQSPI_DATA_FMT_BIT_ORDER_MSB_FIRST
Definition nrf_sqspi.h:406
nrf_sqspi_error_t nrf_sqspi_dppi_subscribe_enable(nrf_sqspi_t const *p_qspi, uint8_t slot, bool enable)
Permit or forbid the soft peripheral to subscribe a DPPI slot.
nrf_sqspi_error_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:258
@ NRF_SQSPI_SPI_DDR_S_S_D
Definition nrf_sqspi.h:260
@ NRF_SQSPI_SPI_DDR_DUAL
Definition nrf_sqspi.h:264
@ NRF_SQSPI_SPI_DDR_S_D_D
Definition nrf_sqspi.h:262
@ NRF_SQSPI_SPI_DDR_SINGLE
Classic SPI, single data rate.
Definition nrf_sqspi.h:259
nrf_sqspi_error_t nrf_sqspi_activate(nrf_sqspi_t const *p_qspi)
Function for activating 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:148
bool skip_gpio_cfg
Skip GPIO configuration of pins.
Definition nrf_sqspi.h:149
bool skip_pmux_cfg
Skip pin multiplexing configuration.
Definition nrf_sqspi.h:162
uint8_t irq_priority
Interrupt priority.
Definition nrf_sqspi.h:178
QSPI driver instance configuration structure.
Definition nrf_sqspi.h:147
nrf_sqspi_data_fmt_bit_order_t data_bit_order
Bit order for the data.
Definition nrf_sqspi.h:435
uint8_t data_container
Definition nrf_sqspi.h:441
uint8_t data_swap_unit
Definition nrf_sqspi.h:472
nrf_sqspi_data_fmt_bit_order_t addr_bit_order
Bit order for the address.
Definition nrf_sqspi.h:434
nrf_sqspi_data_fmt_pad_t data_padding
Definition nrf_sqspi.h:514
nrf_sqspi_data_fmt_bit_order_t cmd_bit_order
Bit order for the command.
Definition nrf_sqspi.h:433
uint8_t data_bit_reorder_unit
Definition nrf_sqspi.h:436
Data formatting configuration.
Definition nrf_sqspi.h:432
uint32_t csn_pin
CSN pin connected to the device being configured.
Definition nrf_sqspi.h:304
uint16_t sample_delay_cyc
Definition nrf_sqspi.h:309
nrf_sqspi_proto_t protocol
Serial protocol for this device.
Definition nrf_sqspi.h:306
nrf_sqspi_spi_cpolpha_t spi_cpolpha
Clock line polarization and phase.
Definition nrf_sqspi.h:327
nrf_sqspi_spi_xip_cfg_t xip_cfg
Configuration of the memory-mapped accesses.
Definition nrf_sqspi.h:342
char ssp_dummy_field
Dummy field to make the union non-empty.
Definition nrf_sqspi.h:351
nrf_sqspi_spi_ddr_t mspi_ddr
Definition nrf_sqspi.h:331
bool spi_clk_stretch
Definition nrf_sqspi.h:333
nrf_sqspi_spi_lines_t mspi_lines
Definition nrf_sqspi.h:329
nrf_sqspi_sample_sync_t sample_sync
Synchronization of the input signal sampling.
Definition nrf_sqspi.h:308
uint32_t sck_freq_khz
SCK clock frequency in kHz.
Definition nrf_sqspi.h:305
char mw_dummy_field
Dummy field to make the union non-empty.
Definition nrf_sqspi.h:360
QSPI device configuration structure.
Definition nrf_sqspi.h:303
nrf_sqspi_evt_type_t type
Event type.
Definition nrf_sqspi.h:75
nrf_sqspi_evt_xfer_done_t xfer_done
Data for NRF_SQSPI_EVT_XFER_DONE event.
Definition nrf_sqspi.h:80
QSPI event reported by a nrf_sqspi_callback_t function.
Definition nrf_sqspi.h:74
uint32_t miso
SPI MISO line.
Definition nrf_sqspi.h:118
uint32_t io[2]
protocols like QSPI, Octal-SPI
Definition nrf_sqspi.h:125
uint32_t data
Data line in one-line protocols like Microwire or SSP.
Definition nrf_sqspi.h:133
uint32_t strobe
Definition nrf_sqspi.h:102
uint32_t one_line_reserved[2 - 1]
Definition nrf_sqspi.h:135
uint32_t sck
Definition nrf_sqspi.h:100
uint32_t mosi
SPI MOSI line.
Definition nrf_sqspi.h:117
uint32_t spi_reserved[NRFX_MAX(2 - 2, 0)]
Set all array elements to NRF_SQSPI_PINS_UNUSED.
Definition nrf_sqspi.h:121
Pins selection for the QSPI peripheral.
Definition nrf_sqspi.h:99
uint32_t write_cmd
Definition nrf_sqspi.h:295
uint32_t address_offset
Definition nrf_sqspi.h:287
uint32_t size
Size of the memory mapped region.
Definition nrf_sqspi.h:292
uint8_t address_size
Size of the address, in bits.
Definition nrf_sqspi.h:298
uint8_t cmd_size
Size of the SPI command, in bits.
Definition nrf_sqspi.h:297
nrf_sqspi_spi_xip_mode_t mode
Required state of the XIP feature.
Definition nrf_sqspi.h:286
uint32_t read_cmd
SPI command to read data from the memory.
Definition nrf_sqspi.h:294
Execute-in-place (XIP) configuration.
Definition nrf_sqspi.h:285
void * p_reg
Pointer to a structure with QSPI registers.
Definition nrf_sqspi.h:43
uint8_t drv_inst_idx
Index of the driver instance. For internal use only.
Definition nrf_sqspi.h:45
QSPI2 driver instance structure.
Definition nrf_sqspi.h:42
uint64_t address
Address to be accessed (only for controller mode).
Definition nrf_sqspi.h:384
void * p_data
Pointer to the data buffer for transmission or reception.
Definition nrf_sqspi.h:385
uint8_t cmd_length
Length of the command in bits (only for controller mode).
Definition nrf_sqspi.h:390
uint8_t dummy_length
Definition nrf_sqspi.h:393
uint8_t addr_length
Definition nrf_sqspi.h:391
nrf_sqspi_xfer_dir_t dir
Direction of the transfer (TX, RX, or TXRX).
Definition nrf_sqspi.h:397
size_t data_length
Length of the data buffer in bytes.
Definition nrf_sqspi.h:388
uint32_t cmd
Command to be sent (only for controller mode).
Definition nrf_sqspi.h:383
Configuration of a single data transfer.
Definition nrf_sqspi.h:382