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

Stub device support for emulators without a corresponding driver. More...

#include <zephyr/device.h>
#include <zephyr/devicetree.h>

Go to the source code of this file.

Macros

#define EMUL_STUB_DEVICE(n)
 Stub out a device for an emulator instance.

Detailed Description

Stub device support for emulators without a corresponding driver.

Macro Definition Documentation

◆ EMUL_STUB_DEVICE

#define EMUL_STUB_DEVICE ( n)
Value:
__maybe_unused static int emul_init_stub_##n(const struct device *dev) \
{ \
ARG_UNUSED(dev); \
return 0; \
} \
\
static struct emul_stub_dev_data stub_data_##n; \
static struct emul_stub_dev_config stub_config_##n; \
static struct emul_stub_dev_api stub_api_##n; \
DEVICE_DT_INST_DEFINE(n, &emul_init_stub_##n, NULL, &stub_data_##n, &stub_config_##n, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &stub_api_##n);
#define NULL
Definition iar_missing_defs.h:20
Runtime device structure (in ROM) per driver instance.
Definition device.h:543

Stub out a device for an emulator instance.

For every instance of a DT_DRV_COMPAT, define a stub device so that the emulator's devicetree node has a corresponding device.

Parameters
nDT_DRV_COMPAT instance number