nRF Connect SDK API 3.3.99
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
71
73static const uint8_t input_reports[] = {
74#if CONFIG_DESKTOP_HID_REPORT_MOUSE_SUPPORT
76#endif
77#if CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT
79#endif
80#if CONFIG_DESKTOP_HID_REPORT_SYSTEM_CTRL_SUPPORT
82#endif
83#if CONFIG_DESKTOP_HID_REPORT_CONSUMER_CTRL_SUPPORT
85#endif
86 /* Keep HID boot report IDs at the end as these don't have own data. */
87#if CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE
89#endif
90#if CONFIG_DESKTOP_HID_BOOT_INTERFACE_KEYBOARD
92#endif
93};
94
96static const uint8_t output_reports[] = {
97#if CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT
99#endif
100};
101
102union _input_report_size_max {
103#if CONFIG_DESKTOP_HID_REPORT_MOUSE_SUPPORT
104 uint8_t _mouse_report[REPORT_SIZE_MOUSE];
105#endif
106#if CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT
107 uint8_t _keyboard_report[REPORT_SIZE_KEYBOARD_KEYS];
108#endif
109#if CONFIG_DESKTOP_HID_REPORT_SYSTEM_CTRL_SUPPORT
110 uint8_t _sysctrl_report[REPORT_SIZE_SYSTEM_CTRL];
111#endif
112#if CONFIG_DESKTOP_HID_REPORT_CONSUMER_CTRL_SUPPORT
113 uint8_t _consumerctrl_report[REPORT_SIZE_CONSUMER_CTRL];
114#endif
115#if CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE
116 uint8_t _boot_mouse_report[REPORT_SIZE_MOUSE_BOOT];
117#endif
118#if CONFIG_DESKTOP_HID_BOOT_INTERFACE_KEYBOARD
119 uint8_t _boot_keyboard_report[REPORT_SIZE_KEYBOARD_BOOT];
120#endif
121};
122
123union _output_report_size_max {
124#if CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT
125 uint8_t _keyboard_report[REPORT_SIZE_KEYBOARD_LEDS];
126#endif
127};
128
129/* Size of the biggest supported HID input report that is part of input reports map. */
130#define REPORT_BUFFER_SIZE_INPUT_REPORT sizeof(union _input_report_size_max)
131
132/* Size of the biggest supported HID output report that is part of output reports map. */
133#define REPORT_BUFFER_SIZE_OUTPUT_REPORT sizeof(union _output_report_size_max)
134
135extern const uint8_t hid_report_desc[];
136extern const size_t hid_report_desc_size;
137
142#ifdef __cplusplus
143}
144#endif
145
146#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:96
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
#define REPORT_SIZE_CONSUMER_CTRL
Definition hid_report_consumer_ctrl.h:14
#define REPORT_SIZE_KEYBOARD_BOOT
Definition hid_report_keyboard.h:27
#define REPORT_SIZE_KEYBOARD_KEYS
Definition hid_report_keyboard.h:23
#define REPORT_SIZE_KEYBOARD_LEDS
Definition hid_report_keyboard.h:24
#define REPORT_SIZE_MOUSE
Definition hid_report_mouse.h:20
#define REPORT_SIZE_MOUSE_BOOT
Definition hid_report_mouse.h:27
#define REPORT_SIZE_SYSTEM_CTRL
Definition hid_report_system_ctrl.h:14