Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
port-endpoint.h
Go to the documentation of this file.
1
6/*
7 * Copyright 2024 NXP
8 * Copyright (c) 2024 tinyVision.ai Inc
9 *
10 * SPDX-License-Identifier: Apache-2.0
11 */
12
13#ifndef ZEPHYR_INCLUDE_DEVICETREE_PORT_ENDPOINT_H_
14#define ZEPHYR_INCLUDE_DEVICETREE_PORT_ENDPOINT_H_
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
36#define _DT_INST_PORT_BY_ID(inst, pid) \
37 COND_CODE_1(DT_NODE_EXISTS(DT_INST_CHILD(inst, ports)), \
38 (DT_CHILD(DT_INST_CHILD(inst, ports), port_##pid)), (DT_INST_CHILD(inst, port_##pid)))
39
87#define DT_INST_PORT_BY_ID(inst, pid) \
88 COND_CODE_1(DT_NODE_EXISTS(_DT_INST_PORT_BY_ID(inst, pid)), \
89 (_DT_INST_PORT_BY_ID(inst, pid)), (DT_INST_CHILD(inst, port)))
90
102#define _DT_INST_ENDPOINT_BY_ID(inst, pid, eid) \
103 DT_CHILD(DT_INST_PORT_BY_ID(inst, pid), endpoint_##eid)
104
163#define DT_INST_ENDPOINT_BY_ID(inst, pid, eid) \
164 COND_CODE_1(DT_NODE_EXISTS(_DT_INST_ENDPOINT_BY_ID(inst, pid, eid)), \
165 (_DT_INST_ENDPOINT_BY_ID(inst, pid, eid)), \
166 (DT_CHILD(DT_INST_PORT_BY_ID(inst, pid), endpoint)))
167
215#define DT_NODE_BY_ENDPOINT(ep) \
216 COND_CODE_1(DT_NODE_EXISTS(DT_CHILD(DT_PARENT(DT_GPARENT(ep)), ports)), \
217 (DT_PARENT(DT_GPARENT(ep))), (DT_GPARENT(ep)))
218
264#define DT_NODE_REMOTE_DEVICE(ep) \
265 DT_NODE_BY_ENDPOINT(DT_NODELABEL(DT_STRING_TOKEN(ep, remote_endpoint_label)))
266
271#ifdef __cplusplus
272}
273#endif
274
275#endif /* ZEPHYR_INCLUDE_DEVICETREE_PORT_ENDPOINT_H_ */