Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
MSPI Transfer API

MSPI Transfer API. More...

Data Structures

struct  mspi_ce_control
 MSPI Chip Select control structure. More...
struct  mspi_xfer_packet
 MSPI peripheral xfer packet format. More...
struct  mspi_xfer
 MSPI peripheral xfer format This includes transfer related settings that may require configuring the hardware. More...

Functions

int mspi_transceive (const struct device *controller, const struct mspi_dev_id *dev_id, const struct mspi_xfer *req)
 Transfer request over MSPI.
static int mspi_transceive_data_only (const struct device *controller, const struct mspi_dev_id *dev_id, const struct mspi_xfer_packet *packets, uint32_t num_packet, enum mspi_xfer_mode xfer_mode, bool async, uint32_t timeout)
 Transfer data over MSPI without command or address phases.

Detailed Description

MSPI Transfer API.

Function Documentation

◆ mspi_transceive()

int mspi_transceive ( const struct device * controller,
const struct mspi_dev_id * dev_id,
const struct mspi_xfer * req )

#include <mspi.h>

Transfer request over MSPI.

This routines provides a generic interface to transfer a request synchronously/asynchronously.

The

See also
mspi_xfer allows for dynamically changing the transfer related Settings once the mode of operation is determined and configured. The API supports bulk transfers with different starting addresses and sizes with
mspi_xfer_packet. However, it is up to the controller implementation whether to support scatter IO and callback management. The controller can determine which user callback to trigger based on
mspi_bus_event_cb_mask upon completion of each async/sync transfer if the callback had been registered. Or not to trigger any callback at all with MSPI_BUS_NO_CB even if the callbacks are already registered.
Parameters
controllerPointer to the device structure for the driver instance.
dev_idPointer to the device ID structure from a device.
reqContent of the request and request specific settings.
Return values
0If successful.
-ENOTSUP
-EIOGeneral input / output error, failed to send over the bus.

◆ mspi_transceive_data_only()

int mspi_transceive_data_only ( const struct device * controller,
const struct mspi_dev_id * dev_id,
const struct mspi_xfer_packet * packets,
uint32_t num_packet,
enum mspi_xfer_mode xfer_mode,
bool async,
uint32_t timeout )
inlinestatic

#include <mspi.h>

Transfer data over MSPI without command or address phases.

Convenience wrapper over mspi_transceive() for transfers that consist of a data phase only. It builds the mspi_xfer from caller-owned packets and enforces the data-only contract (mspi_xfer::cmd_length and mspi_xfer::addr_length are 0). mspi_xfer_packet::cmd and mspi_xfer_packet::address are ignored by the driver.

This is the intended transfer call where the hardware cannot distinguish a command byte from a data byte and only mspi_xfer_packet::dir, mspi_xfer_packet::num_bytes and mspi_xfer_packet::data_buf are significant. It may equally be used by a controller for data-only transactions.

The packets remain caller owned and must stay valid until the transfer completes when async is true.

Parameters
controllerPointer to the device structure for the driver instance.
dev_idPointer to the device ID structure from a device.
packetsTransfer packets.
num_packetNumber of transfer packets.
xfer_modeTransfer mode (PIO/DMA).
asyncAsync or sync transfer.
timeoutTransfer timeout value(ms).
Return values
0If successful.
-ENOTSUP
-EIOGeneral input / output error, failed to send over the bus.