Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Emulators used to test drivers and higher-level code that uses them. More...
Modules | |
I2C Emulation Interface | |
I2C Emulation Interface. | |
SPI Emulation Interface | |
SPI Emulation Interface. | |
eSPI Emulation Interface | |
eSPI Emulation Interface | |
Data Structures | |
struct | emul_link_for_bus |
struct | emul_list_for_bus |
struct | emul |
Macros | |
#define | EMUL_REG_NAME(node_id) (_CONCAT(__emulreg_, node_id)) |
#define | EMUL_DEFINE(init_ptr, node_id, cfg_ptr) |
Typedefs | |
typedef int(* | emul_init_t) (const struct emul *emul, const struct device *parent) |
Functions | |
int | emul_init_for_bus_from_list (const struct device *dev, const struct emul_list_for_bus *list) |
Emulators used to test drivers and higher-level code that uses them.
#define EMUL_DEFINE | ( | init_ptr, | |
node_id, | |||
cfg_ptr | |||
) |
#include <include/drivers/emul.h>
Define a new emulator
This adds a new struct emul to the linker list of emulations. This is typically used in your emulator's DT_INST_FOREACH_STATUS_OKAY() clause.
init_ptr | function to call to initialise the emulator (see emul_init typedef) |
node_id | Node ID of the driver to emulate (e.g. DT_DRV_INST(n)) |
cfg_ptr | emulator-specific configuration data |
#define EMUL_REG_NAME | ( | node_id | ) | (_CONCAT(__emulreg_, node_id)) |
#include <include/drivers/emul.h>
#include <include/drivers/emul.h>
Standard callback for emulator initialisation providing the initialiser record and the device that calls the emulator functions.
emul | Emulator to init |
parent | Parent device that is using the emulator |
int emul_init_for_bus_from_list | ( | const struct device * | dev, |
const struct emul_list_for_bus * | list | ||
) |
#include <include/drivers/emul.h>
Set up a list of emulators
dev | Device the emulators are attached to (e.g. an I2C controller) |
list | List of devices to set up |