forked from PAWPAW-Mirror/lib_xua
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab2519ab4f | ||
|
|
94ea3ba306 | ||
|
|
3a4e626472 | ||
|
|
a61f0e7a5f | ||
|
|
cd29ca91e3 | ||
|
|
7ccd5b526d | ||
|
|
5c2a69288c | ||
|
|
fda4c3afb1 | ||
|
|
05dacde043 | ||
|
|
b7cbc5fe9e | ||
|
|
468b69cb62 | ||
|
|
74772d864e | ||
|
|
c18ca44768 | ||
|
|
82f651d930 |
@@ -1,6 +1,11 @@
|
|||||||
lib_xua Change Log
|
lib_xua Change Log
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
1.1.0
|
||||||
|
-----
|
||||||
|
|
||||||
|
* ADDED: Ability to read or modify serial number string
|
||||||
|
|
||||||
1.0.1
|
1.0.1
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|||||||
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -1,4 +1,4 @@
|
|||||||
@Library('xmos_jenkins_shared_library@v0.12.1') _
|
@Library('xmos_jenkins_shared_library@v0.14.1') _
|
||||||
|
|
||||||
getApproval()
|
getApproval()
|
||||||
|
|
||||||
|
|||||||
@@ -442,6 +442,16 @@
|
|||||||
#define CODEC_MASTER (0)
|
#define CODEC_MASTER (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Serial Number String used by the device
|
||||||
|
*
|
||||||
|
* Default: ""
|
||||||
|
*/
|
||||||
|
#ifndef SERIAL_STR
|
||||||
|
#define SERIAL_STR ""
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Vendor String used by the device. This is also pre-pended to various strings used by the design.
|
* @brief Vendor String used by the device. This is also pre-pended to various strings used by the design.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -62,6 +62,16 @@ void XUA_Endpoint0_setProductStr(char * unsafe product_str);
|
|||||||
void XUA_Endpoint0_setProductStr(char * product_str);
|
void XUA_Endpoint0_setProductStr(char * product_str);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** Function to set the Serial string
|
||||||
|
*
|
||||||
|
* \param serial_str Serial string to set
|
||||||
|
*/
|
||||||
|
#ifdef __XC__
|
||||||
|
void XUA_Endpoint0_setSerialStr(char * unsafe serial_str);
|
||||||
|
#else
|
||||||
|
void XUA_Endpoint0_setSerialStr(char * serial_str);
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Function to set the BCD device
|
/** Function to set the BCD device
|
||||||
*
|
*
|
||||||
* \param bcdDevice BCD device to set
|
* \param bcdDevice BCD device to set
|
||||||
@@ -72,34 +82,44 @@ void XUA_Endpoint0_setBcdDevice(unsigned short bcdDevice);
|
|||||||
|
|
||||||
/** Function to get the Vendor string
|
/** Function to get the Vendor string
|
||||||
*
|
*
|
||||||
* \param vid vendor string
|
* \return vendor string
|
||||||
*/
|
*/
|
||||||
#ifdef __XC__
|
#ifdef __XC__
|
||||||
char * unsafe XUA_Endpoint0_getVendorStr();
|
char * unsafe XUA_Endpoint0_getVendorStr();
|
||||||
#else
|
#else
|
||||||
char * XUA_Endpoint0_getVendorStr(;
|
char * XUA_Endpoint0_getVendorStr();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Function to get the Product string
|
|
||||||
*
|
|
||||||
* \param pid Product string
|
|
||||||
*/
|
|
||||||
#ifdef __XC__
|
|
||||||
char * unsafe XUA_Endpoint0_getProductStr();
|
|
||||||
#else
|
|
||||||
char * XUA_Endpoint0_getProductStr(;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Function to get the Vendor string
|
|
||||||
*
|
|
||||||
* \return Vendor string
|
|
||||||
*/
|
|
||||||
unsigned short XUA_Endpoint0_getVendorId();
|
|
||||||
|
|
||||||
/** Function to get the Product string
|
/** Function to get the Product string
|
||||||
*
|
*
|
||||||
* \return Product string
|
* \return Product string
|
||||||
*/
|
*/
|
||||||
|
#ifdef __XC__
|
||||||
|
char * unsafe XUA_Endpoint0_getProductStr();
|
||||||
|
#else
|
||||||
|
char * XUA_Endpoint0_getProductStr();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Function to get the Serial Number string
|
||||||
|
*
|
||||||
|
* \return Serial string
|
||||||
|
*/
|
||||||
|
#ifdef __XC__
|
||||||
|
char * unsafe XUA_Endpoint0_getSerialStr();
|
||||||
|
#else
|
||||||
|
char * XUA_Endpoint0_getSerialStr();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Function to get the Vendor ID
|
||||||
|
*
|
||||||
|
* \return Vendor ID
|
||||||
|
*/
|
||||||
|
unsigned short XUA_Endpoint0_getVendorId();
|
||||||
|
|
||||||
|
/** Function to get the Product ID
|
||||||
|
*
|
||||||
|
* \return Product ID
|
||||||
|
*/
|
||||||
unsigned short XUA_Endpoint0_getProductId();
|
unsigned short XUA_Endpoint0_getProductId();
|
||||||
|
|
||||||
/** Function to get the BCD device
|
/** Function to get the BCD device
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
VERSION = 1.0.1
|
VERSION = 1.1.0
|
||||||
|
|
||||||
DEPENDENT_MODULES = lib_logging(>=3.0.0) \
|
DEPENDENT_MODULES = lib_logging(>=3.0.0) \
|
||||||
lib_xassert(>=4.0.0) \
|
lib_xassert(>=4.0.0) \
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ char g_product_str[XUA_MAX_STR_LEN] = PRODUCT_STR_A2;
|
|||||||
char g_product_str[XUA_MAX_STR_LEN] = PRODUCT_STR_A1;
|
char g_product_str[XUA_MAX_STR_LEN] = PRODUCT_STR_A1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Global variable for current USB Serial Number strings */
|
||||||
|
char g_serial_str[XUA_MAX_STR_LEN] = SERIAL_STR;
|
||||||
|
|
||||||
/* Subslot */
|
/* Subslot */
|
||||||
const unsigned g_subSlot_Out_HS[OUTPUT_FORMAT_COUNT] = {HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES,
|
const unsigned g_subSlot_Out_HS[OUTPUT_FORMAT_COUNT] = {HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES,
|
||||||
#if(OUTPUT_FORMAT_COUNT > 1)
|
#if(OUTPUT_FORMAT_COUNT > 1)
|
||||||
@@ -289,6 +292,9 @@ void XUA_Endpoint0_setStrTable() {
|
|||||||
concatenateAndCopyStrings(g_product_str, "", g_strTable.usbInputTermStr_Audio2);
|
concatenateAndCopyStrings(g_product_str, "", g_strTable.usbInputTermStr_Audio2);
|
||||||
concatenateAndCopyStrings(g_product_str, "", g_strTable.usbOutputTermStr_Audio2);
|
concatenateAndCopyStrings(g_product_str, "", g_strTable.usbOutputTermStr_Audio2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// update Serial strings
|
||||||
|
concatenateAndCopyStrings(g_serial_str, "", g_strTable.serialStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XUA_Endpoint0_setVendorStr(char* vendor_str) {
|
void XUA_Endpoint0_setVendorStr(char* vendor_str) {
|
||||||
@@ -301,6 +307,11 @@ void XUA_Endpoint0_setProductStr(char* product_str) {
|
|||||||
concatenateAndCopyStrings(product_str, "", g_product_str);
|
concatenateAndCopyStrings(product_str, "", g_product_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XUA_Endpoint0_setSerialStr(char* serial_str) {
|
||||||
|
debug_printf("XUA_Endpoint0_setSerialStr() with string %s\n", serial_str);
|
||||||
|
concatenateAndCopyStrings(serial_str, "", g_serial_str);
|
||||||
|
}
|
||||||
|
|
||||||
char* XUA_Endpoint0_getVendorStr() {
|
char* XUA_Endpoint0_getVendorStr() {
|
||||||
return g_strTable.vendorStr;
|
return g_strTable.vendorStr;
|
||||||
}
|
}
|
||||||
@@ -313,6 +324,10 @@ char* XUA_Endpoint0_getProductStr() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* XUA_Endpoint0_getSerialStr() {
|
||||||
|
return g_strTable.serialStr;
|
||||||
|
}
|
||||||
|
|
||||||
void XUA_Endpoint0_setProductId(unsigned short pid) {
|
void XUA_Endpoint0_setProductId(unsigned short pid) {
|
||||||
#if (AUDIO_CLASS == 1)
|
#if (AUDIO_CLASS == 1)
|
||||||
devDesc_Audio1.idProduct = pid;
|
devDesc_Audio1.idProduct = pid;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#define XUA_CTRL_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\08"
|
#define XUA_CTRL_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\08"
|
||||||
#define XUA_MIDI_OUT_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\09"
|
#define XUA_MIDI_OUT_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\09"
|
||||||
#define XUA_MIDI_IN_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0a"
|
#define XUA_MIDI_IN_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0a"
|
||||||
|
#define XUA_SERIAL_EMPTY_STRING "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0b"
|
||||||
|
|
||||||
// The value below must match the length of XUA_DESCR_EMPTY_STRING.
|
// The value below must match the length of XUA_DESCR_EMPTY_STRING.
|
||||||
#define XUA_MAX_STR_LEN (32)
|
#define XUA_MAX_STR_LEN (32)
|
||||||
@@ -334,7 +335,7 @@ StringDescTable_t g_strTable =
|
|||||||
{
|
{
|
||||||
.langID = "\x09\x04", /* US English */
|
.langID = "\x09\x04", /* US English */
|
||||||
.vendorStr = XUA_VENDOR_EMPTY_STRING,
|
.vendorStr = XUA_VENDOR_EMPTY_STRING,
|
||||||
.serialStr = "",
|
.serialStr = XUA_SERIAL_EMPTY_STRING,
|
||||||
#if (AUDIO_CLASS == 2)
|
#if (AUDIO_CLASS == 2)
|
||||||
.productStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
|
.productStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
|
||||||
.outputInterfaceStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
|
.outputInterfaceStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
|
||||||
@@ -434,7 +435,7 @@ USB_Descriptor_Device_t devDesc_Audio1 =
|
|||||||
.bcdDevice = BCD_DEVICE,
|
.bcdDevice = BCD_DEVICE,
|
||||||
.iManufacturer = offsetof(StringDescTable_t, vendorStr)/sizeof(char *),
|
.iManufacturer = offsetof(StringDescTable_t, vendorStr)/sizeof(char *),
|
||||||
.iProduct = offsetof(StringDescTable_t, productStr_Audio1)/sizeof(char *),
|
.iProduct = offsetof(StringDescTable_t, productStr_Audio1)/sizeof(char *),
|
||||||
.iSerialNumber = 0,
|
.iSerialNumber = offsetof(StringDescTable_t, serialStr)/sizeof(char *),
|
||||||
.bNumConfigurations = 1
|
.bNumConfigurations = 1
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@@ -470,7 +471,7 @@ USB_Descriptor_Device_t devDesc_Audio2 =
|
|||||||
.bcdDevice = BCD_DEVICE,
|
.bcdDevice = BCD_DEVICE,
|
||||||
.iManufacturer = offsetof(StringDescTable_t, vendorStr)/sizeof(char *),
|
.iManufacturer = offsetof(StringDescTable_t, vendorStr)/sizeof(char *),
|
||||||
.iProduct = offsetof(StringDescTable_t, productStr_Audio2)/sizeof(char *),
|
.iProduct = offsetof(StringDescTable_t, productStr_Audio2)/sizeof(char *),
|
||||||
.iSerialNumber = 0,
|
.iSerialNumber = offsetof(StringDescTable_t, serialStr)/sizeof(char *),
|
||||||
.bNumConfigurations = 0x02 /* Set to 2 such that windows does not load composite driver */
|
.bNumConfigurations = 0x02 /* Set to 2 such that windows does not load composite driver */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -493,7 +494,7 @@ unsigned char devDesc_Null[] =
|
|||||||
(BCD_DEVICE >> 8), /* 13 bcdDevice : Device release number */
|
(BCD_DEVICE >> 8), /* 13 bcdDevice : Device release number */
|
||||||
offsetof(StringDescTable_t, vendorStr)/sizeof(char *),
|
offsetof(StringDescTable_t, vendorStr)/sizeof(char *),
|
||||||
offsetof(StringDescTable_t, productStr_Audio2)/sizeof(char *),
|
offsetof(StringDescTable_t, productStr_Audio2)/sizeof(char *),
|
||||||
0, /* 16 iSerialNumber : Index of serial number decriptor */
|
offsetof(StringDescTable_t, serialStr)/sizeof(char *), /* 16 iSerialNumber : Index of serial number decriptor */
|
||||||
0x01 /* 17 bNumConfigurations : Number of possible configs */
|
0x01 /* 17 bNumConfigurations : Number of possible configs */
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2018, XMOS Ltd, All rights reserved
|
// Copyright (c) 2018-2020, XMOS Ltd, All rights reserved
|
||||||
//#include "devicedefines.h"
|
//#include "devicedefines.h"
|
||||||
|
|
||||||
#define MAX_MIX_COUNT 8
|
#define MAX_MIX_COUNT 8
|
||||||
|
|||||||
Reference in New Issue
Block a user