From e5389e434846e50e34b164df27c2ad80f2b918d9 Mon Sep 17 00:00:00 2001 From: mbanth Date: Fri, 13 Dec 2019 18:17:36 +0000 Subject: [PATCH] Added support for AC Stop (End Call), Volume Increment and Volume Decrement bit fields in the HID report. --- CHANGELOG.rst | 2 ++ lib_xua/src/core/endpoint0/xua_ep0_descriptors.h | 9 ++++++--- lib_xua/src/core/user/hid/user_hid.h | 10 ++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d8b82f4a..d653a370 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,8 @@ lib_xua Change Log microphone operation * FIXED: Descriptors for XUA_ADAPTIVE incorrectly defined for IN endpoint * ADDED: Guards to user_hid.h and xua_hid.h + * ADDED: UAC1 HID support for AC Stop (End Call), Volume Increment and + Volume Decrement 0.2.1 ----- diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index fcc1e45b..8abd18e9 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -573,9 +573,12 @@ unsigned char hidReportDescriptor[] = /* Voice Command usage as per request #HUT 0x0a, 0x00, 0x02, /* Usage (Generic GUI Application Controls) */ 0xa1, 0x02, /* Collection (Logical) */ 0x0a, 0x21, 0x02, /* Usage (AC Search) */ - 0x95, 0x01, /* Report Count (1) */ + 0x0a, 0x26, 0x02, /* Usage (AC Stop) */ + 0x09, 0xe9, /* Usage (Volume Increment) */ + 0x09, 0xea, /* Usage (Volume Decrement) */ + 0x95, 0x04, /* Report Count (4) */ 0x81, 0x40, /* Input (Data, Ary, Abs, Nul) */ - 0x95, 0x07, /* Report Count (7) */ + 0x95, 0x04, /* Report Count (4) */ 0x81, 0x01, /* Input (Cnst, Ary, Abs) */ 0xc0, /* End collection (Logical) */ 0xc0 /* End collection (Application) */ @@ -2884,7 +2887,7 @@ unsigned char cfgDesc_Audio1[] = 0x00, /* 4 bCountryCode */ 0x01, /* 5 bNumDescriptors */ 0x22, /* 6 bDescriptorType[0] (Report) */ - 0x1E, /* 7 wDescriptorLength[0] */ + 0x25, /* 7 wDescriptorLength[0] */ 0x00, /* 8 wDescriptorLength[0] */ /* HID Endpoint descriptor (IN) */ diff --git a/lib_xua/src/core/user/hid/user_hid.h b/lib_xua/src/core/user/hid/user_hid.h index 7d67b00c..79b420a3 100644 --- a/lib_xua/src/core/user/hid/user_hid.h +++ b/lib_xua/src/core/user/hid/user_hid.h @@ -4,12 +4,10 @@ #define __USER_HID_H__ /* These defines relate to the HID report desc - do not mod */ -#define HID_CONTROL_PLAYPAUSE_SHIFT 0x00 -#define HID_CONTROL_NEXT_SHIFT 0x01 -#define HID_CONTROL_PREV_SHIFT 0x02 -#define HID_CONTROL_VOLUP_SHIFT 0x03 -#define HID_CONTROL_VOLDN_SHIFT 0x04 -#define HID_CONTROL_MUTE_SHIFT 0x05 +#define HID_CONTROL_KEYWORD_SHIFT 0x00 +#define HID_CONTROL_ENDCALL_SHIFT 0x01 +#define HID_CONTROL_VOLUP_SHIFT 0x02 +#define HID_CONTROL_VOLDN_SHIFT 0x03 #define HID_DATA_SIZE 1