zephyr/include/devicetree/zephyr.h
Henrik Brix Andersen c817a09b0a canbus: rename zephyr,can-primary chosen property to zephyr,canbus
Rename the Zephyr chosen property for specifying the default CAN bus
controller from "zephyr,can-primary" to "zephyr,canbus".

The "zephyr,can-primary" property name was selected in antipation of
adding support for redundant CAN networks, which we have yet to
add. Meanwhile, the "primary" term causes confusion for non-redundant
CAN bus configurations (and the "can" term doesn't match the name of the
Zephyr CAN bus subsystem).

The CAN in Automation (CiA) 302-6, which deals with CANopen network
redundancy, uses the terms "default interface" and "redundant
interface". If/when we add support for redundant CAN networks, the
"zephyr,canbus" chosen property can be supplemented with a
"zephyr,canbus-redundant" chosen property.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-07 09:05:39 -05:00

76 lines
1.9 KiB
C

/*
* Copyright (c) 2020 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief Zephyr-specific devicetree /chosen properties
*/
#ifndef ZEPHYR_INCLUDE_DEVICETREE_ZEPHYR_H_
#define ZEPHYR_INCLUDE_DEVICETREE_ZEPHYR_H_
/**
* @defgroup devicetree-zephyr Zephyr's /chosen nodes
* @ingroup devicetree
* @{
*/
/*
* This file is currently deliberately not defining macros for some
* existing zephyr,foo chosen nodes, such as zephyr,sram, until there
* are users for them. Feel free to extend it as needed.
*
* Getting doxygen to play along with all the dts-specific ifdeffery
* proved too complex for DT_CHOSEN_ZEPHYR_ENTROPY_LABEL, so we document
* everything under a DT_DOXYGEN define.
*/
#ifdef DT_DOXYGEN
/**
* @def DT_CHOSEN_ZEPHYR_ENTROPY_LABEL
*
* @brief If there is a chosen node zephyr,entropy property which has
* a label property, that property's value. Undefined otherwise.
*/
#define DT_CHOSEN_ZEPHYR_ENTROPY_LABEL ""
/**
* @def DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL
*
* @brief If there is a chosen node zephyr,flash-controller property which has
* a label property, that property's value. Undefined otherwise.
*/
#define DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL ""
/**
* @def DT_CHOSEN_ZEPHYR_CANBUS_LABEL
*
* @brief If there is a chosen node zephyr,canbus property which has
* a label property, that property's value. Undefined otherwise.
*/
#define DT_CHOSEN_ZEPHYR_CANBUS_LABEL ""
#endif /* DT_DOXYGEN */
#if DT_NODE_HAS_PROP(DT_CHOSEN(zephyr_entropy), label)
#define DT_CHOSEN_ZEPHYR_ENTROPY_LABEL DT_LABEL(DT_CHOSEN(zephyr_entropy))
#endif
#if DT_NODE_HAS_PROP(DT_CHOSEN(zephyr_flash_controller), label)
#define DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL \
DT_LABEL(DT_CHOSEN(zephyr_flash_controller))
#endif
#if DT_NODE_HAS_PROP(DT_CHOSEN(zephyr_canbus), label)
#define DT_CHOSEN_ZEPHYR_CANBUS_LABEL \
DT_LABEL(DT_CHOSEN(zephyr_canbus))
#endif
/**
* @}
*/
#endif