Skip to content

Commit 3866b82

Browse files
greg-feranangl
authored andcommitted
doc: audio: add API documentation page
Added API doxygen documentation for the Audio apps. Added a new page listing the available audio API. OCT-3355. Signed-off-by: Grzegorz Ferenc <[email protected]>
1 parent 16b192d commit 3866b82

File tree

21 files changed

+509
-67
lines changed

21 files changed

+509
-67
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
.. _audio_api:
2+
3+
Audio applications: API documentation
4+
#####################################
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
Following are the API elements used by the Audio applications.
11+
12+
Audio System
13+
************
14+
15+
| Header file: :file:`applications/nrf5340_audio/src/audio/audio_system.h`
16+
| Source file: :file:`applications/nrf5340_audio/src/audio/audio_system.c`
17+
18+
.. doxygengroup:: audio_app_system
19+
20+
Audio Datapath
21+
**************
22+
23+
| Header file: :file:`applications/nrf5340_audio/src/audio/audio_datapath.h`
24+
| Source file: :file:`applications/nrf5340_audio/src/audio/audio_datapath.c`
25+
26+
.. doxygengroup:: audio_app_datapath
27+
28+
Audio Stream Control
29+
********************
30+
31+
| Header file: :file:`applications/nrf5340_audio/src/audio/streamctrl.h`
32+
33+
.. doxygengroup:: audio_app_streamctrl
34+
35+
Audio Software Codec Selection
36+
******************************
37+
38+
| Header file: :file:`applications/nrf5340_audio/src/audio/sw_codec_select.h`
39+
| Source file: :file:`applications/nrf5340_audio/src/audio/sw_codec_select.c`
40+
41+
.. doxygengroup:: audio_app_sw_codec_select
42+
43+
LE Audio RX
44+
***********
45+
46+
| Header file: :file:`applications/nrf5340_audio/src/audio/le_audio_rx.h`
47+
| Source file: :file:`applications/nrf5340_audio/src/audio/le_audio_rx.c`
48+
49+
.. doxygengroup:: audio_app_le_audio_rx
50+
51+
Audio Bluetooth Management
52+
**************************
53+
54+
| Header file: :file:`applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.h`
55+
| Source file: :file:`applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.c`
56+
57+
.. doxygengroup:: audio_app_bt_mgmt
58+
59+
Bluetooth LE Audio Stream
60+
*************************
61+
62+
| Header file: :file:`applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.h`
63+
| Source file: :file:`applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.c`
64+
65+
.. doxygengroup:: audio_app_bt_stream
66+
67+
Bluetooth Audio Rendering and Capture
68+
*************************************
69+
70+
| Header file: :file:`applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/bt_rendering_and_capture.h`
71+
| Source file: :file:`applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/bt_rendering_and_capture.c`
72+
73+
.. doxygengroup:: audio_app_bt_rendering_and_capture
74+
75+
Audio I2S
76+
*********
77+
78+
| Header file: :file:`applications/nrf5340_audio/src/modules/audio_i2s.h`
79+
| Source file: :file:`applications/nrf5340_audio/src/modules/audio_i2s.c`
80+
81+
.. doxygengroup:: audio_app_i2s
82+
83+
Audio Sync Timer
84+
****************
85+
86+
| Header file: :file:`applications/nrf5340_audio/src/modules/audio_sync_timer.h`
87+
| Source file: :file:`applications/nrf5340_audio/src/modules/audio_sync_timer.c`
88+
89+
.. doxygengroup:: audio_app_sync_timer
90+
91+
Audio USB
92+
*********
93+
94+
| Header file: :file:`applications/nrf5340_audio/src/modules/audio_usb.h`
95+
| Source file: :file:`applications/nrf5340_audio/src/modules/audio_usb.c`
96+
97+
.. doxygengroup:: audio_app_usb
98+
99+
Audio LED Control
100+
*****************
101+
102+
| Header file: :file:`applications/nrf5340_audio/src/modules/led.h`
103+
| Source file: :file:`applications/nrf5340_audio/src/modules/led.c`
104+
105+
.. doxygengroup:: audio_app_led
106+
107+
Audio Button Handler
108+
********************
109+
110+
| Header file: :file:`applications/nrf5340_audio/src/modules/button_handler.h`
111+
| Source file: :file:`applications/nrf5340_audio/src/modules/button_handler.c`
112+
113+
.. doxygengroup:: audio_app_button
114+
115+
LC3 Streamer
116+
************
117+
118+
| Header file: :file:`applications/nrf5340_audio/src/modules/lc3_streamer.h`
119+
| Source file: :file:`applications/nrf5340_audio/src/modules/lc3_streamer.c`
120+
121+
.. doxygengroup:: audio_app_lc3_streamer
122+
123+
LC3 File
124+
********
125+
126+
| Header file: :file:`applications/nrf5340_audio/src/modules/lc3_file.h`
127+
| Source file: :file:`applications/nrf5340_audio/src/modules/lc3_file.c`
128+
129+
.. doxygengroup:: audio_app_lc3_file
130+
131+
SD Card Playback
132+
****************
133+
134+
| Header file: :file:`applications/nrf5340_audio/src/modules/sd_card_playback.h`
135+
| Source file: :file:`applications/nrf5340_audio/src/modules/sd_card_playback.c`
136+
137+
.. doxygengroup:: audio_app_sd_card_playback
138+
139+
SD Card
140+
*******
141+
142+
| Header file: :file:`applications/nrf5340_audio/src/modules/sd_card.h`
143+
| Source file: :file:`applications/nrf5340_audio/src/modules/sd_card.c`
144+
145+
.. doxygengroup:: audio_app_sd_card

