Zephyr API Documentation
4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
gpio.h
Go to the documentation of this file.
1
5
6
/*
7
* Copyright (c) 2020, Linaro Ltd.
8
* Copyright (c) 2020 Nordic Semiconductor
9
*
10
* SPDX-License-Identifier: Apache-2.0
11
*/
12
13
#ifndef ZEPHYR_INCLUDE_DEVICETREE_GPIO_H_
14
#define ZEPHYR_INCLUDE_DEVICETREE_GPIO_H_
15
16
#ifdef __cplusplus
17
extern
"C"
{
18
#endif
19
26
54
#define DT_GPIO_CTLR_BY_IDX(node_id, gpio_pha, idx) \
55
DT_PHANDLE_BY_IDX(node_id, gpio_pha, idx)
56
66
#define DT_GPIO_CTLR(node_id, gpio_pha) \
67
DT_GPIO_CTLR_BY_IDX(node_id, gpio_pha, 0)
68
110
#define DT_GPIO_PIN_BY_IDX(node_id, gpio_pha, idx) \
111
DT_PHA_BY_IDX(node_id, gpio_pha, idx, pin)
112
121
#define DT_GPIO_PIN(node_id, gpio_pha) \
122
DT_GPIO_PIN_BY_IDX(node_id, gpio_pha, 0)
123
166
#define DT_GPIO_FLAGS_BY_IDX(node_id, gpio_pha, idx) \
167
DT_PHA_BY_IDX_OR(node_id, gpio_pha, idx, flags, 0)
168
177
#define DT_GPIO_FLAGS(node_id, gpio_pha) \
178
DT_GPIO_FLAGS_BY_IDX(node_id, gpio_pha, 0)
179
218
#define DT_NUM_GPIO_HOGS(node_id) \
219
COND_CODE_1(IS_ENABLED(DT_CAT(node_id, _GPIO_HOGS_EXISTS)), \
220
(DT_CAT(node_id, _GPIO_HOGS_NUM)), (0))
221
263
#define DT_GPIO_HOG_PIN_BY_IDX(node_id, idx) \
264
DT_CAT4(node_id, _GPIO_HOGS_IDX_, idx, _VAL_pin)
265
308
#define DT_GPIO_HOG_FLAGS_BY_IDX(node_id, idx) \
309
COND_CODE_1(IS_ENABLED(DT_CAT4(node_id, _GPIO_HOGS_IDX_, idx, _VAL_flags_EXISTS)), \
310
(DT_CAT4(node_id, _GPIO_HOGS_IDX_, idx, _VAL_flags)), (0))
311
322
#define DT_INST_GPIO_PIN_BY_IDX(inst, gpio_pha, idx) \
323
DT_GPIO_PIN_BY_IDX(DT_DRV_INST(inst), gpio_pha, idx)
324
333
#define DT_INST_GPIO_PIN(inst, gpio_pha) \
334
DT_INST_GPIO_PIN_BY_IDX(inst, gpio_pha, 0)
335
346
#define DT_INST_GPIO_FLAGS_BY_IDX(inst, gpio_pha, idx) \
347
DT_GPIO_FLAGS_BY_IDX(DT_DRV_INST(inst), gpio_pha, idx)
348
357
#define DT_INST_GPIO_FLAGS(inst, gpio_pha) \
358
DT_INST_GPIO_FLAGS_BY_IDX(inst, gpio_pha, 0)
359
363
364
#ifdef __cplusplus
365
}
366
#endif
367
368
#endif
/* ZEPHYR_INCLUDE_DEVICETREE_GPIO_H_ */
zephyr
devicetree
gpio.h
Generated on
for Zephyr API Documentation by
1.14.0