Skip to content

Commit 169d35d

Browse files
kartbenfabiobaltieri
authored andcommitted
drivers: dai: doc: Cleanup Doxygen documentation
Fixed some improperly documented structs and uniformized DAI spelling. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent cfc3a3b commit 169d35d

File tree

1 file changed

+52
-37
lines changed
  • include/zephyr/drivers

1 file changed

+52
-37
lines changed

include/zephyr/drivers/dai.h

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
extern "C" {
3434
#endif
3535

36-
/** \brief Types of DAI
36+
/** @brief Types of DAI
3737
*
3838
* The type of the DAI. This ID type is used to configure bespoke DAI HW
3939
* settings.
@@ -61,7 +61,7 @@ enum dai_type {
6161
};
6262

6363
/**
64-
* @brief Dai Direction
64+
* @brief DAI Direction
6565
*/
6666
enum dai_dir {
6767
/** Receive data */
@@ -124,7 +124,7 @@ enum dai_trigger_cmd {
124124
*
125125
* Pause the transmission / reception of data at the end of the current
126126
* memory block. Behavior is implementation specific but usually this
127-
* state doesn't completely stop the clocks or transmission. The dai could
127+
* state doesn't completely stop the clocks or transmission. The DAI could
128128
* be transmitting 0's (silence), but it is not consuming data from outside.
129129
*/
130130
DAI_TRIGGER_PAUSE,
@@ -169,65 +169,80 @@ enum dai_trigger_cmd {
169169
DAI_TRIGGER_COPY,
170170
};
171171

172-
/** @brief Properties of DAI
172+
/** @brief DAI properties
173173
*
174174
* This struct is used with APIs get_properties function to query DAI
175175
* properties like fifo address and dma handshake. These are needed
176176
* for example to setup dma outside the driver code.
177-
*
178-
* @param fifo_address Fifo hw address for e.g. when connecting to dma.
179-
* @param fifo_depth Fifo depth.
180-
* @param dma_hs_id Dma handshake id.
181-
* @param reg_init_delay Delay for initializing registers.
182-
* @param stream_id Stream ID.
183177
*/
184178
struct dai_properties {
185-
uint32_t fifo_address; /* fifo address */
186-
uint32_t fifo_depth; /* fifo depth */
187-
uint32_t dma_hs_id; /* dma handshake id */
188-
uint32_t reg_init_delay; /* delay for register init */
189-
int stream_id; /* stream id */
179+
/** Fifo hw address for e.g. when connecting to dma. */
180+
uint32_t fifo_address;
181+
/** Fifo depth. */
182+
uint32_t fifo_depth;
183+
/** DMA handshake id. */
184+
uint32_t dma_hs_id;
185+
/** Delay for initializing registers. */
186+
uint32_t reg_init_delay;
187+
/** Stream ID. */
188+
int stream_id;
190189
};
191190

192-
/** Main dai config struct
193-
* @brief Generic Dai interface configuration options.
191+
/** @brief Main DAI config structure
194192
*
195-
* @param dai_type Type of the dai.
196-
* @param dai_index Index of the dai.
197-
* @param channels Number of audio channels, words in frame.
198-
* @param rate Frame clock (WS) frequency, sampling rate.
199-
* @param format Dai specific data stream format.
200-
* @param options Dai specific configuration options.
201-
* @param word_size Number of bits representing one data word.
202-
* @param block_size Size of one RX/TX memory block (buffer) in bytes.
203-
* @param link_config Dai specific link configuration.
193+
* Generic DAI interface configuration options.
204194
*/
205195
struct dai_config {
196+
/** Type of the DAI. */
206197
enum dai_type type;
198+
/** Index of the DAI. */
207199
uint32_t dai_index;
200+
/** Number of audio channels, words in frame. */
208201
uint8_t channels;
202+
/** Frame clock (WS) frequency, sampling rate. */
209203
uint32_t rate;
204+
/** DAI specific data stream format. */
210205
uint16_t format;
206+
/** DAI specific configuration options. */
211207
uint8_t options;
208+
/** Number of bits representing one data word. */
212209
uint8_t word_size;
210+
/** Size of one RX/TX memory block (buffer) in bytes. */
213211
size_t block_size;
212+
/** DAI specific link configuration. */
214213
uint16_t link_config;
215214
};
216215

216+
/**
217+
* @brief DAI timestamp configuration
218+
*/
217219
struct dai_ts_cfg {
218-
uint32_t walclk_rate; /* Rate in Hz, e.g. 19200000 */
219-
int type; /* SSP, DMIC, HDA, etc. */
220-
int direction; /* Playback, capture */
221-
int index; /* For SSPx to select correct timestamp register */
222-
int dma_id; /* DMA instance id */
223-
int dma_chan_index; /* Used DMA channel */
224-
int dma_chan_count; /* Channels in single DMA */
220+
/** Rate in Hz, e.g. 19200000 */
221+
uint32_t walclk_rate;
222+
/** Type of the DAI (SSP, DMIC, HDA, etc.). */
223+
int type;
224+
/** Direction (playback/capture) */
225+
int direction;
226+
/** Index for SSPx to select correct timestamp register */
227+
int index;
228+
/** DMA instance id */
229+
int dma_id;
230+
/** Used DMA channel index */
231+
int dma_chan_index;
232+
/** Number of channels in single DMA */
233+
int dma_chan_count;
225234
};
226235

236+
/**
237+
* @brief DAI timestamp data
238+
*/
227239
struct dai_ts_data {
228-
uint64_t walclk; /* Wall clock */
229-
uint64_t sample; /* Sample count */
230-
uint32_t walclk_rate; /* Rate in Hz, e.g. 19200000 */
240+
/** Wall clock */
241+
uint64_t walclk;
242+
/** Sample count */
243+
uint64_t sample;
244+
/** Rate in Hz, e.g. 19200000 */
245+
uint32_t walclk_rate;
231246
};
232247

233248
/**
@@ -332,7 +347,7 @@ static inline int dai_config_set(const struct device *dev,
332347
* @param dev Pointer to the device structure for the driver instance
333348
* @param cfg Pointer to the config structure to be filled by the instance
334349
* @param dir Stream direction: RX or TX as defined by DAI_DIR_*
335-
* @retval 0 if success, negative if invalid parameters or dai un-configured
350+
* @retval 0 if success, negative if invalid parameters or DAI un-configured
336351
*/
337352
static inline int dai_config_get(const struct device *dev,
338353
struct dai_config *cfg,

0 commit comments

Comments
 (0)