Skip to content

Commit a48ae8c

Browse files
pdunajanangl
authored andcommitted
applications: nrf_desktop: Link doxygen API to rst
Ensure that API documented with doxygen is visible in rst files. Add missing documentation. Jira: NCSDK-14306 Co-developed-by: divya pillai <[email protected]> Signed-off-by: divya pillai <[email protected]> Signed-off-by: Pawel Dunaj <[email protected]>
1 parent 411f1b8 commit a48ae8c

File tree

4 files changed

+132
-33
lines changed

4 files changed

+132
-33
lines changed

applications/nrf_desktop/README.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,3 +1879,38 @@ Following are the application specific configuration options that can be configu
18791879

18801880
.. |led_note| replace:: A breathing LED indicates that the device has entered the advertising mode.
18811881
This happens when the device is looking for a peer to connect to.
1882+
1883+
API documentation
1884+
*****************
1885+
1886+
Following are the API elements used by the application.
1887+
1888+
HID reports
1889+
===========
1890+
1891+
| Header file: :file:`applications/nrf_desktop/configuration/common/hid_report_desc.h`
1892+
| Source file: :file:`applications/nrf_desktop/configuration/common/hid_report_desc.c`
1893+
1894+
.. doxygengroup:: nrf_desktop_hid_reports
1895+
:project: nrf
1896+
:members:
1897+
1898+
LED states
1899+
==========
1900+
1901+
| Header file: :file:`applications/nrf_desktop/configuration/common/led_state.h`
1902+
| Source file: :file:`applications/nrf_desktop/src/modules/led_state.c`
1903+
1904+
.. doxygengroup:: nrf_desktop_led_state
1905+
:project: nrf
1906+
:members:
1907+
1908+
USB events
1909+
==========
1910+
1911+
| Header file: :file:`applications/nrf_desktop/src/events/usb_event.h`
1912+
| Source file: :file:`applications/nrf_desktop/src/modules/usb_state.c`
1913+
1914+
.. doxygengroup:: nrf_desktop_usb_event
1915+
:project: nrf
1916+
:members:

applications/nrf_desktop/configuration/common/hid_report_desc.h

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

7+
/** @file
8+
* @brief Header file HID report identifiers.
9+
*/
10+
711
#ifndef _HID_REPORT_DESC_H_
812
#define _HID_REPORT_DESC_H_
913

