Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mspi.h File Reference

Public APIs for MSPI driver. More...

#include <errno.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/types.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/mspi/devicetree.h>
#include <syscalls/mspi.h>

Go to the source code of this file.

Data Structures

struct  mspi_timing_cfg
 Stub for struct timing_cfg. More...
 
struct  mspi_dev_id
 MSPI device ID The controller can identify its devices and determine whether the access is allowed in a multiple device scheme. More...
 
struct  mspi_cfg
 MSPI controller configuration. More...
 
struct  mspi_dt_spec
 MSPI DT information. More...
 
struct  mspi_dev_cfg
 MSPI controller device specific configuration. More...
 
struct  mspi_xip_cfg
 MSPI controller XIP configuration. More...
 
struct  mspi_scramble_cfg
 MSPI controller scramble configuration. More...
 
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...
 
struct  mspi_event_data
 MSPI event data. More...
 
struct  mspi_event
 MSPI event. More...
 
struct  mspi_callback_context
 MSPI callback context. More...
 
struct  mspi_driver_api
 

Typedefs

typedef void(* mspi_callback_handler_t) (struct mspi_callback_context *mspi_cb_ctx,...)
 Define the application callback handler function signature.
 
typedef int(* mspi_api_config) (const struct mspi_dt_spec *spec)
 MSPI driver API definition and system call entry points.
 
typedef int(* mspi_api_dev_config) (const struct device *controller, const struct mspi_dev_id *dev_id, const enum mspi_dev_cfg_mask param_mask, const struct mspi_dev_cfg *cfg)
 
typedef int(* mspi_api_get_channel_status) (const struct device *controller, uint8_t ch)
 
typedef int(* mspi_api_transceive) (const struct device *controller, const struct mspi_dev_id *dev_id, const struct mspi_xfer *req)
 
typedef int(* mspi_api_register_callback) (const struct device *controller, const struct mspi_dev_id *dev_id, const enum mspi_bus_event evt_type, mspi_callback_handler_t cb, struct mspi_callback_context *ctx)
 
typedef int(* mspi_api_xip_config) (const struct device *controller, const struct mspi_dev_id *dev_id, const struct mspi_xip_cfg *xip_cfg)
 
typedef int(* mspi_api_scramble_config) (const struct device *controller, const struct mspi_dev_id *dev_id, const struct mspi_scramble_cfg *scramble_cfg)
 
typedef int(* mspi_api_timing_config) (const struct device *controller, const struct mspi_dev_id *dev_id, const uint32_t param_mask, void *timing_cfg)
 

Enumerations

enum  mspi_op_mode { MSPI_OP_MODE_CONTROLLER = 0 , MSPI_OP_MODE_PERIPHERAL = 1 }
 MSPI operational mode. More...
 
enum  mspi_duplex { MSPI_HALF_DUPLEX = 0 , MSPI_FULL_DUPLEX = 1 }
 MSPI duplex mode. More...
 
enum  mspi_io_mode {
  MSPI_IO_MODE_SINGLE = 0 , MSPI_IO_MODE_DUAL = 1 , MSPI_IO_MODE_DUAL_1_1_2 = 2 , MSPI_IO_MODE_DUAL_1_2_2 = 3 ,
  MSPI_IO_MODE_QUAD = 4 , MSPI_IO_MODE_QUAD_1_1_4 = 5 , MSPI_IO_MODE_QUAD_1_4_4 = 6 , MSPI_IO_MODE_OCTAL = 7 ,
  MSPI_IO_MODE_OCTAL_1_1_8 = 8 , MSPI_IO_MODE_OCTAL_1_8_8 = 9 , MSPI_IO_MODE_HEX = 10 , MSPI_IO_MODE_HEX_8_8_16 = 11 ,
  MSPI_IO_MODE_HEX_8_16_16 = 12 , MSPI_IO_MODE_MAX
}
 MSPI I/O mode capabilities Postfix like 1_4_4 stands for the number of lines used for command, address and data phases. More...
 
enum  mspi_data_rate {
  MSPI_DATA_RATE_SINGLE = 0 , MSPI_DATA_RATE_S_S_D = 1 , MSPI_DATA_RATE_S_D_D = 2 , MSPI_DATA_RATE_DUAL = 3 ,
  MSPI_DATA_RATE_MAX
}
 MSPI data rate capabilities SINGLE stands for single data rate for all phases. More...
 
enum  mspi_cpp_mode { MSPI_CPP_MODE_0 = 0 , MSPI_CPP_MODE_1 = 1 , MSPI_CPP_MODE_2 = 2 , MSPI_CPP_MODE_3 = 3 }
 MSPI Polarity & Phase Modes. More...
 
