diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 863e2c29..c2862994 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -21,6 +21,7 @@ lib_xua Change Log events, to report Key-phrase detection as AC Search, and to report end-call detection as AC Stop * ADDED: Ability to read or modify vendor and product IDs + * ADDED: Ability to read or modify bcdDevice * ADDED: Override USB descriptor with sampling frequency and bit-resolution set at boot time. diff --git a/lib_xua/api/xua_endpoint0.h b/lib_xua/api/xua_endpoint0.h index bf279c5c..b33405ca 100644 --- a/lib_xua/api/xua_endpoint0.h +++ b/lib_xua/api/xua_endpoint0.h @@ -98,5 +98,9 @@ unsigned short XUA_Endpoint0_getVendorId(); */ unsigned short XUA_Endpoint0_getProductId(); +unsigned short XUA_Endpoint0_getBcdDevice(); + +void XUA_Endpoint0_setBcdDevice(unsigned short bcdDevice); + #endif #endif diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index bb296555..520fb91c 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -323,7 +323,7 @@ unsigned short XUA_Endpoint0_getVendorId() { } unsigned short XUA_Endpoint0_getProductId() { - unsigned short pid; + unsigned short pid; #if (AUDIO_CLASS == 1) pid = devDesc_Audio1.idProduct; #else @@ -332,6 +332,24 @@ unsigned short XUA_Endpoint0_getProductId() { return pid; } +unsigned short XUA_Endpoint0_getBcdDevice() { + unsigned short bcd; +#if (AUDIO_CLASS == 1) + bcd = devDesc_Audio1.bcdDevice; +#else + bcd = devDesc_Audio2.bcdDevice; +#endif // AUDIO_CLASS == 1} + return bcd; +} + +void XUA_Endpoint0_setBcdDevice(unsigned short bcd) { +#if (AUDIO_CLASS == 1) + devDesc_Audio1.bcdDevice = bcd; +#else + devDesc_Audio2.bcdDevice = bcd; +#endif // AUDIO_CLASS == 1} +} + void XUA_Endpoint0_init(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, chanend c_mix_ctl, chanend c_clk_ctl, chanend c_EANativeTransport_ctrl, CLIENT_INTERFACE(i_dfu, dfuInterface) VENDOR_REQUESTS_PARAMS_DEC_) {