nrfxlib API 3.3.99
Loading...
Searching...
No Matches
sQSPI driver

Quad Serial Peripheral Interface soft peripheral (sQSPI) driver. More...

Data Structures

struct  nrf_sqspi_t
 QSPI2 driver instance structure. More...
 
struct  nrf_sqspi_evt_t
 QSPI event reported by a nrf_sqspi_callback_t function. More...
 
struct  nrf_sqspi_pins_t
 Pins selection for the QSPI peripheral. More...
 
struct  nrf_sqspi_cfg_t
 QSPI driver instance configuration structure. More...
 
struct  nrf_sqspi_spi_xip_cfg_t
 Execute-in-place (XIP) configuration. More...
 
struct  nrf_sqspi_dev_cfg_t
 QSPI device configuration structure. More...
 
struct  nrf_sqspi_xfer_t
 Configuration of a single data transfer. More...
 
struct  nrf_sqspi_data_fmt_t
 Data formatting configuration. More...
 

Macros

#define NRF_SQSPI_PINS_UNUSED    UINT32_MAX
 Value indicating that the pin is not used.
 
#define NRF_SQSPI_FLAG_HOLD_XFER   (1UL << 0)
 Flag indicating that the transfer is prepared but not started.
 

Typedefs

typedef 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.
 

Enumerations

enum  nrf_sqspi_evt_type_t { NRF_SQSPI_EVT_XFER_DONE , NRF_SQSPI_EVT_XFER_STARTED }
 Asynchronous QSPI events. More...
 
enum  nrf_sqspi_evt_xfer_done_t { NRF_SQSPI_RESULT_OK , NRF_SQSPI_RESULT_ABORTED }
 Results of the QSPI transfer reported when the transfer is done. More...
 
enum  nrf_sqspi_sample_sync_t { NRF_SQSPI_SAMPLE_SYNC_SCK , NRF_SQSPI_SAMPLE_SYNC_DELAY , NRF_SQSPI_SAMPLE_SYNC_CLK_IN }
 Modes of the timing synchronization of sampling the input signal. More...
 
enum  nrf_sqspi_spi_cpolpha_t { NRF_SQSPI_SPI_CPOLPHA_0 , NRF_SQSPI_SPI_CPOLPHA_1 , NRF_SQSPI_SPI_CPOLPHA_2 , NRF_SQSPI_SPI_CPOLPHA_3 }
 Modes of clock polairty and phase for the SPI protocol. More...
 
enum  nrf_sqspi_proto_t {
  NRF_SQSPI_PROTO_SPI_C , NRF_SQSPI_PROTO_SPI_T , NRF_SQSPI_PROTO_SSP_C , NRF_SQSPI_PROTO_SSP_T ,
  NRF_SQSPI_PROTO_MW_C , NRF_SQSPI_PROTO_MW_T
}
 Protocols and roles of this device. More...
 
enum  nrf_sqspi_spi_lines_t {
  NRF_SQSPI_SPI_LINES_SINGLE , NRF_SQSPI_SPI_LINES_DUAL_2_2_2 , NRF_SQSPI_SPI_LINES_DUAL_1_1_2 , NRF_SQSPI_SPI_LINES_DUAL_1_2_2 ,
  NRF_SQSPI_SPI_LINES_QUAD_4_4_4 , NRF_SQSPI_SPI_LINES_QUAD_1_1_4 , NRF_SQSPI_SPI_LINES_QUAD_1_4_4 , NRF_SQSPI_SPI_LINES_OCTAL_8_8_8 ,
  NRF_SQSPI_SPI_LINES_OCTAL_1_1_8 , NRF_SQSPI_SPI_LINES_OCTAL_1_8_8
}
 Number of data lines used during each part of an SPI transfer. More...
 
enum  nrf_sqspi_spi_ddr_t { NRF_SQSPI_SPI_DDR_SINGLE , NRF_SQSPI_SPI_DDR_S_S_D , NRF_SQSPI_SPI_DDR_S_D_D , NRF_SQSPI_SPI_DDR_DUAL }
 Single or dual data rate modes used during each part of an SPI transfer. More...
 
enum  nrf_sqspi_spi_xip_mode_t { NRF_SQSPI_SPI_XIP_MODE_DISABLED , NRF_SQSPI_SPI_XIP_MODE_READ_ONLY , NRF_SQSPI_SPI_XIP_MODE_READ_WRITE }
 Allowed access modes for XIP (read or write). More...
 
enum  nrf_sqspi_xfer_dir_t { NRF_SQSPI_XFER_DIR_TXRX , NRF_SQSPI_XFER_DIR_TX , NRF_SQSPI_XFER_DIR_RX }
 Direction of a single data transfer. More...
 
enum  nrf_sqspi_data_fmt_bit_order_t { NRF_SQSPI_DATA_FMT_BIT_ORDER_MSB_FIRST , NRF_SQSPI_DATA_FMT_BIT_ORDER_LSB_FIRST }
 Bit order on the serial protocol interface. More...
 
enum  nrf_sqspi_data_fmt_pad_t {
  NRF_SQSPI_DATA_FMT_PAD_RAW , NRF_SQSPI_DATA_FMT_PAD_MEM_32B_WIRE_8B , NRF_SQSPI_DATA_FMT_PAD_MEM_4B_WIRE_32B , NRF_SQSPI_DATA_FMT_PAD_MEM_8B_WIRE_32B ,
  NRF_SQSPI_DATA_FMT_PAD_MEM_16B_WIRE_32B
}
 Configuration of data padding in the memory and serial protocol interface. More...
 

Functions

nrfx_err_t nrf_sqspi_init (nrf_sqspi_t const *p_qspi, nrf_sqspi_cfg_t const *p_config)
 Initialize the QSPI driver instance.
 
bool nrf_sqspi_init_check (nrf_sqspi_t const *p_qspi)
 Check if the QSPI driver instance is initialized.
 
nrfx_err_t nrf_sqspi_reconfigure (nrf_sqspi_t const *p_qspi, nrf_sqspi_cfg_t const *p_config)
 Reconfigure the QSPI driver instance.
 
void nrf_sqspi_uninit (nrf_sqspi_t const *p_qspi)
 Uninitialize the QSPI driver instance.
 
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.
 
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.
 
nrfx_err_t nrf_sqspi_activate (nrf_sqspi_t const *p_qspi)
 Function for activating the QSPI driver instance.
 
nrfx_err_t nrf_sqspi_deactivate (nrf_sqspi_t const *p_qspi)
 Function for deactivating the QSPI driver instance.
 
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.
 
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.
 
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.
 
void nrf_sqspi_irq_handler (void)
 IRQ handler function for the QSPI driver.
 

Detailed Description

Quad Serial Peripheral Interface soft peripheral (sQSPI) driver.

This API describes the driver operation of a QSPI peripheral or similar peripherals capable of SPI-like serial data transfers (SPI, multi-line SPI, SSP, Microwire, Hyperbus, etc).

This API can be used by both controller and target device in the serial communication bus.

The functions in this driver are not enttrant if they operate on the same QSPI peripheral. It is the responsibility of the API user to ensure the functions are not preempted by each other. An exception is the callback function context. Multiple functions from this API can be called from the callback.

Note
The QSPI peripheral in nRF5340 is not a generic multi-line SPI peripheral. The nrf_sqspi API does not support this peripheral. Use the nrfx_qspi driver for the nRF5340 QSPI.