dts/bindings: Add a dedicated property for duplex mode on SPI device
Users will have to include dt-bindings/spi/spi.h in order to use the relevant flags fol this property. For instance: ... duplex = <SPI_HALF_DUPLEX>; .... By default all SPI device are configured to be full duplex so the property is optional. This property makes sense only for devices that can be configured on either modes. Which, in such case, it will need to use DT_INST_PROP(<instance number>, duplex) macro call to retrieve the property value. Others can fully ignore it. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
01b9813d73
commit
4bd5935302
3 changed files with 43 additions and 9 deletions
29
include/dt-bindings/spi/spi.h
Normal file
29
include/dt-bindings/spi/spi.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_SPI_SPI_H_
|
||||
#define ZEPHYR_INCLUDE_DT_BINDINGS_SPI_SPI_H_
|
||||
|
||||
/**
|
||||
* @brief SPI Interface
|
||||
* @defgroup spi_interface SPI Interface
|
||||
* @ingroup io_interfaces
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief SPI duplex mode
|
||||
*
|
||||
* Some controllers support half duplex transfer, which results in 3-wire usage.
|
||||
* By default, full duplex will prevail.
|
||||
*/
|
||||
#define SPI_FULL_DUPLEX (0U << 11)
|
||||
#define SPI_HALF_DUPLEX (1U << 11)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_SPI_SPI_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue