Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
emul.h File Reference

Public APIs for the device emulation framework. More...

Go to the source code of this file.

Data Structures

 Structure uniquely identifying a device to be emulated. More...
struct  emul_list_for_bus
 List of emulators attached to a bus. More...
struct  no_bus_emul
 Emulator API stub when an emulator is not actually placed on a bus. More...
struct  emul
 An emulator instance - represents the target emulated device/peripheral that is interacted with through an emulated bus. More...
union  emul::bus
 Pointer to the emulated bus node. More...

Macros

#define EMUL_DT_NAME_GET(node_id)
 Use the devicetree node identifier as a unique name.
#define EMUL_DT_DEFINE(node_id, init_fn, data_ptr, cfg_ptr, bus_api, _backend_api)
 Define a new emulator.
#define EMUL_DT_INST_DEFINE(inst, ...)
 Like EMUL_DT_DEFINE(), but uses an instance of a DT_DRV_COMPAT compatible instead of a node identifier.
#define EMUL_DT_GET(node_id)
 Get a const struct emul* from a devicetree node identifier.
#define EMUL_DT_GET_OR_NULL(node_id)
 Utility macro to obtain an optional reference to an emulator.

Typedefs

typedef int(* emul_init_t) (const struct emul *emul, const struct device *parent)
 Standard callback for emulator initialisation providing the initialiser record and the device that calls the emulator functions.

Enumerations

enum  emul_bus_type {
  EMUL_BUS_TYPE_I2C , EMUL_BUS_TYPE_ESPI , EMUL_BUS_TYPE_SPI , EMUL_BUS_TYPE_MSPI ,
  EMUL_BUS_TYPE_UART , EMUL_BUS_TYPE_NONE
}
 The types of supported buses. More...

Functions

int emul_init_for_bus (const struct device *dev)
 Set up a list of emulators.
const struct emul * emul_get_binding (const char *name)
 Retrieve the emul structure for an emulator by name.

Detailed Description

Public APIs for the device emulation framework.