enum  mspi_endian { MSPI_XFER_LITTLE_ENDIAN = 0 , MSPI_XFER_BIG_ENDIAN = 1 }
 MSPI Endian. More...
 
enum  mspi_ce_polarity { MSPI_CE_ACTIVE_LOW = 0 , MSPI_CE_ACTIVE_HIGH = 1 }
 MSPI chip enable polarity. More...
 
enum  mspi_bus_event { MSPI_BUS_RESET = 0 , MSPI_BUS_ERROR = 1 , MSPI_BUS_XFER_COMPLETE = 2 , MSPI_BUS_EVENT_MAX }
 MSPI bus event. More...
 
enum  mspi_bus_event_cb_mask { MSPI_BUS_NO_CB = 0 , MSPI_BUS_RESET_CB = BIT(0) , MSPI_BUS_ERROR_CB = BIT(1) , MSPI_BUS_XFER_COMPLETE_CB = BIT(2) }
 MSPI bus event callback mask This is a preliminary list same as mspi_bus_event. More...
 
enum  mspi_xfer_mode { MSPI_PIO , MSPI_DMA }
 MSPI transfer modes. More...
 
enum  mspi_xfer_direction { MSPI_RX , MSPI_TX }
 MSPI transfer directions. More...
 
enum  mspi_dev_cfg_mask {
  MSPI_DEVICE_CONFIG_NONE = 0 , MSPI_DEVICE_CONFIG_CE_NUM = BIT(0) , MSPI_DEVICE_CONFIG_FREQUENCY = BIT(1) , MSPI_DEVICE_CONFIG_IO_MODE = BIT(2) ,
  MSPI_DEVICE_CONFIG_DATA_RATE = BIT(3) , MSPI_DEVICE_CONFIG_CPP = BIT(4) , MSPI_DEVICE_CONFIG_ENDIAN = BIT(5) , MSPI_DEVICE_CONFIG_CE_POL = BIT(6) ,
  MSPI_DEVICE_CONFIG_DQS = BIT(7) , MSPI_DEVICE_CONFIG_RX_DUMMY = BIT(8) , MSPI_DEVICE_CONFIG_TX_DUMMY = BIT(9) , MSPI_DEVICE_CONFIG_READ_CMD = BIT(10) ,
  MSPI_DEVICE_CONFIG_WRITE_CMD = BIT(11) , MSPI_DEVICE_CONFIG_CMD_LEN = BIT(12) , MSPI_DEVICE_CONFIG_ADDR_LEN = BIT(13) , MSPI_DEVICE_CONFIG_MEM_BOUND = BIT(14) ,
  MSPI_DEVICE_CONFIG_BREAK_TIME = BIT(15) , MSPI_DEVICE_CONFIG_ALL = BIT_MASK(16)
}
 MSPI controller device specific configuration mask. More...
 
enum  mspi_xip_permit { MSPI_XIP_READ_WRITE = 0 , MSPI_XIP_READ_ONLY = 1 }
 MSPI XIP access permissions. More...
 
enum  mspi_timing_param { MSPI_TIMING_PARAM_DUMMY }
 Stub for timing parameter. More...
 

Functions

int mspi_config (const struct mspi_dt_spec *spec)
 Configure a MSPI controller.
 
int mspi_dev_config (const struct device *controller, const struct mspi_dev_id *dev_id, const enum mspi_dev_cfg_mask param_mask, const struct mspi_dev_cfg *cfg)
 Configure a MSPI controller with device specific parameters.
 
int mspi_get_channel_status (const struct device *controller, uint8_t ch)
 Query to see if it a channel is ready.
 
int mspi_transceive (const struct device *controller, const struct mspi_dev_id *dev_id, const struct mspi_xfer *req)
 Transfer request over MSPI.
 
int mspi_xip_config (const struct device *controller, const struct mspi_dev_id *dev_id, const struct mspi_xip_cfg *cfg)
 Configure a MSPI XIP settings.
 
int mspi_scramble_config (const struct device *controller, const struct mspi_dev_id *dev_id, const struct mspi_scramble_cfg *cfg)
 Configure a MSPI scrambling settings.
 
int mspi_timing_config (const struct device *controller, const struct mspi_dev_id *dev_id, const uint32_t param_mask, void *cfg)
 Configure a MSPI timing settigs.
 
static int mspi_register_callback (const struct device *controller, const struct mspi_dev_id *dev_id, const enum mspi_bus_event evt_type, mspi_callback_handler_t cb, struct mspi_callback_context *ctx)
 Register the mspi callback functions.
 

Detailed Description

Public APIs for MSPI driver.