nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
hid_report_desc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
11#ifndef _HID_REPORT_DESC_H_
12#define _HID_REPORT_DESC_H_
13
14#include <stddef.h>
15#include <zephyr/types.h>
16#include <zephyr/toolchain.h>
17#include <zephyr/sys/util.h>
18
19#include "hid_report_mouse.h"
20#include "hid_report_keyboard.h"
24
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
40
49
52
57
62
67
70};
71
73static const uint8_t input_reports[] = {
80};
81
83static const uint8_t output_reports[] = {
85};
86
87/* Internal definitions used to calculate size of the biggest supported HID input report. */
88#define _REPORT_BUFFER_SIZE_MOUSE \
89 (IS_ENABLED(CONFIG_DESKTOP_HID_REPORT_MOUSE_SUPPORT) ? (REPORT_SIZE_MOUSE) : (0))
90#define _REPORT_BUFFER_SIZE_KEYBOARD_KEYS \
91 (IS_ENABLED(CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT) ? (REPORT_SIZE_KEYBOARD_KEYS) : (0))
92#define _REPORT_BUFFER_SIZE_SYSTEM_CTRL \
93 (IS_ENABLED(CONFIG_DESKTOP_HID_REPORT_SYSTEM_CTRL_SUPPORT) ? \
94 (REPORT_SIZE_SYSTEM_CTRL) : (0))
95#define _REPORT_BUFFER_SIZE_CONSUMER_CTRL \
96 (IS_ENABLED(CONFIG_DESKTOP_HID_REPORT_CONSUMER_CTRL_SUPPORT) ? \
97 (REPORT_SIZE_CONSUMER_CTRL) : (0))
98#define _REPORT_BUFFER_SIZE_BOOT_MOUSE \
99 (IS_ENABLED(CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE) ? (REPORT_SIZE_MOUSE_BOOT) : (0))
100#define _REPORT_BUFFER_SIZE_BOOT_KEYBOARD \
101 (IS_ENABLED(CONFIG_DESKTOP_HID_BOOT_INTERFACE_KEYBOARD) ? (REPORT_SIZE_KEYBOARD_BOOT) : (0))
102#define _MAX6(a, b, c, d, e, f) MAX(MAX(a, b), MAX(MAX(c, d), MAX(e, f)))
103
104/* Size of the biggest supported HID input report that is part of input reports map. */
105#define REPORT_BUFFER_SIZE_INPUT_REPORT \
106 _MAX6(_REPORT_BUFFER_SIZE_MOUSE, _REPORT_BUFFER_SIZE_KEYBOARD_KEYS, \
107 _REPORT_BUFFER_SIZE_SYSTEM_CTRL, _REPORT_BUFFER_SIZE_CONSUMER_CTRL, \
108 _REPORT_BUFFER_SIZE_BOOT_MOUSE, _REPORT_BUFFER_SIZE_BOOT_KEYBOARD)
109
110/* Internal definitions used to calculate size of the biggest supported HID output report. */
111#define _REPORT_BUFFER_SIZE_KEYBOARD_LEDS \
112 (IS_ENABLED(CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT) ? (REPORT_SIZE_KEYBOARD_LEDS) : (0))
113
114/* Size of the biggest supported HID output report that is part of output reports map. */
115#define REPORT_BUFFER_SIZE_OUTPUT_REPORT _REPORT_BUFFER_SIZE_KEYBOARD_LEDS
116
117extern const uint8_t hid_report_desc[];
118extern const size_t hid_report_desc_size;
119
124#ifdef __cplusplus
125}
126#endif
127
128#endif /* _HID_REPORT_DESC_H_ */
const uint8_t hid_report_desc[]
static const uint8_t output_reports[]
Output reports map.
Definition: hid_report_desc.h:83
report_id
Identification numbers of HID reports.
Definition: hid_report_desc.h:37
@ REPORT_ID_COUNT
Definition: hid_report_desc.h:69
@ REPORT_ID_MOUSE
Definition: hid_report_desc.h:42
@ REPORT_ID_CONSUMER_CTRL
Definition: hid_report_desc.h:48
@ REPORT_ID_USER_CONFIG_OUT
Definition: hid_report_desc.h:56
@ REPORT_ID_BOOT_MOUSE
Definition: hid_report_desc.h:64
@ REPORT_ID_BOOT_KEYBOARD
Definition: hid_report_desc.h:66
@ REPORT_ID_KEYBOARD_LEDS
Definition: hid_report_desc.h:51
@ REPORT_ID_USER_CONFIG
Definition: hid_report_desc.h:54
@ REPORT_ID_VENDOR_OUT
Definition: hid_report_desc.h:61
@ REPORT_ID_KEYBOARD_KEYS
Definition: hid_report_desc.h:44
@ REPORT_ID_RESERVED
Definition: hid_report_desc.h:39
@ REPORT_ID_SYSTEM_CTRL
Definition: hid_report_desc.h:46
@ REPORT_ID_VENDOR_IN
Definition: hid_report_desc.h:59
static const uint8_t input_reports[]
Input reports map.
Definition: hid_report_desc.h:73
const size_t hid_report_desc_size