Skip to content

Commit d74f97d

Browse files
dbkinderAnas Nashif
authored andcommitted
doc: improve spi.h doxygen comments layout
Doxygen comments for documenting structs have (known) issues, and the Breathe addon for Sphinx used to create our API docs has a known issue with forcing line breaks with @n or <br/> This patch tweaks the comments to use a method used in i2s.h to use @param comments for the members of a struct, and using 4 leading spaces (as done in i2s.h as well) to create a pre block for the bit-field layout comments. Fixes: #1415 Signed-off-by: David B. Kinder <[email protected]>
1 parent 6fa6758 commit d74f97d

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

include/spi.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ extern "C" {
128128
* This can be used to control a CS line via a GPIO line, instead of
129129
* using the controller inner CS logic.
130130
*
131-
* gpio_dev is a valid pointer to an actual GPIO device
132-
* gpio_pin is a number representing the gpio PIN that will be used
131+
* @param gpio_dev is a valid pointer to an actual GPIO device
132+
* @param gpio_pin is a number representing the gpio PIN that will be used
133133
* to act as a CS line
134-
* delay is a delay in microseconds to wait before starting the
134+
* @param delay is a delay in microseconds to wait before starting the
135135
* transmission and before releasing the CS line
136136
*/
137137
struct spi_cs_control {
@@ -143,24 +143,24 @@ struct spi_cs_control {
143143
/**
144144
* @brief SPI controller configuration structure
145145
*
146-
* dev is a valid pointer to an actual SPI device
147-
* frequency is the bus frequency in Hertz
148-
* operation is a bit field with the following parts:
149-
* operational mode [ 0 ] - master or slave.
150-
* mode [ 1 : 3 ] - Polarity, phase and loop mode.
151-
* transfer [ 4 ] - LSB or MSB first.
152-
* word_size [ 5 : 10 ] - Size of a data frame in bits.
153-
* lines [ 11 : 12 ] - MISO lines: Single/Dual/Quad.
154-
* cs_hold [ 13 ] - Hold on the CS line if possible.
155-
* lock_on [ 14 ] - Keep resource locked for the caller.
156-
* eeprom [ 15 ] - EEPROM mode.
157-
* vendor is a vendor specific bitfield
158-
* slave is the slave number from 0 to host controller slave limit.
146+
* @param dev is a valid pointer to an actual SPI device
147+
* @param frequency is the bus frequency in Hertz
148+
* @param operation is a bit field with the following parts:
159149
*
160-
* cs is a valid pointer on a struct spi_cs_control is CS line is
150+
* operational mode [ 0 ] - master or slave.
151+
* mode [ 1 : 3 ] - Polarity, phase and loop mode.
152+
* transfer [ 4 ] - LSB or MSB first.
153+
* word_size [ 5 : 10 ] - Size of a data frame in bits.
154+
* lines [ 11 : 12 ] - MISO lines: Single/Dual/Quad.
155+
* cs_hold [ 13 ] - Hold on the CS line if possible.
156+
* lock_on [ 14 ] - Keep resource locked for the caller.
157+
* eeprom [ 15 ] - EEPROM mode.
158+
* @param vendor is a vendor specific bitfield
159+
* @param slave is the slave number from 0 to host controller slave limit.
160+
* @param cs is a valid pointer on a struct spi_cs_control is CS line is
161161
* emulated through a gpio line, or NULL otherwise.
162162
*
163-
* Note: cs_hold, lock_on and eeprom_rx can be changed between consecutive
163+
* @note cs_hold, lock_on and eeprom_rx can be changed between consecutive
164164
* transceive call.
165165
*/
166166
struct spi_config {
@@ -177,10 +177,10 @@ struct spi_config {
177177
/**
178178
* @brief SPI buffer structure
179179
*
180-
* buf is a valid pointer on a data buffer, or NULL otherwise.
181-
* len is the length of the buffer or, if buf is NULL, will be the
182-
* length which as to be sent as dummy bytes (as TX buffer) or
183-
* the length of bytes that should be skipped (as RX buffer).
180+
* @param buf is a valid pointer on a data buffer, or NULL otherwise.
181+
* @param len is the length of the buffer or, if buf is NULL, will be the
182+
* length which as to be sent as dummy bytes (as TX buffer) or
183+
* the length of bytes that should be skipped (as RX buffer).
184184
*/
185185
struct spi_buf {
186186
void *buf;

0 commit comments

Comments
 (0)