Zephyr API Documentation
3.7.99
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
},
75
87
#define I3C_DEVICE_DESC_DT_INST(inst) \
88
I3C_DEVICE_DESC_DT(DT_DRV_INST(inst))
89
96
#define I3C_DEVICE_DESC_DT_FILTERED(node_id) \
97
COND_CODE_0(DT_PROP_BY_IDX(node_id, reg, 1), \
98
(), (I3C_DEVICE_DESC_DT(node_id)))
99
108
#define I3C_DEVICE_ARRAY_DT(node_id) \
109
{ \
110
DT_FOREACH_CHILD_STATUS_OKAY( \
111
node_id, \
112
I3C_DEVICE_DESC_DT_FILTERED) \
113
}
114
125
#define I3C_DEVICE_ARRAY_DT_INST(inst) \
126
I3C_DEVICE_ARRAY_DT(DT_DRV_INST(inst))
127
153
#define I3C_DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, level, \
154
prio, api, ...) \
155
DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, level, \
156
prio, api, __VA_ARGS__)
157
166
#define I3C_DEVICE_DT_INST_DEFINE(inst, ...) \
167
I3C_DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
168
178
#define I3C_I2C_DEVICE_DESC_DT(node_id) \
179
{ \
180
.bus = DEVICE_DT_GET(DT_BUS(node_id)), \
181
.addr = DT_PROP_BY_IDX(node_id, reg, 0), \
182
.lvr = DT_PROP_BY_IDX(node_id, reg, 2), \
183
},
184
195
#define I3C_I2C_DEVICE_DESC_DT_INST(inst) \
196
I3C_I2C_DEVICE_DESC_DT(DT_DRV_INST(inst))
197
198
205
#define I3C_I2C_DEVICE_DESC_DT_FILTERED(node_id) \
206
COND_CODE_0(DT_PROP_BY_IDX(node_id, reg, 1), \
207
(I3C_I2C_DEVICE_DESC_DT(node_id)), ())
208
217
#define I3C_I2C_DEVICE_ARRAY_DT(node_id) \
218
{ \
219
DT_FOREACH_CHILD_STATUS_OKAY( \
220
node_id, \
221
I3C_I2C_DEVICE_DESC_DT_FILTERED) \
222
}
223
234
#define I3C_I2C_DEVICE_ARRAY_DT_INST(inst) \
235
I3C_I2C_DEVICE_ARRAY_DT(DT_DRV_INST(inst))
236
237
#ifdef __cplusplus
238
}
239
#endif
240
245
#endif
/* ZEPHYR_INCLUDE_DRIVERS_I3C_DEVICETREE_H_ */
device.h
devicetree.h
Devicetree main header.
stdint.h
util.h
Misc utilities.
zephyr
drivers
i3c
devicetree.h
Generated on Sat Sep 7 2024 21:06:07 for Zephyr API Documentation by
1.12.0