Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions dts/bindings/spi/spi-device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ properties:
enum:
- 0
- 2048
frame-format:
type: int
default: 0
required: false
description: |
Motorola or TI frame format. By default it's always Motorola's,
thus 0 as this is, by far, the most common format.
Use the macros not the actual enum value, here is the concordance
list (see dt-bindings/spi/spi.h)
0 SPI_FRAME_FORMAT_MOTOROLA
32768 SPI_FRAME_FORMAT_TI
enum:
- 0
- 32768
2 changes: 1 addition & 1 deletion include/drivers/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ struct spi_cs_control {
* cs_hold [ 12 ] - Hold on the CS line if possible.
* lock_on [ 13 ] - Keep resource locked for the caller.
* cs_active_high [ 14 ] - Active high CS logic.
* reserved [ 15 ] - reserved for future use.
* format [ 15 ] - Motorola or TI frame format (optional).
* if @kconfig{CONFIG_SPI_EXTENDED_MODES} is defined:
* lines [ 16 : 17 ] - MISO lines: Single/Dual/Quad/Octal.
* reserved [ 18 : 31 ] - reserved for future use.
Expand Down
16 changes: 16 additions & 0 deletions include/dt-bindings/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@
#define SPI_HALF_DUPLEX (1U << 11)
/** @} */

/**
* @name SPI Frame Format
* @{
*
* 2 frame formats are exposed: Motorola and TI.
* The main difference is the behavior of the CS line. In Motorala it stays
* active the whole transfer. In TI, it's active only one serial clock period
* prior to actually make the transfer, it is thus inactive during the transfer,
* which ends when the clocks ends as well.
* By default, as it is the most commonly used, the Motorola frame format
* will prevail.
*/
#define SPI_FRAME_FORMAT_MOTOROLA (0U << 15)
#define SPI_FRAME_FORMAT_TI (1U << 15)
/** @} */

/**
* @}
*/
Expand Down