From f189f02c0290f56390dd630c11c081798fa91e8e Mon Sep 17 00:00:00 2001 From: mbanth Date: Tue, 7 Jan 2020 14:58:08 +0000 Subject: [PATCH 1/5] Revert "Revert "Modify the interface to the User HID functionality."" This reverts commit d81af18d1fddf85278ca392065336195bff97854. --- lib_xua/src/core/buffer/ep/ep_buffer.xc | 4 +-- lib_xua/src/core/user/hid/user_hid.h | 41 ++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/lib_xua/src/core/buffer/ep/ep_buffer.xc b/lib_xua/src/core/buffer/ep/ep_buffer.xc index 3e28a2e5..97984b85 100644 --- a/lib_xua/src/core/buffer/ep/ep_buffer.xc +++ b/lib_xua/src/core/buffer/ep/ep_buffer.xc @@ -21,7 +21,7 @@ #if( 0 < HID_CONTROLS ) #include "user_hid.h" -unsigned char g_hidData[1] = {0}; +unsigned char g_hidData[HID_DATA_BYTES] = {0}; #endif void GetADCCounts(unsigned samFreq, int &min, int &mid, int &max); @@ -880,7 +880,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out, case XUD_SetData_Select(c_hid, ep_hid, result): { g_hidData[0]=0; - g_hidData[0]=UserHIDGetData(); + UserHIDGetData(g_hidData); XUD_SetReady_In(ep_hid, g_hidData, 1); } break; diff --git a/lib_xua/src/core/user/hid/user_hid.h b/lib_xua/src/core/user/hid/user_hid.h index 35d2578d..5288ee7b 100644 --- a/lib_xua/src/core/user/hid/user_hid.h +++ b/lib_xua/src/core/user/hid/user_hid.h @@ -3,7 +3,13 @@ #ifndef __USER_HID_H__ #define __USER_HID_H__ -/* These enumerated constants relate to the HID report desc - do not mod */ +/** + * \brief HID event identifiers + * + * This enumeration defines a constant value for each HID event. + * It defines one value for each of the four GPI pins supported in the standard voice products. + * It defines a further 28 values for generic events. + */ typedef enum hidEventId_t { HID_EVENT_ID_GPI0 = 0, HID_EVENT_ID_GPI1, @@ -39,13 +45,40 @@ typedef enum hidEventId_t { HID_EVENT_ID_EVT27 } hidEventId_t; -#define HID_DATA_SIZE 1 +#define HID_DATA_BYTES 4 #if( 0 < HID_CONTROLS ) -unsigned UserHIDGetData( void ); +/** + * \brief Get the data for the next HID report + * + * \note This function returns the HID data as a list of unsigned char because the + * \c XUD_SetReady_In() accepts data for transmission to the USB Host using + * this type. + * + * \param{out} hidData The HID data + */ +void UserHIDGetData( unsigned char hidData[ HID_DATA_BYTES ]); + +/** + * \brief Initialize HID processing + */ void UserHIDInit( void ); -void UserHIDRegisterEvent( const hidEventId_t hidEventId, const int * hidEventData, const unsigned hidEventDataSize ); + +/** + * \brief Record that a HID event has occurred + * + * \param{in} hidEventId The identifier of an event which has occurred + * \param{in} hidEventData A list of data associated with the event + * \param{in} hidEventDataSize The length of the event data list + * + * \note At present, this function only takes a single element of event data, i.e. + * hidEventDataSize must equal 1. + * + * \note At present, this function treats the event data as a Boolean flag. + * Zero means False; all other values mean True. + */ +void UserHIDRecordEvent( const hidEventId_t hidEventId, const int * hidEventData, const unsigned hidEventDataSize ); #endif /* ( 0 < HID_CONTROLS ) */ #endif /* __USER_HID_H__ */ From 8f2509845aafc5d7ccb39e988cb3323cf855ff4f Mon Sep 17 00:00:00 2001 From: mbanth Date: Wed, 8 Jan 2020 11:09:03 +0000 Subject: [PATCH 2/5] Update change log. --- CHANGELOG.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b77784ce..2bc5f24b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,8 @@ lib_xua Change Log Volume Decrement * CHANGE: UAC1 HID to report function keys f21 through f24 as specified by customer + * CHANGE: HID interface for user to set and clear events from global + variable to function 0.2.1 ----- From 6e184af8992f7dbb5af7efa573ef25116f36b279 Mon Sep 17 00:00:00 2001 From: mbanth Date: Thu, 16 Jan 2020 12:07:24 +0000 Subject: [PATCH 3/5] Update copyright date range. --- lib_xua/LICENSE.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_xua/LICENSE.txt b/lib_xua/LICENSE.txt index 3932a9ae..37950686 100644 --- a/lib_xua/LICENSE.txt +++ b/lib_xua/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2017-2019, XMOS, All rights reserved. +Copyright (c) 2017-2020, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. @@ -30,7 +30,7 @@ The headings in this License do not affect its interpretation. Save where the co Unless the context otherwise requires: -- references to XMOS and the Customer include their permitted successors and assigns; +- references to XMOS and the Customer include their permitted successors and assigns; - references to statutory provisions include those statutory provisions as amended or re-enacted; and - references to any gender include all genders. @@ -58,12 +58,12 @@ The Customer will adhere to all applicable import and export laws and regulation The Customer will own all intellectual property rights in the Licensee Modifications but will undertake to provide XMOS with any fixes made to correct any bugs found in the XMOS Software on a non-exclusive, perpetual and royalty free license basis. -XMOS will own all intellectual property rights in the XMOS Modifications. +XMOS will own all intellectual property rights in the XMOS Modifications. The Customer may only use the Licensee Modifications and XMOS Modifications on, or in relation to, XMOS Hardware. 7. Support -Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement. +Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement. 8. Warranty and Disclaimer From 7530591a64105dcd5c918c0372408f0ee27bf660 Mon Sep 17 00:00:00 2001 From: mbanth Date: Thu, 16 Jan 2020 12:18:33 +0000 Subject: [PATCH 4/5] Put trailing white space back because the License file check currently fails if it's missing. --- lib_xua/LICENSE.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_xua/LICENSE.txt b/lib_xua/LICENSE.txt index 37950686..7f5e44ce 100644 --- a/lib_xua/LICENSE.txt +++ b/lib_xua/LICENSE.txt @@ -30,7 +30,7 @@ The headings in this License do not affect its interpretation. Save where the co Unless the context otherwise requires: -- references to XMOS and the Customer include their permitted successors and assigns; +- references to XMOS and the Customer include their permitted successors and assigns; - references to statutory provisions include those statutory provisions as amended or re-enacted; and - references to any gender include all genders. @@ -58,12 +58,12 @@ The Customer will adhere to all applicable import and export laws and regulation The Customer will own all intellectual property rights in the Licensee Modifications but will undertake to provide XMOS with any fixes made to correct any bugs found in the XMOS Software on a non-exclusive, perpetual and royalty free license basis. -XMOS will own all intellectual property rights in the XMOS Modifications. +XMOS will own all intellectual property rights in the XMOS Modifications. The Customer may only use the Licensee Modifications and XMOS Modifications on, or in relation to, XMOS Hardware. 7. Support -Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement. +Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement. 8. Warranty and Disclaimer From 16138c2d429690be4986c7559403f3afb95cd458 Mon Sep 17 00:00:00 2001 From: mbanth Date: Thu, 16 Jan 2020 12:27:25 +0000 Subject: [PATCH 5/5] Update copyright date range. --- lib_xua/src/core/buffer/ep/ep_buffer.xc | 2 +- lib_xua/src/core/user/hid/user_hid.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_xua/src/core/buffer/ep/ep_buffer.xc b/lib_xua/src/core/buffer/ep/ep_buffer.xc index 97984b85..ae58ef83 100644 --- a/lib_xua/src/core/buffer/ep/ep_buffer.xc +++ b/lib_xua/src/core/buffer/ep/ep_buffer.xc @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved #include "xua.h" #if XUA_USB_EN #include diff --git a/lib_xua/src/core/user/hid/user_hid.h b/lib_xua/src/core/user/hid/user_hid.h index 5288ee7b..e2d64c7d 100644 --- a/lib_xua/src/core/user/hid/user_hid.h +++ b/lib_xua/src/core/user/hid/user_hid.h @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2019, XMOS Ltd, All rights reserved +// Copyright (c) 2013-2020, XMOS Ltd, All rights reserved #ifndef __USER_HID_H__ #define __USER_HID_H__