Zephyr Project API
4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
devicetree.h
Go to the documentation of this file.
1
/*
2
* Copyright 2022 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_DRIVERS_I3C_DEVICETREE_H_
8
#define ZEPHYR_INCLUDE_DRIVERS_I3C_DEVICETREE_H_
9
17
#include <
stdint.h
>
18
19
#include <
zephyr/device.h
>
20
#include <
zephyr/devicetree.h
>
21
#include <
zephyr/sys/util.h
>
22
23
#ifdef __cplusplus
24
extern
"C"
{
25
#endif
26
36
#define I3C_DEVICE_ID_DT(node_id) \
37
{ \
38
.pid = ((uint64_t)DT_PROP_BY_IDX(node_id, reg, 1) << 32)\
39
| DT_PROP_BY_IDX(node_id, reg, 2), \
40
}
41
52
#define I3C_DEVICE_ID_DT_INST(inst) \
53
I3C_DEVICE_ID_DT(DT_DRV_INST(inst))
54
65
#define I3C_DEVICE_DESC_DT(node_id) \
66
{ \
67
.bus = DEVICE_DT_GET(DT_BUS(node_id)), \
68
.dev = DEVICE_DT_GET(node_id), \
69
.static_addr = DT_PROP_BY_IDX(node_id, reg, 0), \
70
.pid = ((uint64_t)DT_PROP_BY_IDX(node_id, reg, 1) << 32)\
71
| DT_PROP_BY_IDX(node_id, reg, 2), \
72
.init_dynamic_addr = \
73
DT_PROP_OR(node_id, assigned_address, 0), \
74
.supports_setaasa = DT_PROP(node_id, supports_setaasa), \
75
},
76
88
#define I3C_DEVICE_DESC_DT_INST(inst) \
89
I3C_DEVICE_DESC_DT(DT_DRV_INST(inst))
90
97
#define I3C_DEVICE_DESC_DT_FILTERED(node_id) \
98
COND_CODE_0(DT_PROP_BY_IDX(node_id, reg, 1), \
99
(), (I3C_DEVICE_DESC_DT(node_id)))
100
109
#define I3C_DEVICE_ARRAY_DT(node_id) \
110
{ \
111
DT_FOREACH_CHILD_STATUS_OKAY( \
112
node_id, \
113
I3C_DEVICE_DESC_DT_FILTERED) \
114
}
115
126
#define I3C_DEVICE_ARRAY_DT_INST(inst) \
127
I3C_DEVICE_ARRAY_DT(DT_DRV_INST(inst))
128
154
#define I3C_DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, level, \
155
prio, api, ...) \
156
DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, level, \
157
prio, api, __VA_ARGS__)
158
167
#define I3C_DEVICE_DT_INST_DEFINE(inst, ...) \
168
I3C_DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
169
179
#define I3C_I2C_DEVICE_DESC_DT(node_id) \
180
{ \
181
.bus = DEVICE_DT_GET(DT_BUS(node_id)), \
182
.addr = DT_PROP_BY_IDX(node_id, reg, 0), \
183
.lvr = DT_PROP_BY_IDX(node_id, reg, 2), \
184
},
185
196
#define I3C_I2C_DEVICE_DESC_DT_INST(inst) \
197
I3C_I2C_DEVICE_DESC_DT(DT_DRV_INST(inst))
198
199
206
#define I3C_I2C_DEVICE_DESC_DT_FILTERED(node_id) \
207
COND_CODE_0(DT_PROP_BY_IDX(node_id, reg, 1), \
208
(I3C_I2C_DEVICE_DESC_DT(node_id)), ())
209
218
#define I3C_I2C_DEVICE_ARRAY_DT(node_id) \
219
{ \
220
DT_FOREACH_CHILD_STATUS_OKAY( \
221
node_id, \
222
I3C_I2C_DEVICE_DESC_DT_FILTERED) \
223
}
224
235
#define I3C_I2C_DEVICE_ARRAY_DT_INST(inst) \
236
I3C_I2C_DEVICE_ARRAY_DT(DT_DRV_INST(inst))
237
238
#ifdef __cplusplus
239
}
240
#endif
241
246
#endif
/* ZEPHYR_INCLUDE_DRIVERS_I3C_DEVICETREE_H_ */
device.h
devicetree.h
Devicetree main header.
stdint.h
util.h
Misc utilities.
include
zephyr
drivers
i3c
devicetree.h
Generated on Mon Nov 25 2024 09:17:59 for Zephyr Project API by
1.9.8