Skip to content

Commit 3a8e048

Browse files
author
Tomasz Bursztyka
committed
spi: Adding a new configuration bit for the frame format
So TI will no longer be the only frame format available, though it will still be the default one. It will be possible to select the Motorola frame format when relevant. Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent 5e035b0 commit 3a8e048

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

include/drivers/spi.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ extern "C" {
117117
#define SPI_CS_ACTIVE_HIGH BIT(14)
118118
/** @} */
119119

120+
/**
121+
* @name SPI Frame Format
122+
* @{
123+
*
124+
* 2 frame formats are exposed: Motorola and TI.
125+
* The main difference is the behavior of the CS line. In Motorala it stays
126+
* active the whole transfer. In TI, it's active only one serial clock period
127+
* prior to actually make the transfer, it is thus inactive during the transfer,
128+
* which ends when the clocks ends as well.
129+
* By default, as it is the most commonly used, the Motorola frame format
130+
* will prevail.
131+
*/
132+
#define SPI_FRAME_FORMAT_MOTOROLA (0U << 15)
133+
#define SPI_FRAME_FORMAT_TI (1U << 15)
134+
/** @} */
135+
120136
/**
121137
* @name SPI MISO lines (if @kconfig{CONFIG_SPI_EXTENDED_MODES} is enabled)
122138
* @{
@@ -248,7 +264,7 @@ struct spi_cs_control {
248264
* cs_hold [ 12 ] - Hold on the CS line if possible.
249265
* lock_on [ 13 ] - Keep resource locked for the caller.
250266
* cs_active_high [ 14 ] - Active high CS logic.
251-
* reserved [ 15 ] - reserved for future use.
267+
* format [ 15 ] - Motorola or TI frame format (optional).
252268
* if @kconfig{CONFIG_SPI_EXTENDED_MODES} is defined:
253269
* lines [ 16 : 17 ] - MISO lines: Single/Dual/Quad/Octal.
254270
* reserved [ 18 : 31 ] - reserved for future use.

0 commit comments

Comments
 (0)