Zephyr API Documentation
3.7.0
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
7
#ifndef ZEPHYR_INCLUDE_EMUL_STUB_DEVICE_H_
8
#define ZEPHYR_INCLUDE_EMUL_STUB_DEVICE_H_
9
10
#include <
zephyr/device.h
>
11
#include <
zephyr/devicetree.h
>
12
13
/*
14
* Needed for emulators without corresponding DEVICE_DT_DEFINE drivers
15
*/
16
17
struct
emul_stub_dev_data
{
18
/* Stub */
19
};
20
struct
emul_stub_dev_config
{
21
/* Stub */
22
};
23
struct
emul_stub_dev_api
{
24
/* Stub */
25
};
26
27
/* For every instance of a DT_DRV_COMPAT stub out a device for that instance */
28
#define EMUL_STUB_DEVICE(n) \
29
__maybe_unused static int emul_init_stub_##n(const struct device *dev) \
30
{ \
31
ARG_UNUSED(dev); \
32
return 0; \
33
} \
34
\
35
static struct emul_stub_dev_data stub_data_##n; \
36
static struct emul_stub_dev_config stub_config_##n; \
37
static struct emul_stub_dev_api stub_api_##n; \
38
DEVICE_DT_INST_DEFINE(n, &emul_init_stub_##n, NULL, &stub_data_##n, &stub_config_##n, \
39
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &stub_api_##n);
40
41
#endif
/* ZEPHYR_INCLUDE_EMUL_STUB_DEVICE_H_ */
device.h
devicetree.h
Devicetree main header.
emul_stub_dev_api
Definition:
emul_stub_device.h:23
emul_stub_dev_config
Definition:
emul_stub_device.h:20
emul_stub_dev_data
Definition:
emul_stub_device.h:17
zephyr
drivers
emul_stub_device.h
Generated on Fri Jul 26 2024 14:01:56 for Zephyr API Documentation by
1.9.6