@@ -23,28 +27,49 @@
2327
extern "C" {
2428
#endif
2529

30+
/**
31+
* @brief HID Reports
32+
* @defgroup nrf_desktop_hid_reports HID Reports
33+
* @{
34+
*/
35+
36+
/** @brief Identification numbers of HID reports. */
2637
enum report_id {
38+
/** Reserved. */
2739
REPORT_ID_RESERVED,
2840

41+
/** Mouse input report. */
2942
REPORT_ID_MOUSE,
43+
/** Keyboard input report. */
3044
REPORT_ID_KEYBOARD_KEYS,
45+
/** System control input report. */
3146
REPORT_ID_SYSTEM_CTRL,
47+
/** Consumer control input report. */
3248
REPORT_ID_CONSUMER_CTRL,
3349

50+
/** Keyboard output report. */
3451
REPORT_ID_KEYBOARD_LEDS,
3552

53+
/** Config channel feature report. */
3654
REPORT_ID_USER_CONFIG,
55+
/** Config channel output report. */
3756
REPORT_ID_USER_CONFIG_OUT,
3857

58+
/** Reserved. */
3959
REPORT_ID_VENDOR_IN,
60+
/** Reserved. */
4061
REPORT_ID_VENDOR_OUT,
4162

63+
/** Boot report - mouse. */
4264
REPORT_ID_BOOT_MOUSE,
65+
/** Boot report - keyboard. */
4366
REPORT_ID_BOOT_KEYBOARD,
4467

68+
/** Number of reports. */
4569
REPORT_ID_COUNT
4670
};
4771

72+
/** @brief Input reports map. */
4873
static const uint8_t input_reports[] = {
4974
REPORT_ID_MOUSE,
5075
REPORT_ID_KEYBOARD_KEYS,
@@ -54,6 +79,7 @@ static const uint8_t input_reports[] = {
5479
REPORT_ID_BOOT_KEYBOARD,
5580
};
5681

82+
/** @brief Output reports map. */
5783
static const uint8_t output_reports[] = {
5884
REPORT_ID_KEYBOARD_LEDS,
5985
};
@@ -62,6 +88,10 @@ static const uint8_t output_reports[] = {
6288
extern const uint8_t hid_report_desc[];
6389
extern const size_t hid_report_desc_size;
6490

91+
/**
92+
* @}
93+
*/
94+
6595
#ifdef __cplusplus
6696
}
6797
#endif

applications/nrf_desktop/configuration/common/led_state.h

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

7+
/** @file
8+
* @brief Header file with LED states.
9+
*/
10+
711
#ifndef _LED_STATE_H_
812
#define _LED_STATE_H_
913

10-
/**
11-
* @brief LED State
12-
* @defgroup led_state LED State
13-
* @{
14-
*/
15-
1614
#include <zephyr/types.h>
1715
#include <caf/events/led_event.h>
1816

1917
#ifdef __cplusplus
2018
extern "C" {
2119
#endif
2220

21+
/**
22+
* @brief LED State
23+
* @defgroup nrf_desktop_led_state LED State
24+
* @{
25+
*/
26+
27+
/** @brief System states represented by LED. */
2328
enum led_system_state {
29+
/** Device is idle. */
2430
LED_SYSTEM_STATE_IDLE,
31+
/** Device is charging. */
2532
LED_SYSTEM_STATE_CHARGING,
33+
/** Device in error state. */
2634
LED_SYSTEM_STATE_ERROR,
2735

36+
/** Number of system states. */
2837
LED_SYSTEM_STATE_COUNT
2938
};
3039

40+
/** @brief Peer states represented by LED. */
3141
enum led_peer_state {
42+
/** Peer is disconnected. */
3243
LED_PEER_STATE_DISCONNECTED,
44+
/** Peer is connected. */
3345
LED_PEER_STATE_CONNECTED,
46+
/** Device searches for peer. */
3447
LED_PEER_STATE_PEER_SEARCH,
48+
/** Device waits for user to confirm peer switch. */
3549
LED_PEER_STATE_CONFIRM_SELECT,
50+
/** Device waits for user to confirm bond erase. */
3651
LED_PEER_STATE_CONFIRM_ERASE,
52+
/** Device searches for new peer before bond erase. */
3753
LED_PEER_STATE_ERASE_ADV,
3854

55+
/** Number of peer states. */
3956
LED_PEER_STATE_COUNT
4057
};
4158

59+
/** @brief LED identification. */
4260
enum led_id {
61+
/** LED representing system state. */
4362
LED_ID_SYSTEM_STATE,
63+
/** LED representing peer state. */
4464
LED_ID_PEER_STATE,
4565

66+
/** Number of LEDs. */
4667
LED_ID_COUNT
4768
};
4869

@@ -59,12 +80,12 @@ enum led_id {
5980
#define LED_PEER_COUNT 1
6081
#endif
6182

62-
#ifdef __cplusplus
63-
}
64-
#endif
65-
6683
/**
6784
* @}
6885
*/
6986

87+
#ifdef __cplusplus
88+
}
89+
#endif
90+
7091
#endif /* _LED_STATE_H_ */

applications/nrf_desktop/src/events/usb_event.h

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66

7+
/** @file
8+
* @brief USB event header file.
9+
*/
10+
711
#ifndef _USB_EVENT_H_
812
#define _USB_EVENT_H_
913

10-
/**
11-
* @brief USB Event
12-
* @defgroup usb_event USB Event
13-
*
14-
* File defines a set of events used to transmit the information about USB
15-
* state between the application modules.
16-
*
17-
* @{
18-
*/
19-
2014
#include <zephyr/toolchain/common.h>
2115

2216
#include <app_event_manager.h>
@@ -26,40 +20,59 @@
2620
extern "C" {
2721
#endif
2822

23+
/**
24+
* @brief USB Event
25+
* @defgroup nrf_desktop_usb_event USB Event
26+
*
27+
* File defines a set of events used to transmit the information about USB
28+
* state between the application modules.
29+
*
30+
* @{
31+
*/
2932

3033
/** @brief Peer states. */
3134
enum usb_state {
32-
USB_STATE_DISCONNECTED, /**< Cable is not attached. */
33-
USB_STATE_POWERED, /**< Cable attached but no communication. */
34-
USB_STATE_ACTIVE, /**< Cable attached and data is exchanged. */
35-
USB_STATE_SUSPENDED, /**< Cable attached but port is suspended. */
35+
/** Cable is not attached. */
36+
USB_STATE_DISCONNECTED,
37+
/** Cable attached but no communication. */
38+
USB_STATE_POWERED,
39+
/** Cable attached and data is exchanged. */
40+
USB_STATE_ACTIVE,
41+
/** Cable attached but port is suspended. */
42+
USB_STATE_SUSPENDED,
3643

37-
USB_STATE_COUNT /**< Number of states. */
44+
/** Number of states. */
45+
USB_STATE_COUNT
3846
};
3947

4048
/** @brief USB state event. */
4149
struct usb_state_event {
42-
struct app_event_header header; /**< Event header. */
50+
/** Event header. */
51+
struct app_event_header header;
4352

44-
enum usb_state state; /**< State of the USB module. */
53+
/** State of the USB module. */
54+
enum usb_state state;
4555
};
4656
APP_EVENT_TYPE_DECLARE(usb_state_event);
4757

4858
/** @brief USB HID event. */
4959
struct usb_hid_event {
50-
struct app_event_header header; /**< Event header. */
60+
/** Event header. */
61+
struct app_event_header header;
5162

52-
const void *id; /**< USB HID device id. */
63+
/** USB HID device id. */
64+
const void *id;
65+
/** USB HID device enabled state. */
5366
bool enabled;
5467
};
5568
APP_EVENT_TYPE_DECLARE(usb_hid_event);
5669

57-
#ifdef __cplusplus
58-
}
59-
#endif
60-
6170
/**
6271
* @}
6372
*/
6473

74+
#ifdef __cplusplus
75+
}
76+
#endif
77+
6578
#endif /* _USB_EVENT_H_ */

0 commit comments

Comments
 (0)