Tidy up report.h (#8486)

* Tidy up report.h

* Add link to Review Request 41 for brightness controls
This commit is contained in:
Ryan 2020-03-21 16:19:15 +11:00 committed by GitHub
parent e967471c4f
commit 7e80686f1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 68 additions and 53 deletions

View File

@ -15,66 +15,83 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef REPORT_H #pragma once
#define REPORT_H
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "keycode.h" #include "keycode.h"
/* report id */ /* HID report IDs */
#define REPORT_ID_KEYBOARD 1 enum hid_report_ids {
#define REPORT_ID_MOUSE 2 REPORT_ID_KEYBOARD = 1,
#define REPORT_ID_SYSTEM 3 REPORT_ID_MOUSE,
#define REPORT_ID_CONSUMER 4 REPORT_ID_SYSTEM,
#define REPORT_ID_NKRO 5 REPORT_ID_CONSUMER,
REPORT_ID_NKRO
};
/* mouse buttons */ /* Mouse buttons */
#define MOUSE_BTN1 (1 << 0) enum mouse_buttons {
#define MOUSE_BTN2 (1 << 1) MOUSE_BTN1 = (1 << 0),
#define MOUSE_BTN3 (1 << 2) MOUSE_BTN2 = (1 << 1),
#define MOUSE_BTN4 (1 << 3) MOUSE_BTN3 = (1 << 2),
#define MOUSE_BTN5 (1 << 4) MOUSE_BTN4 = (1 << 3),
MOUSE_BTN5 = (1 << 4)
};
/* Consumer Page(0x0C) // clang-format off
* following are supported by Windows: http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx
* see also https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/display-brightness-control /* Consumer Page (0x0C)
*
* See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf#page=75
*/ */
#define AUDIO_MUTE 0x00E2 enum consumer_usages {
#define AUDIO_VOL_UP 0x00E9 // 15.5 Display Controls (https://www.usb.org/sites/default/files/hutrr41_0.pdf)
#define AUDIO_VOL_DOWN 0x00EA BRIGHTNESS_UP = 0x06F,
#define TRANSPORT_NEXT_TRACK 0x00B5 BRIGHTNESS_DOWN = 0x070,
#define TRANSPORT_PREV_TRACK 0x00B6 // 15.7 Transport Controls
#define TRANSPORT_STOP 0x00B7 TRANSPORT_RECORD = 0x0B2,
#define TRANSPORT_STOP_EJECT 0x00CC TRANSPORT_FAST_FORWARD = 0x0B3,
#define TRANSPORT_PLAY_PAUSE 0x00CD TRANSPORT_REWIND = 0x0B4,
#define BRIGHTNESS_UP 0x006F TRANSPORT_NEXT_TRACK = 0x0B5,
#define BRIGHTNESS_DOWN 0x0070 TRANSPORT_PREV_TRACK = 0x0B6,
/* application launch */ TRANSPORT_STOP = 0x0B7,
#define AL_CC_CONFIG 0x0183 TRANSPORT_EJECT = 0x0B8,
#define AL_EMAIL 0x018A TRANSPORT_STOP_EJECT = 0x0CC,
#define AL_CALCULATOR 0x0192 TRANSPORT_PLAY_PAUSE = 0x0CD,
#define AL_LOCAL_BROWSER 0x0194 // 15.9.1 Audio Controls - Volume
/* application control */ AUDIO_MUTE = 0x0E2,
#define AC_SEARCH 0x0221 AUDIO_VOL_UP = 0x0E9,
#define AC_HOME 0x0223 AUDIO_VOL_DOWN = 0x0EA,
#define AC_BACK 0x0224 // 15.15 Application Launch Buttons
#define AC_FORWARD 0x0225 AL_CC_CONFIG = 0x183,
#define AC_STOP 0x0226 AL_EMAIL = 0x18A,
#define AC_REFRESH 0x0227 AL_CALCULATOR = 0x192,
#define AC_BOOKMARKS 0x022A AL_LOCAL_BROWSER = 0x194,
/* supplement for Bluegiga iWRAP HID(not supported by Windows?) */ AL_LOCK = 0x19E,
#define AL_LOCK 0x019E // 15.16 Generic GUI Application Controls
#define TRANSPORT_RECORD 0x00B2 AC_MINIMIZE = 0x206,
#define TRANSPORT_FAST_FORWARD 0x00B3 AC_SEARCH = 0x221,
#define TRANSPORT_REWIND 0x00B4 AC_HOME = 0x223,
#define TRANSPORT_EJECT 0x00B8 AC_BACK = 0x224,
#define AC_MINIMIZE 0x0206 AC_FORWARD = 0x225,
AC_STOP = 0x226,
AC_REFRESH = 0x227,
AC_BOOKMARKS = 0x22A
};
/* Generic Desktop Page(0x01) - system power control */ /* Generic Desktop Page (0x01)
#define SYSTEM_POWER_DOWN 0x0081 *
#define SYSTEM_SLEEP 0x0082 * See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf#page=26
#define SYSTEM_WAKE_UP 0x0083 */
enum desktop_usages {
// 4.5.1 System Controls - Power Controls
SYSTEM_POWER_DOWN = 0x81,
SYSTEM_SLEEP = 0x82,
SYSTEM_WAKE_UP = 0x83
};
// clang-format on
#define NKRO_SHARED_EP #define NKRO_SHARED_EP
/* key report size(NKRO or boot mode) */ /* key report size(NKRO or boot mode) */
@ -253,5 +270,3 @@ void clear_keys_from_report(report_keyboard_t* keyboard_report);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif