Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
can.h
Go to the documentation of this file.
1
5
6/*
7 * Copyright (c) 2022 Vestas Wind Systems A/S
8 *
9 * SPDX-License-Identifier: Apache-2.0
10 */
11
12#ifndef ZEPHYR_INCLUDE_DEVICETREE_CAN_H_
13#define ZEPHYR_INCLUDE_DEVICETREE_CAN_H_
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
25
75#define DT_CAN_TRANSCEIVER_MIN_BITRATE(node_id, min) \
76 COND_CODE_1(DT_NODE_HAS_PROP(node_id, phys), \
77 MAX(DT_PROP_OR(DT_PHANDLE(node_id, phys), min_bitrate, 0), min), \
78 MAX(DT_PROP_OR(DT_CHILD(node_id, can_transceiver), min_bitrate, min), min))
79
118#define DT_CAN_TRANSCEIVER_MAX_BITRATE(node_id, max) \
119 COND_CODE_1(DT_NODE_HAS_PROP(node_id, phys), \
120 MIN(DT_PROP(DT_PHANDLE(node_id, phys), max_bitrate), max), \
121 MIN(DT_PROP_OR(DT_CHILD(node_id, can_transceiver), max_bitrate, max), max))
122
130#define DT_INST_CAN_TRANSCEIVER_MIN_BITRATE(inst, min) \
131 DT_CAN_TRANSCEIVER_MIN_BITRATE(DT_DRV_INST(inst), min)
132
140#define DT_INST_CAN_TRANSCEIVER_MAX_BITRATE(inst, max) \
141 DT_CAN_TRANSCEIVER_MAX_BITRATE(DT_DRV_INST(inst), max)
142
146
147#ifdef __cplusplus
148}
149#endif
150
151#endif /* ZEPHYR_INCLUDE_DEVICETREE_CAN_H_ */