Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
Macros | |
#define | DT_CAN_TRANSCEIVER_MIN_BITRATE(node_id, min) |
Get the minimum transceiver bitrate for a CAN controller. | |
#define | DT_CAN_TRANSCEIVER_MAX_BITRATE(node_id, max) |
Get the maximum transceiver bitrate for a CAN controller. | |
#define | DT_INST_CAN_TRANSCEIVER_MIN_BITRATE(inst, min) |
Get the minimum transceiver bitrate for a DT_DRV_COMPAT CAN controller. | |
#define | DT_INST_CAN_TRANSCEIVER_MAX_BITRATE(inst, max) |
Get the maximum transceiver bitrate for a DT_DRV_COMPAT CAN controller. | |
#define DT_CAN_TRANSCEIVER_MAX_BITRATE | ( | node_id, | |
max ) |
#include <zephyr/devicetree/can.h>
Get the maximum transceiver bitrate for a CAN controller.
The bitrate will be limited to the maximum bitrate supported by the CAN controller. If no CAN transceiver is present in the devicetree, the maximum bitrate will be that of the CAN controller.
Example devicetree fragment:
transceiver0: can-phy0 { compatible = "vnd,can-transceiver"; max-bitrate = <1000000>; #phy-cells = <0>; }; can0: can@... { compatible = "vnd,can-controller"; phys = <&transceiver0>; }; can1: can@... { compatible = "vnd,can-controller"; can-transceiver { max-bitrate = <2000000>; }; };
Example usage:
DT_CAN_TRANSCEIVER_MAX_BITRATE(DT_NODELABEL(can0), 5000000) // 1000000 DT_CAN_TRANSCEIVER_MAX_BITRATE(DT_NODELABEL(can1), 5000000) // 2000000 DT_CAN_TRANSCEIVER_MAX_BITRATE(DT_NODELABEL(can1), 1000000) // 1000000
node_id | node identifier |
max | maximum bitrate supported by the CAN controller |
#define DT_CAN_TRANSCEIVER_MIN_BITRATE | ( | node_id, | |
min ) |
#include <zephyr/devicetree/can.h>
Get the minimum transceiver bitrate for a CAN controller.
The bitrate will be limited to the minimum bitrate supported by the CAN controller. If no CAN transceiver is present in the devicetree, the minimum bitrate will be that of the CAN controller.
Example devicetree fragment:
transceiver0: can-phy0 { compatible = "vnd,can-transceiver"; min-bitrate = <15000>; max-bitrate = <1000000>; #phy-cells = <0>; }; can0: can@... { compatible = "vnd,can-controller"; phys = <&transceiver0>; }; can1: can@... { compatible = "vnd,can-controller"; can-transceiver { min-bitrate = <25000>; max-bitrate = <2000000>; }; }; can2: can@... { compatible = "vnd,can-controller"; can-transceiver { max-bitrate = <2000000>; }; };
Example usage:
DT_CAN_TRANSCEIVER_MIN_BITRATE(DT_NODELABEL(can0), 10000) // 15000 DT_CAN_TRANSCEIVER_MIN_BITRATE(DT_NODELABEL(can1), 0) // 250000 DT_CAN_TRANSCEIVER_MIN_BITRATE(DT_NODELABEL(can1), 50000) // 500000 DT_CAN_TRANSCEIVER_MIN_BITRATE(DT_NODELABEL(can2), 0) // 0
node_id | node identifier |
min | minimum bitrate supported by the CAN controller |
#define DT_INST_CAN_TRANSCEIVER_MAX_BITRATE | ( | inst, | |
max ) |
#include <zephyr/devicetree/can.h>
Get the maximum transceiver bitrate for a DT_DRV_COMPAT CAN controller.
inst | DT_DRV_COMPAT instance number |
max | maximum bitrate supported by the CAN controller |
#define DT_INST_CAN_TRANSCEIVER_MIN_BITRATE | ( | inst, | |
min ) |
#include <zephyr/devicetree/can.h>
Get the minimum transceiver bitrate for a DT_DRV_COMPAT CAN controller.
inst | DT_DRV_COMPAT instance number |
min | minimum bitrate supported by the CAN controller |