Merge branch 'develop' of github.com:xmos/lib_xua into feature/usb_str_cmds

This commit is contained in:
lucianom
2020-03-03 22:52:47 +00:00
3 changed files with 24 additions and 1 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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_)
{