Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
emul_stub_device.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google LLC
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_EMUL_STUB_DEVICE_H_
14#define ZEPHYR_INCLUDE_EMUL_STUB_DEVICE_H_
15
16#include <zephyr/device.h>
17#include <zephyr/devicetree.h>
18
19/*
20 * Needed for emulators without corresponding DEVICE_DT_DEFINE drivers
21 */
22
24struct emul_stub_dev_data {
25 /* Stub */
26};
27struct emul_stub_dev_config {
28 /* Stub */
29};
30struct emul_stub_dev_api {
31 /* Stub */
32};
34
43#define EMUL_STUB_DEVICE(n) \
44 __maybe_unused static int emul_init_stub_##n(const struct device *dev) \
45 { \
46 ARG_UNUSED(dev); \
47 return 0; \
48 } \
49 \
50 static struct emul_stub_dev_data stub_data_##n; \
51 static struct emul_stub_dev_config stub_config_##n; \
52 static struct emul_stub_dev_api stub_api_##n; \
53 DEVICE_DT_INST_DEFINE(n, &emul_init_stub_##n, NULL, &stub_data_##n, &stub_config_##n, \
54 POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &stub_api_##n);
55
56#endif /* ZEPHYR_INCLUDE_EMUL_STUB_DEVICE_H_ */
APIs and macros for the Zephyr device model.
Devicetree main header.