Skip to content

Commit 4c4e2c5

Browse files
gmarullcarlescufi
authored andcommitted
drivers: spi: fix spi_config structure documentation
`@param` can't be used to document struct fields. Inline each field documentation and improve it. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 2c3165d commit 4c4e2c5

File tree

1 file changed

+29
-26
lines changed
  • include/zephyr/drivers

1 file changed

+29
-26
lines changed

include/zephyr/drivers/spi.h

+29-26
Original file line numberDiff line numberDiff line change
@@ -280,34 +280,37 @@ typedef uint16_t spi_operation_t;
280280

281281
/**
282282
* @brief SPI controller configuration structure
283-
*
284-
* @param frequency is the bus frequency in Hertz
285-
* @param operation is a bit field with the following parts:
286-
*
287-
* operational mode [ 0 ] - master or slave.
288-
* mode [ 1 : 3 ] - Polarity, phase and loop mode.
289-
* transfer [ 4 ] - LSB or MSB first.
290-
* word_size [ 5 : 10 ] - Size of a data frame in bits.
291-
* duplex [ 11 ] - full/half duplex.
292-
* cs_hold [ 12 ] - Hold on the CS line if possible.
293-
* lock_on [ 13 ] - Keep resource locked for the caller.
294-
* cs_active_high [ 14 ] - Active high CS logic.
295-
* format [ 15 ] - Motorola or TI frame format (optional).
296-
* if @kconfig{CONFIG_SPI_EXTENDED_MODES} is defined:
297-
* lines [ 16 : 17 ] - MISO lines: Single/Dual/Quad/Octal.
298-
* reserved [ 18 : 31 ] - reserved for future use.
299-
* @param slave is the slave number from 0 to host controller slave limit.
300-
* @param cs GPIO chip-select line (optional, must be initialized to zero if not
301-
* used).
302-
* @warning Most drivers use pointer comparison to determine whether a
303-
* passed configuration is different from one used in a previous
304-
* transaction. Changes to fields in the structure may not be
305-
* detected.
306283
*/
307284
struct spi_config {
308-
uint32_t frequency;
309-
spi_operation_t operation;
310-
uint16_t slave;
285+
/** @brief Bus frequency in Hertz. */
286+
uint32_t frequency;
287+
/**
288+
* @brief Operation flags.
289+
*
290+
* It is a bit field with the following parts:
291+
*
292+
* - 0: Master or slave.
293+
* - 1..3: Polarity, phase and loop mode.
294+
* - 4: LSB or MSB first.
295+
* - 5..10: Size of a data frame in bits.
296+
* - 11: Full/half duplex.
297+
* - 12: Hold on the CS line if possible.
298+
* - 13: Keep resource locked for the caller.
299+
* - 14: Active high CS logic.
300+
* - 15: Motorola or TI frame format (optional).
301+
*
302+
* If @kconfig{CONFIG_SPI_EXTENDED_MODES} is enabled:
303+
*
304+
* - 16..17: MISO lines (Single/Dual/Quad/Octal).
305+
* - 18..31: Reserved for future use.
306+
*/
307+
spi_operation_t operation;
308+
/** @brief Slave number from 0 to host controller slave limit. */
309+
uint16_t slave;
310+
/**
311+
* @brief GPIO chip-select line (optional, must be initialized to zero
312+
* if not used).
313+
*/
311314
struct spi_cs_control cs;
312315
};
313316

0 commit comments

Comments
 (0)