applications/nrf5340_audio/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ See the subpages for detailed documentation of each of the nRF5340 applications
5454
unicast_server/README
5555
doc/fota
5656
doc/adapting_application
57+
doc/audio_api

applications/nrf5340_audio/src/audio/audio_datapath.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
* SPDX-License-Identifier: LicenseRef-PCFT
55
*/
66

7+
/** @file
8+
* @defgroup audio_app_datapath Audio Datapath
9+
* @{
10+
* @brief Audio datapath and synchronization API for Audio applications.
11+
*
12+
* This module implements the audio synchronization functionality required for
13+
* True Wireless Stereo (TWS) operation.
14+
*/
15+
716
#ifndef _AUDIO_DATAPATH_H_
817
#define _AUDIO_DATAPATH_H_
918

@@ -15,10 +24,6 @@
1524
#include "sw_codec_select.h"
1625
#include "audio_defines.h"
1726

18-
/* The maximum delta (in microseconds) between received SDUs that are to be presented or played back
19-
* at the same time. For example, used to correlate left and right channels, while allowing some
20-
* jitter on the timestamp.
21-
*/
2227
#define SDU_REF_CH_DELTA_MAX_US (int)(CONFIG_AUDIO_FRAME_DURATION_US * 0.001)
2328

2429
/**
@@ -33,7 +38,7 @@
3338
int audio_datapath_tone_play(uint16_t freq, uint16_t dur_ms, float amplitude);
3439

3540
/**
36-
* @brief Stops tone playback.
41+
* @brief Stop tone playback.
3742
*/
3843
void audio_datapath_tone_stop(void);
3944

@@ -89,4 +94,8 @@ int audio_datapath_stop(void);
8994
*/
9095
int audio_datapath_init(void);
9196

97+
/**
98+
* @}
99+
*/
100+
92101
#endif /* _AUDIO_DATAPATH_H_ */

applications/nrf5340_audio/src/audio/audio_system.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66

7+
/** @file
8+
* @defgroup audio_app_system Audio System
9+
* @{
10+
* @brief Core audio system API for Audio applications.
11+
*
12+
* This module provides the central audio processing functionality for the Audio
13+
* applications, managing both hardware (DAC/ADC) and software codecs (such as LC3).
14+
*/
15+
716
#ifndef _AUDIO_SYSTEM_H_
817
#define _AUDIO_SYSTEM_H_
918

@@ -103,10 +112,14 @@ int audio_system_fifo_rx_block_drop(void);
103112
int audio_system_decoder_num_ch_get(void);
104113

105114
/**
106-
* @brief Initialize the audio_system.
115+
* @brief Initialize the audio system.
107116
*
108117
* @return 0 on success, error otherwise.
109118
*/
110119
int audio_system_init(void);
111120

121+
/**
122+
* @}
123+
*/
124+
112125
#endif /* _AUDIO_SYSTEM_H_ */

applications/nrf5340_audio/src/audio/le_audio_rx.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66

7+
/** @file
8+
* @defgroup audio_app_le_audio_rx LE Audio RX
9+
* @{
10+
* @brief LE Audio receive (RX) API for Audio applications.
11+
*
12+
* This module handles the reception and processing of incoming LE Audio streams from
13+
* Bluetooth. It manages the audio data reception pipeline, including
14+
* metadata extraction and audio frame processing for both unicast (CIS) and broadcast
15+
* (BIS) modes.
16+
*/
17+
718
#ifndef _LE_AUDIO_RX_H_
819
#define _LE_AUDIO_RX_H_
920

@@ -28,4 +39,8 @@ void le_audio_rx_data_handler(struct net_buf *audio_frame_rx, struct audio_metad
2839
*/
2940
int le_audio_rx_init(void);
3041

42+
/**
43+
* @}
44+
*/
45+
3146
#endif /* _LE_AUDIO_RX_H_ */

applications/nrf5340_audio/src/audio/streamctrl.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66

7+
/** @file
8+
* @defgroup audio_app_streamctrl Audio Stream Control
9+
* @{
10+
* @brief Stream control API for Audio applications.
11+
*
12+
* This module provides stream state management and control functions for audio streaming
13+
* operations.
14+
*/
15+
716
#ifndef _STREAMCTRL_H_
817
#define _STREAMCTRL_H_
918

1019
#include <stddef.h>
1120
#include <zephyr/kernel.h>
1221
#include <zephyr/net_buf.h>
1322

14-
/* State machine states for peer or stream. */
23+
/**
24+
* @brief Stream state enumeration for audio streaming operations.
25+
*/
1526
enum stream_state {
1627
STATE_STREAMING,
1728
STATE_PAUSED,
@@ -31,4 +42,8 @@ uint8_t stream_state_get(void);
3142
*/
3243
void streamctrl_send(struct net_buf const *const audio_frame);
3344

45+
/**
46+
* @}
47+
*/
48+
3449
#endif /* _STREAMCTRL_H_ */

0 commit comments

Comments
 (0)