Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
MSPI Emulation Interface

MSPI Emulation Interface . More...

Data Structures

struct  emul_mspi_device_api
 Definition of the MSPI device emulator API. More...
 
struct  mspi_emul
 Node in a linked list of emulators for MSPI devices. More...
 
struct  emul_mspi_driver_api
 Definition of the MSPI controller emulator API. More...
 

Typedefs

typedef struct mspi_emul *(* mspi_emul_find_emul) (const struct device *dev, uint16_t dev_idx)
 Find an emulator present on a MSPI bus.
 
typedef int(* mspi_emul_trigger_event) (const struct device *dev, enum mspi_bus_event evt_type)
 Triggers an event on the emulator of MSPI controller side which causes calling specific callbacks.
 
typedef int(* emul_mspi_dev_api_transceive) (const struct emul *target, const struct mspi_xfer_packet *packets, uint32_t num_packet, bool async, uint32_t timeout)
 Loopback MSPI transceive request to the device emulator as no real hardware attached.
 

Functions

int mspi_emul_register (const struct device *dev, struct mspi_emul *emul)
 Register an emulated device on the controller.
 

Detailed Description

MSPI Emulation Interface .

Typedef Documentation

◆ emul_mspi_dev_api_transceive

typedef int(* emul_mspi_dev_api_transceive) (const struct emul *target, const struct mspi_xfer_packet *packets, uint32_t num_packet, bool async, uint32_t timeout)

#include <zephyr/drivers/mspi_emul.h>

Loopback MSPI transceive request to the device emulator as no real hardware attached.

Parameters
targetThe device Emulator instance
packetsPointer to the buffers of command, addr, data and etc.
num_packetThe number of packets in packets.
asyncIndicate whether this is a asynchronous request.
timeoutMaximum Time allowed for this request
Return values
0If successful.
-EIOGeneral input / output error.

◆ mspi_emul_find_emul

typedef struct mspi_emul *(* mspi_emul_find_emul) (const struct device *dev, uint16_t dev_idx)

#include <zephyr/drivers/mspi_emul.h>

Find an emulator present on a MSPI bus.

At present the function is used only to find an emulator of the host device. It may be useful in systems with the SPI flash chips.

Parameters
devMSPI emulation controller device
dev_idxDevice index from device tree.
Returns
mspi_emul to use
NULL if not found

◆ mspi_emul_trigger_event

typedef int(* mspi_emul_trigger_event) (const struct device *dev, enum mspi_bus_event evt_type)

#include <zephyr/drivers/mspi_emul.h>

Triggers an event on the emulator of MSPI controller side which causes calling specific callbacks.

Parameters
devMSPI emulation controller device
evt_typeEvent type to be triggered
See also
mspi_bus_event
Return values
0If successful.
-EIOGeneral input / output error.

Function Documentation

◆ mspi_emul_register()

int mspi_emul_register ( const struct device * dev,
struct mspi_emul * emul )

#include <zephyr/drivers/mspi_emul.h>

Register an emulated device on the controller.

Parameters
devMSPI emulation controller device
emulMSPI device emulator to be registered
Returns
0 indicating success (always)