Merge branch 'develop' into feature/windows-dfu

This commit is contained in:
Oscar Bailey
2020-10-27 10:53:37 +00:00
43 changed files with 1994 additions and 752 deletions

2
.gitignore vendored
View File

@@ -19,6 +19,7 @@
.DS_Store
test_results.csv
_build*
**/.venv/**
# waf build files
.lock-waf_*
@@ -26,3 +27,4 @@ _build*
build/
.build*
*.pyc
xscope.xmt

7
Brewfile Normal file
View File

@@ -0,0 +1,7 @@
tap 'homebrew/core'
brew 'perl'
brew 'cpanm'
brew 'python@2'
brew 'pipenv'

View File

@@ -1,24 +1,81 @@
lib_xua Change Log
==================
1.1.1
-----
* RESOLVED: Zero length input packets generated before enumeration causing I2S
timing pushout at startup
* CHANGED: Pin Python package versions
* REMOVED: not necessary cpanfile
1.1.0
-----
* ADDED: Ability to read or modify serial number string
1.0.1
-----
* FIXED: Wrong size of vendor and product strings
1.0.0
-----
* ADDED: UAC1 HID support with simulated Voice Command detection reported
every 10 seconds
* ADDED: Support for USB HID Set Idle request
* ADDED: Pre-processor symbols to enable single-threaded, dual-PDM
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
* 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
* CHANGE HID report descriptor to use generic events instead of GPI
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 and strings
* ADDED: Ability to read or modify bcdDevice
* ADDED: Override USB descriptor with sampling frequency and
bit-resolution set at boot time.
* ADDED: Global pointer to allow external access to masterClockFreq
0.2.1
-----
* HOTFIX: Fix descriptors for XUA_ADAPTIVE
0.2.0
-----
* ADDED: Initial library documentation
* ADDED: Application note AN00247: Using lib_xua with lib_spdif (transmit)
* ADDED: Separate callbacks for input/output audio stream start/stop
* CHANGE: I2S hardware resources no longer used globally and must be passed
to XUA_AudioHub()
* CHANGE: XUA_AudioHub() no longer pars S/PDIF transmitter task
* CHANGE: Moved to lib_spdif (from module_spdif_tx & module_spdif_rx)
* CHANGE: Define NUM_PDM_MICS renamed to XUA_NUM_PDM_MICS
* CHANGE: Define NO_USB renamed to XUA_USB_EN
* CHANGE: Build files updated to support new "xcommon" behaviour in xwaf.
* RESOLVED: wChannelConfig in UAC1 descriptor set according to output channel
count
* RESOLVED: Indexing of ADAT channel strings (#18059)
* RESOLVED: Rebooting device fails when PLL config "not reset" bit is set
* Changes to dependencies:
- lib_spdif: Added dependency 3.0.0
- lib_dsp: Added dependency 5.0.0
- lib_mic_array: Added dependency 4.0.0
- lib_spdif: Added dependency 3.1.0
- lib_xassert: Added dependency 3.0.1
0.1.2
-----
@@ -92,7 +149,7 @@ Legacy release history
7.3.0
-----
- CHANGE: Example OSX DFU host app updated to now take PID as runtime
- CHANGE: Example OSX DFU host app updated to now take PID as runtime
argument. This enabled multiple XMOS devices to be attached to the host
during DFU process

103
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,103 @@
@Library('xmos_jenkins_shared_library@v0.14.2') _
getApproval()
pipeline {
agent none
environment {
REPO = 'lib_xua'
VIEW = getViewName(REPO)
}
options {
skipDefaultCheckout()
}
stages {
stage('Basic tests') {
agent {
label 'x86_64&&brew'
}
stages {
stage('Get view') {
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
}
}
stage('Library checks') {
steps {
xcoreLibraryChecks("${REPO}")
}
}
stage('Tests') {
steps {
runXmostest("${REPO}", 'tests')
}
}
stage('xCORE builds') {
steps {
dir("${REPO}") {
xcoreAllAppNotesBuild('examples')
dir("${REPO}") {
runXdoc('doc')
}
}
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build host apps') {
failFast true
parallel {
stage('Build Linux host app') {
agent {
label 'x86_64&&brew&&linux'
}
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
dir("${REPO}/${REPO}/host/xmosdfu") {
sh 'make -f Makefile.Linux64'
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build Mac host app') {
agent {
label 'x86_64&&brew&&macOS'
}
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
dir("${REPO}/${REPO}/host/xmosdfu") {
sh 'make -f Makefile.OSX64'
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
}
}
stage('Update') {
agent {
label 'x86_64&&brew'
}
steps {
updateViewfiles()
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
}
}

View File

@@ -1,6 +1,6 @@
Software Release License Agreement
Copyright (c) 2011-2018, XMOS, All rights reserved.
Copyright (c) 2011-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.

View File

@@ -1,6 +1,6 @@
Software Release License Agreement
Copyright (c) 2018, XMOS, All rights reserved.
Copyright (c) 2018-2019, 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.

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved
#ifndef _XUA_CONF_H_
#define _XUA_CONF_H_
@@ -21,5 +21,6 @@
#define PID_AUDIO_1 1
#define PID_AUDIO_2 2
#define XUA_DFU_EN 0 /* Disable DFU (for simplicity of example */
#define MIC_DUAL_ENABLED 0 // Use multi-threaded design
#endif

View File

@@ -1,6 +1,6 @@
Software Release License Agreement
Copyright (c) 2018, XMOS, All rights reserved.
Copyright (c) 2018-2019, 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.

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved
#ifndef _XUA_CONF_H_
#define _XUA_CONF_H_
@@ -26,5 +26,6 @@
#define AUDIO_CLASS_FALLBACK 0
#define BCD_DEVICE 0x1234
#define XUA_DFU_EN 0
#define MIC_DUAL_ENABLED 0 // Use multi-threaded design
#endif

View File

@@ -1,6 +1,6 @@
Software Release License Agreement
Copyright (c) 2018, XMOS, All rights reserved.
Copyright (c) 2018-2019, 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.

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2017-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2017-2019, XMOS Ltd, All rights reserved
#ifndef _XUA_CONF_H_
#define _XUA_CONF_H_
@@ -25,5 +25,6 @@
#define AUDIO_CLASS_FALLBACK 0
#define BCD_DEVICE 0x1234
#define XUA_DFU_EN 0
#define MIC_DUAL_ENABLED 0 // Use multi-threaded design
#endif

View File

@@ -1,6 +1,6 @@
Software Release License Agreement
Copyright (c) 2017-2018, 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.

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved
#ifndef __XUA_BUFFER_H__
#define __XUA_BUFFER_H__
@@ -58,7 +58,7 @@ void XUA_Buffer(
chanend c_sof,
chanend c_aud_ctl,
in port p_off_mclk
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
, chanend c_hid
#endif
, chanend c_aud
@@ -97,7 +97,7 @@ void XUA_Buffer_Ep(chanend c_aud_out,
chanend c_sof,
chanend c_aud_ctl,
in port p_off_mclk
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
, chanend c_hid
#endif
#ifdef CHAN_BUFF_CTRL

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved
/*
* @brief Defines relating to device configuration and customisation of lib_xua
* @author Ross Owen, XMOS Limited
@@ -288,6 +288,13 @@
#define PDM_MIC_INDEX (0)
#endif
/**
* @brief Size of a frame of microphone data samples. Default: 1
*/
#ifndef XUA_MIC_FRAME_SIZE
#define XUA_MIC_FRAME_SIZE (1)
#endif
/**
* @brief Enable MIDI functionality including buffering, descriptors etc. Default: DISABLED
*/
@@ -425,10 +432,6 @@
#define HID_CONTROLS (0)
#endif
#if defined(HID_CONTROLS) && (HID_CONTROLS == 0)
#undef HID_CONTROLS
#endif
/* @brief Defines whether XMOS device runs as master (i.e. drives LR and Bit clocks)
*
* 0: XMOS is I2S master. 1: CODEC is I2s master.
@@ -439,6 +442,16 @@
#define CODEC_MASTER (0)
#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.
*
@@ -1158,6 +1171,10 @@
#endif
#if (defined(UAC_FORCE_FEEDBACK_EP) && UAC_FORCE_FEEDBACK_EP == 0)
#undef UAC_FORCE_FEEDBACK_EP
#endif
#ifndef __ASSEMBLER__
/* Endpoint addresses enums */
enum USBEndpointNumber_In
@@ -1173,7 +1190,7 @@ enum USBEndpointNumber_In
#ifdef MIDI
ENDPOINT_NUMBER_IN_MIDI,
#endif
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
ENDPOINT_NUMBER_IN_HID,
#endif
#ifdef IAP
@@ -1438,6 +1455,12 @@ enum USBEndpointNumber_Out
#error Bad DEFAULT_MCLK_FREQ
#endif
/* DFU functional descriptor wDetachTimeOut field (milliseconds)
* Time for device to wait for bus reset after DETACH request before reverting to idle state */
#ifndef DFU_DETACH_TIME_OUT
#define DFU_DETACH_TIME_OUT 250
#endif
#if ((MCLK_441 % MIN_FREQ) == 0)
#define MIN_FREQ_44 MIN_FREQ
#define MIN_FREQ_48 ((48000 * 512)/((44100 * 512)/MIN_FREQ))
@@ -1459,4 +1482,3 @@ enum USBEndpointNumber_Out
#if (CODEC_MASTER == 1) && (DSD_CHANS_DAC != 0)
#error CODEC_MASTER with DSD is currently unsupported
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved
#ifndef _XUA_ENDPOINT0_H_
#define _XUA_ENDPOINT0_H_
@@ -28,5 +28,105 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioCtrl,
chanend ?c_mix_ctl,chanend ?c_clk_ctl, chanend ?c_EANativeTransport_ctr, client interface i_dfu ?dfuInterface
VENDOR_REQUESTS_PARAMS_DEC_);
/** Function to set the Vendor ID value
*
* \param vid vendor ID value to set
*/
void XUA_Endpoint0_setVendorId(unsigned short vid);
/** Function to set the Product ID value
*
* \param pid Product ID value to set
*/
void XUA_Endpoint0_setProductId(unsigned short pid);
/** Function to set the Vendor string
*
* \param vendor_str Vendor string to set
*/
#ifdef __XC__
void XUA_Endpoint0_setVendorStr(char * unsafe vendor_str);
#else
void XUA_Endpoint0_setVendorStr(char * vendor_str);
#endif
/** Function to set the Product string
*
* \param product_str Product string to set
*/
#ifdef __XC__
void XUA_Endpoint0_setProductStr(char * unsafe product_str);
#else
void XUA_Endpoint0_setProductStr(char * product_str);
#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
*
* \param bcdDevice BCD device to set
*/
void XUA_Endpoint0_setBcdDevice(unsigned short bcdDevice);
/** Function to get the Vendor string
*
* \return vendor string
*/
#ifdef __XC__
char * unsafe XUA_Endpoint0_getVendorStr();
#else
char * XUA_Endpoint0_getVendorStr();
#endif
/** Function to get the 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();
/** Function to get the BCD device
*
* \return BCD device
*/
unsigned short XUA_Endpoint0_getBcdDevice();
#endif
#endif

View File

@@ -0,0 +1,18 @@
// Copyright (c) 2017-2020, XMOS Ltd, All rights reserved
#ifndef __XUA_API_H__
#define __XUA_API_H__
#include <stdint.h>
void set_usb_to_device_rate(uint32_t rate);
void set_device_to_usb_rate(uint32_t rate);
void set_usb_to_device_bit_res(uint32_t rate);
void set_device_to_usb_bit_res(uint32_t rate);
uint32_t get_usb_to_device_rate();
uint32_t get_device_to_usb_rate();
uint32_t get_usb_to_device_bit_res();
uint32_t get_device_to_usb_bit_res();
#endif //__XUA_API_H__

View File

@@ -1,36 +1,68 @@
# You can set flags specifically for your module by using the MODULE_XCC_FLAGS
# variable. So the following
#
# MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3
#
# specifies that everything in the modules should have the application
# build flags with -O3 appended (so the files will build at
# optimization level -O3).
#
# You can also set MODULE_XCC_C_FLAGS, MODULE_XCC_XC_FLAGS etc..
VERSION = 1.1.1
MODULE_XCC_FLAGS = $(XCC_FLAGS) -O3 -DREF_CLK_FREQ=100 -fasm-linenum -fcomment-asm -fsubword-select
DEPENDENT_MODULES = lib_logging(>=3.0.0) \
lib_xassert(>=4.0.0) \
lib_xud(>=1.0.0) \
lib_spdif(>=4.0.0) \
lib_mic_array(>=4.0.0)
MODULE_XCC_FLAGS = $(XCC_FLAGS) \
-O3 \
-DREF_CLK_FREQ=100 \
-fasm-linenum \
-fcomment-asm
# Core
XCC_FLAGS_xua_endpoint0.c = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue
XCC_FLAGS_xua_ep0_uacreqs.xc = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue
XCC_FLAGS_dbcalc.xc = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue
XCC_FLAGS_audioports.c = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue
XCC_FLAGS_audioports.xc = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue
# DFU
XCC_FLAGS_dfu.xc = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue
XCC_FLAGS_flash_interface.c = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue
XCC_FLAGS_flashlib_user.c = $(MODULE_XCC_FLAGS) -Os -mno-dual-issue
OPTIONAL_HEADERS += xua_conf.h
VERSION = 0.2.0
EXPORT_INCLUDE_DIRS = api \
src/core \
src/core/audiohub \
src/core/buffer/ep \
src/core/endpoint0 \
src/dfu
DEPENDENT_MODULES = lib_logging(>=2.1.0) lib_xud(>=0.1.0) lib_spdif(>=3.0.0)
INCLUDE_DIRS = $(EXPORT_INCLUDE_DIRS) \
src/core/buffer/decouple \
src/core/clocking \
src/core/mixer \
src/core/pdm_mics \
src/core/ports \
src/core/support \
src/core/support/powersave \
src/core/user \
src/core/user/audiostream \
src/core/user/hid \
src/core/user/hostactive \
src/midi
#ignore host dir
SOURCE_DIRS = src/*
SOURCE_DIRS = src/core \
src/core/audiohub \
src/core/buffer/decouple \
src/core/buffer/ep \
src/core/clocking \
src/core/endpoint0 \
src/core/mixer \
src/core/pdm_mics \
src/core/ports \
src/core/support \
src/core/support/powersave \
src/core/user/audiostream \
src/core/user/hostactive \
src/core/xuduser \
src/dfu \
src/hid \
src/midi
#core
EXCLUDE_FILES += descriptors_2.rst
XCC_FLAGS_xua_endpoint0.c = -Os -mno-dual-issue $(XCC_FLAGS)
XCC_FLAGS_xua_ep0_uacreqs.xc = -Os -mno-dual-issue $(XCC_FLAGS)
XCC_FLAGS_dbcalc.xc = -Os -mno-dual-issue $(XCC_FLAGS)
XCC_FLAGS_audioports.c = -Os -mno-dual-issue $(XCC_FLAGS)
XCC_FLAGS_audioports.xc = -Os -mno-dual-issue $(XCC_FLAGS)
#dfu
XCC_FLAGS_dfu.xc = -Os -mno-dual-issue $(XCC_FLAGS)
XCC_FLAGS_flash_interface.c = -Os -mno-dual-issue $(XCC_FLAGS)
XCC_FLAGS_flashlib_user.c = -Os -mno-dual-issue $(XCC_FLAGS)

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved
#include "xua.h"
#if XUA_USB_EN
@@ -7,16 +7,18 @@
#include "interrupt.h"
#include "xua_commands.h"
#include "xud.h"
#include "xua_usb_params_funcs.h"
#ifdef NATIVE_DSD
#include "usbaudio20.h" /* Defines from the USB Audio 2.0 Specifications */
#endif
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
#include "user_hid.h"
#endif
#define MAX(x,y) ((x)>(y) ? (x) : (y))
/* TODO use SLOTSIZE to potentially save memory */
/* Note we could improve on this, for one subslot is set to 4 */
/* The *4 is conversion to bytes, note we're assuming a slotsize of 4 here whic is potentially as waste */
@@ -136,6 +138,7 @@ unsigned unpackData = 0;
unsigned packState = 0;
unsigned packData = 0;
/* Default to something sensible but the following are setup at stream start (unless UAC1 only..) */
#if (AUDIO_CLASS == 2)
unsigned g_curSubSlot_Out = HS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES;
@@ -145,7 +148,6 @@ unsigned g_curSubSlot_Out = FS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES;
unsigned g_curSubSlot_In = FS_STREAM_FORMAT_INPUT_1_SUBSLOT_BYTES;
#endif
/* IN packet size. Init to something sensible, but expect to be re-set before stream start */
#if (AUDIO_CLASS==2)
int g_maxPacketSize = MAX_DEVICE_AUD_PACKET_SIZE_IN_HS;
@@ -158,6 +160,10 @@ int g_maxPacketSize = MAX_DEVICE_AUD_PACKET_SIZE_IN_FS;
void handle_audio_request(chanend c_mix_out)
{
int space_left;
#if(defined XUA_USB_DESCRIPTOR_OVERWRITE_RATE_RES)
g_curSubSlot_Out = get_usb_to_device_bit_res() >> 3;
g_curSubSlot_In = get_device_to_usb_bit_res() >> 3;
#endif
/* Input word that triggered interrupt and handshake back */
unsigned underflowSample = inuint(c_mix_out);

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved
#include "xua.h"
#if XUA_USB_EN
#include <xs1.h>
@@ -19,9 +19,9 @@
#include "xud.h"
#include "testct_byref.h"
#ifdef HID_CONTROLS
#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);
@@ -36,9 +36,10 @@ extern unsigned int g_curSamFreqMultiplier;
#define SET_SHARED_GLOBAL0(x,y) SET_SHARED_GLOBAL(x,y)
#endif
/* Global var for speed. Related to feedback. Used by input stream to determine IN packet size */
unsigned g_speed;
/* Initialise g_speed now so we get a sensible packet size until we start properly calculating feedback in the SoF case */
/* Without this, zero size input packets fill the input FIFO and it takes a long time to clear out when feedback starts */
/* This can cause a delay to the decouple ISR being serviced pushing our I2S timing. Initialising solves this */
unsigned g_speed = (AUDIO_CLASS == 2) ? (DEFAULT_FREQ/8000) << 16 : (DEFAULT_FREQ/1000) << 16;
unsigned g_freqChange = 0;
unsigned feedbackValid = 0;
@@ -120,7 +121,7 @@ void XUA_Buffer(
chanend c_sof,
chanend c_aud_ctl,
in port p_off_mclk
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
, chanend c_hid
#endif
, chanend c_aud
@@ -164,7 +165,7 @@ void XUA_Buffer(
c_clk_int,
#endif
c_sof, c_aud_ctl, p_off_mclk
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
, c_hid
#endif
#ifdef CHAN_BUFF_CTRL
@@ -182,6 +183,8 @@ void XUA_Buffer(
}
}
// Allows us to externally modify masterClockFreq
unsafe{volatile unsigned * unsafe masterClockFreq_ptr;}
/**
* Buffers data from audio endpoints
@@ -223,7 +226,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
chanend c_sof,
chanend c_aud_ctl,
in port p_off_mclk
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
, chanend c_hid
#endif
#ifdef CHAN_BUFF_CTRL
@@ -260,7 +263,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
XUD_ep ep_int = XUD_InitEp(c_ep_int);
#endif
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
XUD_ep ep_hid = XUD_InitEp(c_hid);
#endif
unsigned u_tmp;
@@ -268,6 +271,8 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
unsigned masterClockFreq = DEFAULT_MCLK_FREQ;
unsigned lastClock = 0;
unsafe{masterClockFreq_ptr = &masterClockFreq;}
unsigned clocks = 0;
long long clockcounter = 0;
@@ -364,7 +369,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
#endif
#endif
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
XUD_SetReady_In(ep_hid, g_hidData, 1);
#endif
@@ -875,12 +880,12 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
#endif
#endif
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
/* HID Report Data */
case XUD_SetData_Select(c_hid, ep_hid, result):
{
g_hidData[0]=0;
UserReadHIDButtons(g_hidData);
UserHIDGetData(g_hidData);
XUD_SetReady_In(ep_hid, g_hidData, 1);
}
break;

View File

@@ -1,3 +1,4 @@
# Copyright (c) 2015-2018, XMOS Ltd, All rights reserved
def genstrings(outputChanCount, chanString, portString, structureString, adc_dac):

View File

@@ -1,8 +1,13 @@
// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2015-2019, XMOS Ltd, All rights reserved
#ifndef __DESCRIPTOR_DEFS_H__
#define __DESCRIPTOR_DEFS_H__
/*
Include xua.h to pick up the #defines of NUM_USB_CHAN_IN and NUM_USB_CHAN_OUT.
*/
#include "xua.h"
#if (NUM_USB_CHAN_IN > 0) && (NUM_USB_CHAN_OUT > 0)
#define AUDIO_INTERFACE_COUNT 3
#elif (NUM_USB_CHAN_IN > 0) || (NUM_USB_CHAN_OUT > 0)
@@ -54,10 +59,14 @@ enum USBInterfaceNumber
INTERFACE_NUMBER_IAP_EA_NATIVE_TRANS,
#endif
#endif
#if defined(HID_CONTROLS) && (HID_CONTROLS != 0)
#if( 0 < HID_CONTROLS )
INTERFACE_NUMBER_HID,
#endif
INTERFACE_COUNT /* End marker */
};
#if( 0 < HID_CONTROLS )
#define ENDPOINT_INT_INTERVAL_IN_HID 0x08
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved
/**
* @file xua_ep0_descriptors.h
* @brief Device Descriptors
@@ -26,7 +26,33 @@
#define APPEND_PRODUCT_STR_A1(x) PRODUCT_STR_A1 " "#x
#define STR_TABLE_ENTRY(name) char *name
#define STR_TABLE_ENTRY(name) char * name
// The empty strings below are used in the g_strTable to set the maximum size of the table entries
// The last char of the strings are different, so that the compiler allocates separate memory spaces
#define XUA_VENDOR_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\01"
#define XUA_PRODUCT_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\02"
#define XUA_CLOCK_SELECTOR_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\03"
#define XUA_INTERNAL_CLOCK_SELECTOR_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\04"
#define XUA_SPDIF_CLOCK_SOURCE_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\05"
#define XUA_ADAT_CLOCK_SOURCE_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\06"
#define XUA_DFU_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\07"
#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_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.
#define XUA_MAX_STR_LEN (32)
#define ISO_EP_ATTRIBUTES_ASYNCH 0x05 //ISO, ASYNCH, DATA EP
#define ISO_EP_ATTRIBUTES_ADAPTIVE 0x09 //ISO, ADAPTIVE, DATA EP
#define ISO_EP_IMPL_ATTRIBUTES_ASYNCH 0x25 //ISO, ASYNCH, IMPLICIT FB DATA EP
#define ISO_EP_IMPL_ATTRIBUTES_ADAPTIVE 0x29 //ISO, ADAPTIVE, IMPLICIT FB DATA EP
#if (defined(XUA_ADAPTIVE) && (XUA_ADAPTIVE == 0))
#undef XUA_ADAPTIVE
#endif
#if __STDC__
typedef struct
@@ -308,41 +334,42 @@ typedef struct
StringDescTable_t g_strTable =
{
.langID = "\x09\x04", /* US English */
.vendorStr = VENDOR_STR,
.serialStr = "",
.vendorStr = XUA_VENDOR_EMPTY_STRING,
.serialStr = XUA_SERIAL_EMPTY_STRING,
#if (AUDIO_CLASS == 2)
.productStr_Audio2 = PRODUCT_STR_A2,
.outputInterfaceStr_Audio2 = APPEND_PRODUCT_STR_A2(),
.inputInterfaceStr_Audio2 = APPEND_PRODUCT_STR_A2(),
.usbInputTermStr_Audio2 = APPEND_PRODUCT_STR_A2(),
.usbOutputTermStr_Audio2 = APPEND_PRODUCT_STR_A2(),
.productStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
.outputInterfaceStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
.inputInterfaceStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
.usbInputTermStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
.usbOutputTermStr_Audio2 = XUA_PRODUCT_EMPTY_STRING,
#endif
#if (AUDIO_CLASS_FALLBACK) || (AUDIO_CLASS == 1)
.productStr_Audio1 = PRODUCT_STR_A1,
.outputInterfaceStr_Audio1 = APPEND_PRODUCT_STR_A1(),
.inputInterfaceStr_Audio1 = APPEND_PRODUCT_STR_A1(),
.usbInputTermStr_Audio1 = APPEND_PRODUCT_STR_A1(),
.usbOutputTermStr_Audio1 = APPEND_PRODUCT_STR_A1(),
.productStr_Audio1 = XUA_PRODUCT_EMPTY_STRING,
.outputInterfaceStr_Audio1 = XUA_PRODUCT_EMPTY_STRING,
.inputInterfaceStr_Audio1 = XUA_PRODUCT_EMPTY_STRING,
.usbInputTermStr_Audio1 = XUA_PRODUCT_EMPTY_STRING,
.usbOutputTermStr_Audio1 = XUA_PRODUCT_EMPTY_STRING,
#endif
#if (AUDIO_CLASS == 2)
.clockSelectorStr = APPEND_VENDOR_STR(Clock Selector),
.internalClockSourceStr = APPEND_VENDOR_STR(Internal Clock),
.clockSelectorStr = XUA_CLOCK_SELECTOR_EMPTY_STRING,
.internalClockSourceStr = XUA_INTERNAL_CLOCK_SELECTOR_EMPTY_STRING,
#if SPDIF_RX
.spdifClockSourceStr = APPEND_VENDOR_STR(S/PDIF Clock),
.spdifClockSourceStr = XUA_SPDIF_CLOCK_SOURCE_EMPTY_STRING,
#endif
#if ADAT_RX
.adatClockSourceStr = APPEND_VENDOR_STR(ADAT Clock),
.adatClockSourceStr = XUA_ADAT_CLOCK_SOURCE_EMPTY_STRING,
#endif
#endif
#if (XUA_DFU_EN == 1)
.dfuStr = APPEND_VENDOR_STR(DFU),
.dfuStr = XUA_DFU_EMPTY_STRING,
#endif
#ifdef USB_CONTROL_DESCS
.ctrlStr = APPEND_VENDOR_STR(Control),
.ctrlStr = XUA_CTRL_EMPTY_STRING,
#endif
#ifdef MIDI
.midiOutStr = APPEND_VENDOR_STR(MIDI Out),
.midiInStr = APPEND_VENDOR_STR(MIDI In),
.midiOutStr = XUA_MIDI_OUT_EMPTY_STRING,
.midiInStr = XUA_MIDI_IN_EMPTY_STRING,
#endif
#include "chanstrings.h"
@@ -408,13 +435,28 @@ USB_Descriptor_Device_t devDesc_Audio1 =
.bcdDevice = BCD_DEVICE,
.iManufacturer = offsetof(StringDescTable_t, vendorStr)/sizeof(char *),
.iProduct = offsetof(StringDescTable_t, productStr_Audio1)/sizeof(char *),
.iSerialNumber = 0,
.iSerialNumber = offsetof(StringDescTable_t, serialStr)/sizeof(char *),
.bNumConfigurations = 1
};
#endif
#if (AUDIO_CLASS == 2)
/* Device Descriptor for Audio Class 2.0 (Assumes High-Speed ) */
/* Device Descriptor for Audio Class 2.0 (Assumes High-Speed )
*
* The use of two configurations dates back to Windows XP (could be SP2). This
* lacked some standards support and incorrectly parsed the full audio class 2.0
* descriptor with its IADs (Interface Association Descriptors). The observed
* behaviour included loading the built-in audio class 1.0 driver on some
* interfaces (possibly the wrong ones, too), and hanging.
*
* Presenting a blank configuration first prevented loading the composite driver
* and issues arising from it, while still allowing to load a vendor driver on
* the actual configuration.
*
* Recent Windows subsystem can parse our class 2.0 descriptor correctly
* (certainly Windows 7 and onwards). It may be possible to remove this
* workaround.
*/
USB_Descriptor_Device_t devDesc_Audio2 =
{
.bLength = sizeof(USB_Descriptor_Device_t),
@@ -429,7 +471,7 @@ USB_Descriptor_Device_t devDesc_Audio2 =
.bcdDevice = BCD_DEVICE,
.iManufacturer = offsetof(StringDescTable_t, vendorStr)/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 */
};
@@ -452,7 +494,7 @@ unsigned char devDesc_Null[] =
(BCD_DEVICE >> 8), /* 13 bcdDevice : Device release number */
offsetof(StringDescTable_t, vendorStr)/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 */
};
#endif
@@ -537,27 +579,30 @@ unsigned char devQualDesc_Null[] =
#define MIXER_LENGTH (0)
#endif
#ifdef HID_CONTROLS
unsigned char hidReportDescriptor[] =
#if( 0 < HID_CONTROLS )
unsigned char hidReportDescriptor[] = /* Voice Command usage as per request #HUTRR45 */
{
0x05, 0x0c, /* Usage Page (Consumer Device) */
0x09, 0x01, /* Usage (Consumer Control) */
0xa1, 0x01, /* Collection (Application) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x09, 0xb0, /* Usage (Play) */
0x09, 0xb5, /* Usage (Scan Next Track) */
0x09, 0xb6, /* Usage (Scan Previous Track) */
0x09, 0xe9, /* Usage (Volume Up) */
0x09, 0xea, /* Usage (Volume Down) */
0x09, 0xe2, /* Usage (Mute) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x06, /* Report Count (6) */
0x81, 0x02, /* Input (Data, Var, Abs) */
0x95, 0x02, /* Report Count (2) */
0x81, 0x01, /* Input (Cnst, Ary, Abs) */
0xc0 /* End collection */
0x05, 0x01, /* Usage Page (Generic Desktop) */
0x09, 0x06, /* Usage (Keyboard) */
0xa1, 0x01, /* Collection (Application) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x04, /* Report Count (4) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x00, /* Logical Maximum (0) */
0x81, 0x01, /* Input (Cnst, Ary, Abs, No Wrap, Lin, Pref, No Nul) */
0x95, 0x01, /* Report Count (1) */
0x25, 0x01, /* Logical Maximum (1) */
0x05, 0x0C, /* Usage Page (Consumer) */
0x0a, 0x21, 0x02, /* Usage (AC Search) */
0x81, 0x02, /* Input (Data, Var, Abs, No Wrap, Lin, Pref, No Nul) */
0x0a, 0x26, 0x02, /* Usage (AC Stop) */
0x81, 0x02, /* Input (Data, Var, Abs, No Wrap, Lin, Pref, No Nul) */
0x95, 0x02, /* Report Count (2) */
0x05, 0x07, /* Usage Page (Key Codes) */
0x19, 0x72, /* Usage Minimum (Keyboard F23) */
0x29, 0x73, /* Usage Maximum (Keyboard F24) */
0x81, 0x02, /* Input (Data, Var, Abs, No Wrap, Lin, Pref, No Nul) */
0xc0 /* End collection (Application) */
};
#endif
@@ -760,7 +805,7 @@ typedef struct
#endif
#endif
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
USB_Descriptor_Interface_t HID_Interface;
unsigned char hidDesc[9]; //TODO ideally we would have a struct for this.
USB_Descriptor_Endpoint_t HID_In_Endpoint;
@@ -1075,7 +1120,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
},
0, /* 60 iFeature */
},
#endif
#endif /* (OUTPUT_VOLUME_CONTROL == 1) */
/* Output Terminal Descriptor (Audio) */
.Audio_Out_OutputTerminal =
@@ -1095,7 +1140,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
0x0000, /* 9 bmControls */
0, /* 11 iTerminal */
},
#endif
#endif /* (NUM_USB_CHAN_OUT > 0) */
@@ -1250,7 +1295,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
},
0, /* 60 iFeature */
},
#endif
#endif /* (INPUT_VOLUME_CONTROL == 1) */
.Audio_In_OutputTerminal =
{
@@ -1271,7 +1316,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bmControls = 0x0000,
.iTerminal = offsetof(StringDescTable_t, usbOutputTermStr_Audio2)/sizeof(char *)
},
#endif
#endif /* (NUM_USB_CHAN_IN > 0) */
#if defined(MIXER) && (MAX_MIX_COUNT > 0)
/* Extension Unit Descriptor (4.7.2.12) */
@@ -1365,7 +1410,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
0x00, /* bmControls */
0 /* Mixer unit string descriptor index */
},
#endif
#endif /* defined(MIXER) && (MAX_MIX_COUNT > 0) */
#if (SPDIF_RX) || (ADAT_RX)
/* Standard AS Interrupt Endpoint Descriptor (4.8.2.1): */
@@ -1448,7 +1493,15 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bLength = sizeof(USB_Descriptor_Endpoint_t),
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = ENDPOINT_ADDRESS_OUT_AUDIO,
.bmAttributes = 0x05, /* (bitmap) */
#ifdef XUA_ADAPTIVE
.bmAttributes = ISO_EP_ATTRIBUTES_ADAPTIVE,
#else
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = ISO_EP_ATTRIBUTES_ASYNCH, /* Iso, async, data endpoint */
#else
.bmAttributes = ISO_EP_IMPL_ATTRIBUTES_ASYNCH, /* Feedback data endpoint */
#endif
#endif
.wMaxPacketSize = HS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE,
.bInterval = 1,
},
@@ -1526,7 +1579,15 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bLength = sizeof(USB_Descriptor_Endpoint_t),
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = ENDPOINT_ADDRESS_OUT_AUDIO,
.bmAttributes = 0x05,
#ifdef XUA_ADAPTIVE
.bmAttributes = ISO_EP_ATTRIBUTES_ADAPTIVE,
#else
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = ISO_EP_ATTRIBUTES_ASYNCH, /* Iso, async, data endpoint */
#else
.bmAttributes = ISO_EP_IMPL_ATTRIBUTES_ASYNCH, /* Feedback data endpoint */
#endif
#endif
.wMaxPacketSize = HS_STREAM_FORMAT_OUTPUT_2_MAXPACKETSIZE,
.bInterval = 1,
},
@@ -1554,7 +1615,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
4, /* 6 bInterval. Only values <= 1 frame (4) supported by MS */
},
#endif
#endif
#endif /* OUTPUT_FORMAT_COUNT > 1 */
#if (OUTPUT_FORMAT_COUNT > 2)
/* Standard AS Interface Descriptor (4.9.1) (Alt) */
.Audio_Out_StreamInterface_Alt3 =
@@ -1606,7 +1667,15 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = ENDPOINT_ADDRESS_OUT_AUDIO,
.bmAttributes = 0x05,
#ifdef XUA_ADAPTIVE
.bmAttributes = ISO_EP_ATTRIBUTES_ADAPTIVE,
#else
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = ISO_EP_ATTRIBUTES_ASYNCH, /* Iso, async, data endpoint */
#else
.bmAttributes = ISO_EP_IMPL_ATTRIBUTES_ASYNCH, /* Feedback data endpoint */
#endif
#endif
.wMaxPacketSize = HS_STREAM_FORMAT_OUTPUT_3_MAXPACKETSIZE,
.bInterval = 1,
},
@@ -1699,10 +1768,14 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = ENDPOINT_ADDRESS_IN_AUDIO,
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = 0x05, /* Iso, async, data endpoint */
#ifdef XUA_ADAPTIVE
.bmAttributes = ISO_EP_ATTRIBUTES_ADAPTIVE,
#else
.bmAttributes = 0x25, /* Iso, async, implicit feedback data endpoint */
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = ISO_EP_ATTRIBUTES_ASYNCH, /* Iso, async, data endpoint */
#else
.bmAttributes = ISO_EP_IMPL_ATTRIBUTES_ASYNCH, /* Feedback data endpoint */
#endif
#endif
.wMaxPacketSize = HS_STREAM_FORMAT_INPUT_1_MAXPACKETSIZE,
.bInterval = 0x01,
@@ -1767,10 +1840,14 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = ENDPOINT_ADDRESS_IN_AUDIO,
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = 0x05, /* Iso, async, data endpoint */
#ifdef XUA_ADAPTIVE
.bmAttributes = ISO_EP_ATTRIBUTES_ADAPTIVE,
#else
.bmAttributes = 0x25, /* Iso, async, implicit feedback data endpoint */
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = ISO_EP_ATTRIBUTES_ASYNCH, /* Iso, async, data endpoint */
#else
.bmAttributes = ISO_EP_IMPL_ATTRIBUTES_ASYNCH, /* Feedback data endpoint */
#endif
#endif
.wMaxPacketSize = HS_STREAM_FORMAT_INPUT_2_MAXPACKETSIZE,
.bInterval = 0x01,
@@ -1787,7 +1864,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bLockDelayUnits = 0x02,
.wLockDelay = 0x0008,
},
#endif
#endif /* (INPUT_FORMAT_COUNT > 1) */
#if (INPUT_FORMAT_COUNT > 2)
/* Alternative 3 */
/* Standard AS Interface Descriptor (4.9.1) (Alt) */
@@ -1836,10 +1913,14 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bLength = 0x07,
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
.bEndpointAddress = ENDPOINT_ADDRESS_IN_AUDIO,
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = 0x05, /* Iso, async, data endpoint */
#ifdef XUA_ADAPTIVE
.bmAttributes = ISO_EP_ATTRIBUTES_ADAPTIVE,
#else
.bmAttributes = 0x25, /* Iso, async, implicit feedback data endpoint */
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
.bmAttributes = ISO_EP_ATTRIBUTES_ASYNCH, /* Iso, async, data endpoint */
#else
.bmAttributes = ISO_EP_IMPL_ATTRIBUTES_ASYNCH, /* Feedback data endpoint */
#endif
#endif
.wMaxPacketSize = HS_STREAM_FORMAT_INPUT_3_MAXPACKETSIZE,
.bInterval = 0x01,
@@ -1856,7 +1937,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
.bLockDelayUnits = 0x02,
.wLockDelay = 0x0008,
},
#endif
#endif /* (INPUT_FORMAT_COUNT > 2) */
#endif /* #if(NUM_USB_CHAN_IN > 0) */
#ifdef MIDI
@@ -2005,14 +2086,14 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
0x09, /* 0 Size */
0x21, /* 1 bDescriptorType : DFU FUNCTIONAL */
0x07, /* 2 bmAttributes */
0xFA, /* 3 wDetachTimeOut */
0x00, /* 4 wDetachTimeOut */
DFU_DETACH_TIME_OUT & 0xFF, /* 3 wDetachTimeOut */
(DFU_DETACH_TIME_OUT >> 8) & 0xFF, /* 4 wDetachTimeOut */
0x40, /* 5 wTransferSize */
0x00, /* 6 wTransferSize */
0x10, /* 7 bcdDFUVersion */
0x01}, /* 7 bcdDFUVersion */
#endif
#endif
#endif /* (XUA_DFU_EN == 1) */
#ifdef IAP
/* Interface descriptor */
@@ -2121,7 +2202,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
#endif
#endif /* IAP */
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
.HID_Interface =
{
9, /* 0 bLength : Size of descriptor in Bytes */
@@ -2155,22 +2236,22 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
ENDPOINT_ADDRESS_IN_HID, /* 2 bEndpointAddress */
3, /* 3 bmAttributes (INTERRUPT) */
64, /* 4 wMaxPacketSize */
8, /* 6 bInterval */
ENDPOINT_INT_INTERVAL_IN_HID, /* 6 bInterval */
}
#endif
};
#endif
#endif /* (AUDIO_CLASS == 2) */
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
unsigned char hidDescriptor[] =
{
9, /* 0 bLength : Size of descriptor in Bytes */
0x09, /* 0 bLength : Size of descriptor in Bytes */
0x21, /* 1 bDescriptorType (HID) */
0x10, /* 2 bcdHID */
0x01, /* 3 bcdHID */
0, /* 4 bCountryCode */
1, /* 5 bNumDescriptors */
0x00, /* 4 bCountryCode */
0x01, /* 5 bNumDescriptors */
0x22, /* 6 bDescriptorType[0] (Report) */
sizeof(hidReportDescriptor) & 0xff, /* 7 wDescriptorLength[0] */
sizeof(hidReportDescriptor) >> 8, /* 8 wDescriptorLength[0] */
@@ -2230,6 +2311,8 @@ unsigned char cfgDesc_Null[] =
* To work around this we repeat MAX_FREQ_FS multiple times in some cases */
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
const unsigned num_freqs_a1 = MAX(3, (0
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
+ 1
@@ -2277,18 +2360,13 @@ const unsigned num_freqs_a1 = MAX(3, (0
#define DFU_INTERFACES_A1 0
#endif
/* Total number of bytes returned for the class-specific AudioControl interface descriptor.
* Includes the combined length of this descriptor header and all Unit and Terminal descriptors
* For us this is IT -> FU -> OT * 2 and a header */
#define AC_TOTAL_LENGTH (AC_LENGTH + \
(INPUT_INTERFACES_A1 * (12 + ( (8 + NUM_USB_CHAN_IN_FS) * INPUT_VOLUME_CONTROL) + 9)) +\
(OUTPUT_INTERFACES_A1 * (12 + ( (8 + NUM_USB_CHAN_OUT_FS) * OUTPUT_VOLUME_CONTROL) + 9)))
#define STREAMING_INTERFACES (INPUT_INTERFACES_A1 + OUTPUT_INTERFACES_A1)
//#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
//#define CFG_TOTAL_LENGTH_A1 (18 + AC_TOTAL_LENGTH + (INPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + (OUTPUT_INTERFACES_A1 * (58 + num_freqs_a1 * 3)) + CONTROL_INTERFACE_BYTES + DFU_INTERFACE_BYTES)
//#endif
#if( 0 < HID_CONTROLS )
#define HID_INTERFACE_BYTES ( 9 + 9 + 7 )
#define HID_INTERFACES_A1 1
#else
#define HID_INTERFACE_BYTES 0
#define HID_INTERFACES_A1 0
#endif
/* Total number of bytes returned for the class-specific AudioControl interface descriptor.
* Includes the combined length of this descriptor header and all Unit and Terminal descriptors
@@ -2301,12 +2379,27 @@ const unsigned num_freqs_a1 = MAX(3, (0
/* Number of interfaces for Audio 1.0 (+1 for control ) */
/* Note, this is different that INTERFACE_COUNT since we dont support items such as MIDI, iAP etc in UAC1 mode */
#define NUM_INTERFACES_A1 (1+INPUT_INTERFACES_A1 + OUTPUT_INTERFACES_A1+NUM_CONTROL_USB_INTERFACES+DFU_INTERFACES_A1)
#define NUM_INTERFACES_A1 (1 + INPUT_INTERFACES_A1 + OUTPUT_INTERFACES_A1 + NUM_CONTROL_USB_INTERFACES + DFU_INTERFACES_A1 + HID_INTERFACES_A1)
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
#define CFG_TOTAL_LENGTH_A1 (18 + AC_TOTAL_LENGTH + (INPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + (OUTPUT_INTERFACES_A1 * (58 + num_freqs_a1 * 3)) + CONTROL_INTERFACE_BYTES + DFU_INTERFACE_BYTES)
#if ((NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP))
#define CFG_TOTAL_LENGTH_A1 (18 + AC_TOTAL_LENGTH + (INPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + (OUTPUT_INTERFACES_A1 * (58 + num_freqs_a1 * 3)) + CONTROL_INTERFACE_BYTES + DFU_INTERFACE_BYTES + HID_INTERFACE_BYTES)
#else
#define CFG_TOTAL_LENGTH_A1 (18 + AC_TOTAL_LENGTH + (INPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + (OUTPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + CONTROL_INTERFACE_BYTES + DFU_INTERFACE_BYTES)
#define CFG_TOTAL_LENGTH_A1 (18 + AC_TOTAL_LENGTH + (INPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + (OUTPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + CONTROL_INTERFACE_BYTES + DFU_INTERFACE_BYTES + HID_INTERFACE_BYTES)
#endif
#ifdef XUA_USB_DESCRIPTOR_OVERWRITE_RATE_RES
#define AS_INTERFACE_BYTES (7)
#define INTERFACE_DESCRIPTOR_BYTES (9)
#define AS_FORMAT_TYPE_BYTES (17)
#define USB_AS_IN_INTERFACE_DESCRIPTOR_OFFSET_SUB_FRAME (18 + AC_TOTAL_LENGTH + (OUTPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + (2*INTERFACE_DESCRIPTOR_BYTES) + (AS_INTERFACE_BYTES) + 5)
#define USB_AS_OUT_INTERFACE_DESCRIPTOR_OFFSET_SUB_FRAME (18 + AC_TOTAL_LENGTH + (2*INTERFACE_DESCRIPTOR_BYTES) + (AS_INTERFACE_BYTES) + 5)
#define USB_AS_IN_INTERFACE_DESCRIPTOR_OFFSET_FREQ (18 + AC_TOTAL_LENGTH + (OUTPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + (2*INTERFACE_DESCRIPTOR_BYTES) + (AS_INTERFACE_BYTES) + 8)
#define USB_AS_OUT_INTERFACE_DESCRIPTOR_OFFSET_FREQ (18 + AC_TOTAL_LENGTH + (2*INTERFACE_DESCRIPTOR_BYTES) + (AS_INTERFACE_BYTES) + 8)
#define USB_AS_IN_EP_DESCRIPTOR_OFFSET_MAXPACKETSIZE (18 + AC_TOTAL_LENGTH + (OUTPUT_INTERFACES_A1 * (49 + num_freqs_a1 * 3)) + (2*INTERFACE_DESCRIPTOR_BYTES) + (AS_INTERFACE_BYTES) + (AS_FORMAT_TYPE_BYTES) + 4)
#define USB_AS_OUT_EP_DESCRIPTOR_OFFSET_MAXPACKETSIZE (18 + AC_TOTAL_LENGTH + (2*INTERFACE_DESCRIPTOR_BYTES) + (AS_INTERFACE_BYTES) + (AS_FORMAT_TYPE_BYTES) + 4)
#endif
#define CHARIFY_SR(x) (x & 0xff),((x & 0xff00)>> 8),((x & 0xff0000)>> 16)
@@ -2541,7 +2634,6 @@ unsigned char cfgDesc_Audio1[] =
NUM_USB_CHAN_OUT_FS, /* nrChannels */
FS_STREAM_FORMAT_OUTPUT_1_SUBSLOT_BYTES, /* subFrameSize */
FS_STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS, /* bitResolution */
num_freqs_a1, /* SamFreqType - sample freq count */
/* Windows enum issue with <= two sample rates work around */
@@ -2598,16 +2690,28 @@ unsigned char cfgDesc_Audio1[] =
/* Standard AS Isochronous Audio Data Endpoint Descriptor 4.6.1.1 */
0x09,
0x05, /* ENDPOINT */
0x01, /* endpointAddress - D7, direction (0 OUT, 1 IN). D6..4 reserved (0). D3..0 endpoint no. */
0x05, /* attributes - isochronous async */
ENDPOINT_ADDRESS_OUT_AUDIO, /* endpointAddress - D7, direction (0 OUT, 1 IN). D6..4 reserved (0). D3..0 endpoint no. */
#ifdef XUA_ADAPTIVE
ISO_EP_ATTRIBUTES_ADAPTIVE,
#else
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
ISO_EP_ATTRIBUTES_ASYNCH, /* Iso, async, data endpoint */
#else
ISO_EP_IMPL_ATTRIBUTES_ASYNCH, /* Feedback data endpoint */
#endif
#endif
(FS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE&0xff), /* 4 wMaxPacketSize (Typically 294 bytes)*/
(FS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE&0xff00)>>8, /* 5 wMaxPacketSize */
0x01, /* bInterval */
0x00, /* bRefresh */
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
ENDPOINT_ADDRESS_IN_FEEDBACK, /* bSynchAdddress - address of EP used to communicate sync info */
#else /* Bi-directional in/out device */
#ifdef XUA_ADAPTIVE
0, /* OUT */
#else
ENDPOINT_ADDRESS_IN_AUDIO,
#endif
#endif
/* CS_Endpoint Descriptor ?? */
@@ -2616,7 +2720,11 @@ unsigned char cfgDesc_Audio1[] =
0x01, /* subtype - GENERAL */
0x01, /* attributes. D[0]: sample freq ctrl. */
0x02, /* bLockDelayUnits */
0x00, 0x00, /* bLockDelay */
#ifdef XUA_ADAPTIVE
0x08, 0x00, /* bLockDelay */
#else
0x00, 0x00, /* Not used */
#endif
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
/* Feedback EP */
@@ -2727,10 +2835,14 @@ unsigned char cfgDesc_Audio1[] =
0x09,
0x05, /* ENDPOINT */
ENDPOINT_ADDRESS_IN_AUDIO, /* EndpointAddress */
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
0x05, /* Iso, async, data endpoint */
#ifdef XUA_ADAPTIVE
ISO_EP_ATTRIBUTES_ADAPTIVE,
#else
0x25, /* Iso, async, implicit feedback data endpoint */
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
ISO_EP_ATTRIBUTES_ASYNCH, /* Iso, async, data endpoint */
#else
ISO_EP_IMPL_ATTRIBUTES_ASYNCH, /* Feedback data endpoint */
#endif
#endif
FS_STREAM_FORMAT_INPUT_1_MAXPACKETSIZE&0xff, /* 4 wMaxPacketSize (Typically 294 bytes)*/
(FS_STREAM_FORMAT_INPUT_1_MAXPACKETSIZE&0xff00)>>8, /* 5 wMaxPacketSize */
@@ -2743,8 +2855,13 @@ unsigned char cfgDesc_Audio1[] =
0x25, /* CS_ENDPOINT */
0x01, /* Subtype - GENERAL */
0x01, /* Attributes. D[0]: sample freq ctrl. */
0x00, /* Unused */
0x00, 0x00, /* Unused */
#ifdef XUA_ADAPTIVE
0x02, /* Lock Delay units PCM samples*/
0x08, 0x00, /* No lock delay */
#else
0x00, /* Undefined */
0x00, 0x00, /* Not used */
#endif // XUA_ADAPTIVE
#endif
#if (XUA_DFU_EN == 1) && (FORCE_UAC1_DFU == 1)
@@ -2766,8 +2883,8 @@ unsigned char cfgDesc_Audio1[] =
0x09, /* 0 Size */
0x21, /* 1 bDescriptorType : DFU FUNCTIONAL */
0x07, /* 2 bmAttributes */
0xFA, /* 3 wDetachTimeOut */
0x00, /* 4 wDetachTimeOut */
DFU_DETACH_TIME_OUT & 0xFF, /* 3 wDetachTimeOut */
(DFU_DETACH_TIME_OUT >> 8) & 0xFF, /* 4 wDetachTimeOut */
0x40, /* 5 wTransferSize */
0x00, /* 6 wTransferSize */
0x10, /* 7 bcdDFUVersion */
@@ -2787,6 +2904,39 @@ unsigned char cfgDesc_Audio1[] =
offsetof(StringDescTable_t, ctrlStr)/sizeof(char *), /* 8 iInterface */
#endif
#if( 0 < HID_CONTROLS )
/* HID interface descriptor */
0x09, /* 0 bLength : Size of descriptor in Bytes */
0x04, /* 1 bDescriptorType (Interface: 0x04)*/
INTERFACE_NUMBER_HID, /* 2 bInterfaceNumber : Number of interface */
0x00, /* 3 bAlternateSetting : Value used alternate interfaces using SetInterface Request */
0x01, /* 4: bNumEndpoints : Number of endpoitns for this interface (excluding 0) */
0x03, /* 5: bInterfaceClass */
0x00, /* 6: bInterfaceSubClass - no boot device */
0x00, /* 7: bInterfaceProtocol*/
0x00, /* 8 iInterface */
/* HID descriptor */
0x09, /* 0 bLength : Size of descriptor in Bytes */
0x21, /* 1 bDescriptorType (HID) */
0x10, /* 2 bcdHID */
0x01, /* 3 bcdHID */
0x00, /* 4 bCountryCode */
0x01, /* 5 bNumDescriptors */
0x22, /* 6 bDescriptorType[0] (Report) */
0x2B, /* 7 wDescriptorLength[0] */
0x00, /* 8 wDescriptorLength[0] */
/* HID Endpoint descriptor (IN) */
0x07, /* 0 bLength */
0x05, /* 1 bDescriptorType */
ENDPOINT_ADDRESS_IN_HID, /* 2 bEndpointAddress */
0x03, /* 3 bmAttributes (INTERRUPT) */
0x40, /* 4 wMaxPacketSize */
0x00, /* 5 wMaxPacketSize */
ENDPOINT_INT_INTERVAL_IN_HID, /* 6 bInterval */
#endif
};
#endif
#endif

View File

@@ -1,17 +1,17 @@
// Copyright (c) 2014-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2014-2020, XMOS Ltd, All rights reserved
#ifndef _AUDIOREQUESTS_H_
#define _AUDIOREQUESTS_H_
#include <xccompat.h>
int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, REFERENCE_PARAM(USB_SetupPacket_t, sp), chanend c_audioControl,
int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, REFERENCE_PARAM(USB_SetupPacket_t, sp), NULLABLE_RESOURCE(chanend, c_audioControl),
NULLABLE_RESOURCE(chanend, c_mix_ctl), NULLABLE_RESOURCE(chanend, c_clk_ctl));
XUD_Result_t AudioClassRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, REFERENCE_PARAM(USB_SetupPacket_t, sp), chanend c_audioControl,
XUD_Result_t AudioClassRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, REFERENCE_PARAM(USB_SetupPacket_t, sp), NULLABLE_RESOURCE(chanend, c_audioControl),
NULLABLE_RESOURCE(chanend, c_mix_ctl), NULLABLE_RESOURCE(chanend, c_clk_ctl));
int AudioEndpointRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, REFERENCE_PARAM(USB_SetupPacket_t, sp), chanend c_audioControl,
int AudioEndpointRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, REFERENCE_PARAM(USB_SetupPacket_t, sp), NULLABLE_RESOURCE(chanend, c_audioControl),
NULLABLE_RESOURCE(chanend, c_mix_ctl), NULLABLE_RESOURCE(chanend, c_clk_ctl));

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved
/**
* @brief Implements relevant requests from the USB Audio 2.0 Specification
* @author Ross Owen, XMOS Semiconductor
@@ -273,7 +273,7 @@ static void updateVol(int unitID, int channel, chanend ?c_mix_ctl)
* XUD_RES_RST for device reset
* else XUD_RES_ERR
*/
int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, chanend c_audioControl, chanend ?c_mix_ctl, chanend ?c_clk_ctl
int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, chanend ?c_audioControl, chanend ?c_mix_ctl, chanend ?c_clk_ctl
)
{
unsigned int buffer[32];
@@ -1071,7 +1071,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
#if (AUDIO_CLASS_FALLBACK != 0) || (AUDIO_CLASS == 1)
int AudioEndpointRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, chanend c_audioControl, chanend ?c_mix_ctl, chanend ?c_clk_ctl)
int AudioEndpointRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, chanend ?c_audioControl, chanend ?c_mix_ctl, chanend ?c_clk_ctl)
{
/* At this point we know:
* bmRequestType.Recipient = Endpoint
@@ -1159,7 +1159,7 @@ int AudioEndpointRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp
/* Handles the Audio Class 1.0 specific requests */
XUD_Result_t AudioClassRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, chanend c_audioControl, chanend ?c_mix_ctl, chanend ?c_clk_ctl
XUD_Result_t AudioClassRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, chanend ?c_audioControl, chanend ?c_mix_ctl, chanend ?c_clk_ctl
)
{
#if (OUTPUT_VOLUME_CONTROL == 1) || (INPUT_VOLUME_CONTROL == 1)

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2012-2019, XMOS Ltd, All rights reserved
#include "xua.h" /* Device specific defines */
#ifndef EXCLUDE_USB_AUDIO_MAIN
@@ -259,7 +259,7 @@ XUD_EpType epTypeTableIn[ENDPOINT_COUNT_IN] = { XUD_EPTYPE_CTL | XUD_STATUS_ENAB
#ifdef MIDI
XUD_EPTYPE_BUL,
#endif
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
XUD_EPTYPE_INT,
#endif
#ifdef IAP
@@ -400,7 +400,7 @@ VENDOR_REQUESTS_PARAMS_DEC_
c_clk_int,
#endif
c_sof, c_aud_ctl, p_for_mclk_count
#ifdef HID_CONTROLS
#if( 0 < HID_CONTROLS )
, c_xud_in[ENDPOINT_NUMBER_IN_HID]
#endif
#ifdef CHAN_BUFF_CTRL

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2018, XMOS Ltd, All rights reserved
// Copyright (c) 2018-2020, XMOS Ltd, All rights reserved
//#include "devicedefines.h"
#define MAX_MIX_COUNT 8

View File

@@ -1,15 +1,26 @@
// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2015-2019, XMOS Ltd, All rights reserved
#ifndef MIC_ARRAY_CONF_H_
#define MIC_ARRAY_CONF_H_
#include "xua_conf_full.h"
// The default definition of MIC_ARRAY_MAX_FRAME_SIZE_LOG2 must appear in this file
// because an assembler file #includes it.
// The assembler does not understand C language syntax, only C pre-processor syntax.
#ifndef MIC_ARRAY_MAX_FRAME_SIZE_LOG2
#define MIC_ARRAY_MAX_FRAME_SIZE_LOG2 0
#define MIC_ARRAY_MAX_FRAME_SIZE_LOG2 (0)
#endif
#ifndef MIC_ARRAY_NUM_MICS
#define MIC_ARRAY_NUM_MICS (XUA_NUM_PDM_MICS)
#endif
// MIC_DUAL_FRAME_SIZE has no meaning if MIC_DUAL_ENABLED is false.
// Only define MIC_DUAL_FRAME_SIZE if MIC_DUAL_ENABLED is true.
#if defined(MIC_DUAL_ENABLED) && (MIC_DUAL_ENABLED != 0)
#ifndef MIC_DUAL_FRAME_SIZE
#define MIC_DUAL_FRAME_SIZE (XUA_MIC_FRAME_SIZE)
#endif
#endif
#endif /* MIC_ARRAY_CONF_H_ */

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2015-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2015-2019, XMOS Ltd, All rights reserved
#include "xua.h"
@@ -88,7 +88,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio)
fir_coefs[6] = g_third_stage_div_12_fir;
//dcc = {MIC_ARRAY_MAX_FRAME_SIZE_LOG2, 1, 0, 0, decimationfactor, fir_coefs[decimationfactor/2], 0, 0, DECIMATOR_NO_FRAME_OVERLAP, 2};
dcc.frame_size_log2 = MIC_ARRAY_MAX_FRAME_SIZE_LOG2;
dcc.len = MIC_ARRAY_MAX_FRAME_SIZE_LOG2;
dcc.apply_dc_offset_removal = 1;
dcc.index_bit_reversal = 0;
dcc.windowing_function = null;
@@ -107,6 +107,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio)
dc[0].mic_gain_compensation[2]=0;
dc[0].mic_gain_compensation[3]=0;
dc[0].channel_count = 4;
dc[0].async_interface_enabled = 0;
dc[1].dcc = &dcc;
dc[1].data = mic_decimator_fir_data[4];
dc[1].mic_gain_compensation[0]=0;
@@ -114,6 +115,7 @@ void XUA_PdmBuffer(streaming chanend c_ds_output[2], chanend c_audio)
dc[1].mic_gain_compensation[2]=0;
dc[1].mic_gain_compensation[3]=0;
dc[1].channel_count = 4;
dc[0].async_interface_enabled = 0;
mic_array_decimator_configure(c_ds_output, decimatorCount, dc);

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved
#include <xs1.h>
#include <platform.h>
#include <print.h>
@@ -12,7 +12,7 @@
#if (XUD_SERIES_SUPPORT == 4)
#include "xs2_su_registers.h"
#define XS2_SU_PERIPH_USB_ID 0x1
#define PLL_MASK 0x7FFFFFFF
#define PLL_MASK 0x3FFFFFFF
#else
#define PLL_MASK 0xFFFFFFFF
#endif

View File

@@ -1,6 +1,9 @@
// Copyright (c) 2013-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2013-2019, XMOS Ltd, All rights reserved
/* Default implementations of AudioStreamStop() and AudioStreamStart()
* callbacks.
*/
/* Deafult implementations of AudioStreamStop() and AudioStreamStart(). Both can be over-ridden */
void UserAudioStreamStop() __attribute__ ((weak));
void UserAudioStreamStop()
{
@@ -12,3 +15,27 @@ void UserAudioStreamStart()
{
return;
}
void UserAudioInputStreamStop() __attribute__ ((weak));
void UserAudioInputStreamStop()
{
return;
}
void UserAudioInputStreamStart() __attribute__ ((weak));
void UserAudioInputStreamStart()
{
return;
}
void UserAudioOutputStreamStop() __attribute__ ((weak));
void UserAudioOutputStreamStop()
{
return;
}
void UserAudioOutputStreamStart() __attribute__ ((weak));
void UserAudioOutputStreamStart()
{
return;
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved
#ifndef _AUDIOSTREAM_H_
#define _AUDIOSTREAM_H_
@@ -14,5 +14,17 @@ void UserAudioStreamStart(void);
/* Any actions required on stream stop e.g. DAC mute - run every steam stop */
void UserAudioStreamStop(void);
/* Any actions required on input stream start */
void UserAudioInputStreamStart(void);
/* Any actions required on input stream stop */
void UserAudioInputStreamStop(void);
/* Any actions required on output stream start */
void UserAudioOutputStreamStart(void);
/* Any actions required on output stream stop */
void UserAudioOutputStreamStop(void);
#endif

View File

@@ -0,0 +1,85 @@
// Copyright (c) 2013-2020, XMOS Ltd, All rights reserved
#ifndef __USER_HID_H__
#define __USER_HID_H__
/**
* \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,
HID_EVENT_ID_GPI2,
HID_EVENT_ID_GPI3,
HID_EVENT_ID_EVT0,
HID_EVENT_ID_EVT1,
HID_EVENT_ID_EVT2,
HID_EVENT_ID_EVT3,
HID_EVENT_ID_EVT4,
HID_EVENT_ID_EVT5,
HID_EVENT_ID_EVT6,
HID_EVENT_ID_EVT7,
HID_EVENT_ID_EVT8,
HID_EVENT_ID_EVT9,
HID_EVENT_ID_EVT10,
HID_EVENT_ID_EVT11,
HID_EVENT_ID_EVT12,
HID_EVENT_ID_EVT13,
HID_EVENT_ID_EVT14,
HID_EVENT_ID_EVT15,
HID_EVENT_ID_EVT16,
HID_EVENT_ID_EVT17,
HID_EVENT_ID_EVT18,
HID_EVENT_ID_EVT19,
HID_EVENT_ID_EVT20,
HID_EVENT_ID_EVT21,
HID_EVENT_ID_EVT22,
HID_EVENT_ID_EVT23,
HID_EVENT_ID_EVT24,
HID_EVENT_ID_EVT25,
HID_EVENT_ID_EVT26,
HID_EVENT_ID_EVT27,
HID_EVENT_ID_INVALID = 0xffffffff,
} hidEventId_t;
#define HID_DATA_BYTES 4
#if( 0 < HID_CONTROLS )
/**
* \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 );
/**
* \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__ */

View File

@@ -1,13 +0,0 @@
// Copyright (c) 2013-2018, XMOS Ltd, All rights reserved
/* 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
void UserReadHIDButtons(unsigned char hidData[]);

249
lib_xua/src/hid/hid.xc Normal file
View File

@@ -0,0 +1,249 @@
// Copyright (c) 2019, XMOS Ltd, All rights reserved
#include <xs1.h>
#include "descriptor_defs.h"
#include "hid.h"
#include "xud.h"
#include "xud_std_requests.h"
#include "xua_hid.h"
#if( 0 < HID_CONTROLS )
#define MS_IN_TICKS 100000U
static unsigned s_hidChangePending = 0U;
static unsigned s_hidCurrentPeriod = ENDPOINT_INT_INTERVAL_IN_HID * MS_IN_TICKS;
static unsigned s_hidIdleActive = 0U;
static unsigned s_hidIndefiniteDuration = 0U;
static unsigned s_hidNextReportTime = 0U;
static unsigned s_hidReportTime = 0U;
unsafe {
volatile unsigned * unsafe s_hidChangePendingPtr = &s_hidChangePending;
}
static unsigned HidCalcNewReportTime( const unsigned currentPeriod, const unsigned reportTime, const unsigned reportToSetIdleInterval, const unsigned newPeriod );
static unsigned HidCalcReportToSetIdleInterval( const unsigned reportTime );
static unsigned HidFindSetIdleActivationPoint( const unsigned currentPeriod, const unsigned timeWithinPeriod );
static XUD_Result_t HidProcessSetIdleRequest( XUD_ep c_ep0_out, XUD_ep c_ep0_in, USB_SetupPacket_t &sp );
static unsigned HidTimeDiff( const unsigned earlierTime, const unsigned laterTime );
void HidCalcNextReportTime( void )
{
s_hidNextReportTime = s_hidReportTime + s_hidCurrentPeriod;
}
void HidCaptureReportTime( void )
{
timer tmr;
tmr :> s_hidReportTime;
}
XUD_Result_t HidInterfaceClassRequests(
XUD_ep c_ep0_out,
XUD_ep c_ep0_in,
USB_SetupPacket_t &sp )
{
XUD_Result_t result = XUD_RES_ERR;
switch ( sp.bRequest ) {
case HID_SET_IDLE:
result = HidProcessSetIdleRequest( c_ep0_out, c_ep0_in, sp );
break;
default:
break;
}
return result;
}
void HidClearChangePending( void )
{
unsafe {
*s_hidChangePendingPtr = 0U;
}
}
unsigned HidIsChangePending( void )
{
return( s_hidChangePending != 0 );
}
unsigned HidIsSetIdleSilenced( void )
{
unsigned isSilenced = s_hidIdleActive;
if( s_hidIdleActive ) {
unsigned currentTime;
// Use inline assembly to access the time without creating a side-effect.
// The mapper complains if the time comes from an XC timer because this function is called in the guard of a select case.
// Appearently the use of a timer creates a side-effect that prohibits the operation of the select functionality.
asm volatile( "gettime %0" : "=r" ( currentTime ));
isSilenced = ( s_hidIndefiniteDuration || ( timeafter( s_hidNextReportTime, currentTime )));
}
return isSilenced;
}
void HidSetChangePending( void )
{
unsafe {
*s_hidChangePendingPtr = 1;
}
}
/**
* \brief Calculate the timer value for sending the next HID Report.
*
* With regard to Section 7.2.4 Set_Idle Request of the USB Device Class Definition for Human
* Interface Devices (HID) Version 1.11, I've interpreted 'currently executing period' and
* 'current period' to mean the previously established Set Idle duration if one has been
* established or the polling interval from the HID Report Descriptor if a Set Idle duration
* has not been established.
*
* \param[in] currentPeriod -- The duration of the current period in timer ticks
* \param[in] reportTime -- The time at which the last HID Report was sent
* \param[in] reportToSetIdleInterval -- The time interval between receiving the Set Idle Request
* and sending the most recent HID Report
* \param[in] newPeriod -- The new period value in timer ticks
*
* \return The time at which the next HID Report should be sent
*/
static unsigned HidCalcNewReportTime( const unsigned currentPeriod, const unsigned reportTime, const unsigned reportToSetIdleInterval, const unsigned newPeriod )
{
unsigned nextReportTime = 0;
if( HidFindSetIdleActivationPoint( currentPeriod, reportToSetIdleInterval )) {
/* Activate immediately after sending the next HID Report */
nextReportTime = reportTime + currentPeriod;
} else {
/* Activate immediately after sending the most recent HID Report */
nextReportTime = reportTime + newPeriod;
}
return nextReportTime;
}
/**
* \brief Calculate the time interval between the most recent HID Report and a subsequent Set Idle Request
*
* \warning For this function to produce an accurate interval measument, it must be called without delay
* upon receiving a Set Idle Request from the USB Host.
*
* \param[in] reportTime -- The time at which the last HID Report was sent
*
* \return The time interval between receiving the Set Idle Request and sending the most recent HID Report
*/
static unsigned HidCalcReportToSetIdleInterval( const unsigned reportTime )
{
timer tmr;
unsigned setIdleTime;
tmr :> setIdleTime;
unsigned result = HidTimeDiff( reportTime, setIdleTime );
return result;
}
/**
* \brief Indicate if activation of the Set Idle Request happens at the previous or next HID Report
*
* Section 7.2.4 Set_Idle Request of the USB Device Class Definition for Human Interface
* Devices (HID) Version 1.11 makes two statements about the activation point for starting the
* duration of the request:
* - 'A new request will be executed as if it were issued immediately after the last report, if
* the new request is received at least 4 milliseconds before the end of the currently executing
* period.'
* - 'If the new request is received within 4 milliseconds of the end of the current period, then
* the new request will have no effect until after the report.'
*
* \param[in] currentPeriod -- The duration of the current period
* \param[in] timeWithinPeriod -- The current point in time relative to the current period
*
* \return A Boolean indicating where the activation of the Set Idle Request Duration occurs.
* \retval 1 -- Activate immediately after the next HID Report
* \retval 0 -- Activate immediately after the previous HID Report
*/
static unsigned HidFindSetIdleActivationPoint( const unsigned currentPeriod, const unsigned timeWithinPeriod )
{
unsigned result = (( currentPeriod - timeWithinPeriod ) < ( 4U * MS_IN_TICKS )) ? 1 : 0;
return result;
}
/**
* \brief Process a Set Idle request
*
* \param[in] c_ep0_out -- the channel that carries data from Endpoint 0
* \param[in] c_ep0_in -- the channel that carries data for Endpoint 0
* \param[in] sp -- a structure containing the Set Idle data
*
* \return An XUD status value
*/
static XUD_Result_t HidProcessSetIdleRequest( XUD_ep c_ep0_out, XUD_ep c_ep0_in, USB_SetupPacket_t &sp )
{
XUD_Result_t result = XUD_RES_ERR;
/*
The Set Idle request wValue field contains two sub-fields:
- Duration in the MSB; and
- Report ID in the LSB.
The Duration field specifies how long the USB Device responds with NAK provided the HID data hasn't changed.
Zero means indefinitely.
The value is in units of 4ms.
The Report ID identifies the HID report that the USB Host wishes to silence.
The Set Idle request xIndex field contains the interface number.
*/
uint16_t duration = ( sp.wValue & 0xFF00 ) >> 6; // Transform from units of 4ms into units of 1ms.
uint8_t reportId = sp.wValue & 0x00FF;
uint16_t interfaceNum = sp.wIndex;
/*
As long as our HID Report Descriptor does not include a Report ID, any Report ID value other than zero
indicates an error by the USB Host (see xua_ep0_descriptors.h for the definition of the HID
Report Descriptor).
Any Interface value other than INTERFACE_NUMBER_HID indicates an error by the USB Host.
*/
if(( 0U == reportId ) && ( INTERFACE_NUMBER_HID == interfaceNum )) {
s_hidIdleActive = (( 0U == duration ) || ( ENDPOINT_INT_INTERVAL_IN_HID < duration ));
if( s_hidIdleActive ) {
unsigned reportToSetIdleInterval = HidCalcReportToSetIdleInterval( s_hidReportTime );
s_hidNextReportTime = HidCalcNewReportTime( s_hidCurrentPeriod, s_hidReportTime, reportToSetIdleInterval, duration * MS_IN_TICKS );
s_hidCurrentPeriod = duration * MS_IN_TICKS;
s_hidIndefiniteDuration = ( 0U == duration );
} else {
s_hidCurrentPeriod = ENDPOINT_INT_INTERVAL_IN_HID * MS_IN_TICKS;
s_hidIndefiniteDuration = 0U;
}
result = XUD_DoSetRequestStatus( c_ep0_in );
}
return result;
}
/**
* \brief Calculate the difference between two points in time
*
* This function calculates the difference between two two points in time.
* It always returns a positive value even if the timer used to obtain the two
* time measurements has wrapped around.
*
* \warning If time values have been obtained from a timer that has wrapped
* more than once in between the two measurements, this function returns an
* incorrect value.
*
* \param[in] earlierTime -- A value from a timer
* \param[in] laterTime -- A value from a timer taken after \a earlierTime
*
* \return The interval between the two points in time
*/
static unsigned HidTimeDiff( const unsigned earlierTime, const unsigned laterTime )
{
return ( earlierTime < laterTime ) ? laterTime - earlierTime : UINT_MAX - earlierTime + laterTime;
}
#endif /* ( 0 < HID_CONTROLS ) */

77
lib_xua/src/hid/xua_hid.h Normal file
View File

@@ -0,0 +1,77 @@
// Copyright (c) 2019, XMOS Ltd, All rights reserved
#ifndef __XUA_HID_H__
#define __XUA_HID_H__
#include <xs1.h>
#include <xccompat.h>
#include "xud.h"
#include "xud_std_requests.h"
/**
* \brief Calculate the next time to respond with a HID Report.
*
* If the USB Host has previously sent a valid HID Set_Idle request with
* a duration of zero or greater than the default reporting interval,
* the device sends HID Reports periodically or when the value of the
* payload has changed.
*
* This function calculates the time for sending the next periodic
* HID Report.
*/
void HidCalcNextReportTime( void );
/**
* \brief Capture the time of sending the current HID Report.
*
* If the USB Host has previously sent a valid HID Set_Idle request with
* a duration of zero or greater than the default reporting interval,
* the device sends HID Reports periodically or when the value of the
* payload has changed.
*
* This function captures the time when the HID Report was sent so that
* a subsequent call to HidCalNextReportTime() can calculate the time
* to send the next periodic HID Report.
*/
void HidCaptureReportTime( void );
XUD_Result_t HidInterfaceClassRequests(
XUD_ep c_ep0_out,
XUD_ep c_ep0_in,
REFERENCE_PARAM( USB_SetupPacket_t, sp ));
/**
* \brief Register that previously changed HID Report data has reported
* to the USB Host.
*/
void HidClearChangePending( void );
/**
* \brief Indicate if a change to the HID Report data has been received.
*/
unsigned HidIsChangePending( void );
/**
* \brief Indicate whether to send a HID Report based on elapsed time.
*
* If the USB Host has previously sent a valid HID Set_Idle request with
* a duration of zero or greater than the default reporting interval,
* the device sends HID Reports periodically or when the value of the
* payload has changed.
*
* This function monitors the passage of time and reports to the caller
* whether or not the time to send the next periodic HID Report has
* elapsed.
*
* \return A Boolean value indicating whether or not to send the HID Report.
* \retval 1 -- Do not send the HID Report
* \retval 0 -- Send the HID Report
*/
unsigned HidIsSetIdleSilenced( void );
/**
* \brief Register that a change to the HID Report data has been received.
*/
void HidSetChangePending( void );
#endif // __XUA_HID_H__

View File

@@ -1,35 +0,0 @@
def use_module(bld):
bld.env.XCC_FLAGS = bld.env.XCC_FLAGS + [
'-O3', '-DREF_CLK_FREQ=100', '-fasm-linenum', '-fcomment-asm',
'-fsubword-select', '-DXUD_FULL_PIDTABLE=1'
]
source = bld.path.ant_glob(
[
'src/**/*.xc', 'src/**/*.c', 'src/**/*.S'
],
excl=[
'**/descriptors_2.rst'
])
depends_on = [
'lib_logging(>=2.0.0)', 'lib_xassert(>=2.0.0)', 'lib_xud(>=1.0.0)'
]
bld.env['XCC_FLAGS_endpoint0.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
bld.env['XCC_FLAGS_dbcalc.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
bld.env['XCC_FLAGS_audiorequests.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
bld.env['XCC_FLAGS_flashlib_user.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
bld.env['XCC_FLAGS_audioports.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
bld.env['XCC_FLAGS_audioports.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
bld.env['XCC_FLAGS_dfu.xc'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
bld.env['XCC_FLAGS_flash_interface.c'] = bld.env.XCC_FLAGS + ['-Os', '-mno-dual-issue']
bld.module(
source=source,
depends_on=depends_on,
includes=['api'],
optional_headers='xua_conf.h',
version='1.0.0')

19
python/setup.py Normal file
View File

@@ -0,0 +1,19 @@
# Copyright (c) 2020, XMOS Ltd, All rights reserved
import setuptools
# Another repository might depend on python code defined in this one. The
# procedure to set up a suitable python environment for that repository may
# pip-install this one as editable using this setup.py file. To minimise the
# chance of version conflicts while ensuring a minimal degree of conformity,
# the 3rd-party modules listed here require the same major version and at
# least the same minor version as specified in the requirements.txt file.
# The same modules should appear in the requirements.txt file as given below.
setuptools.setup(
name='lib_xua',
packages=setuptools.find_packages(),
install_requires=[
'flake8~=3.8',
],
dependency_links=[
],
)

34
requirements.txt Normal file
View File

@@ -0,0 +1,34 @@
# python_version 3.7.6
#
# The parse_version_from_requirements() function in the installPipfile.groovy
# file of the Jenkins Shared Library uses the python_version comment to set
# the version of python used.
# Distributed (released) dependencies
#
# The python modules listed below specify a known working combination required
# by the python code in this repository. The procedure used to set up a
# suitable python environment for it installs the version of each module in
# the list. Using a specific version ensures a controlled infrastructure for
# development, testing and release of this repository.
#
# Another repository might depend on python code defined in this one. The
# procedure to set up a suitable python environment for that repository may
# pip-install this one as editable using this repository's setup.py file. The
# same modules should appear in the setup.py list as given below.
flake8==3.8.3
# Development dependencies
#
# Each link listed below specifies the path to a setup.py file which are
# installed in editable mode with '-e $PATH' (without the quotes).
#
# If python code in this repository depends on python code under development
# in another repository, then an entry for that other respository should
# appear in this list instead of the released dependencies list.
#
# If this repository uses the setup functionality (e.g., script entry points)
# of its own setup.py file, then this list must include an entry for that
# setup.py file, e.g., '-e .' or '-e ./python' (without the quotes).
-e ./python

View File

@@ -1,6 +1,6 @@
Software Release License Agreement
Copyright (c) 2016-2018, XMOS, All rights reserved.
Copyright (c) 2016-2019, 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.

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2016-2018, XMOS Ltd, All rights reserved
// Copyright (c) 2016-2019, XMOS Ltd, All rights reserved
#ifndef __custom_defines_h__
#define __custom_defines_h__
@@ -22,5 +22,7 @@
#define AUDIO_CLASS_FALLBACK 0
#define BCD_DEVICE 0x1234
#define XUA_DFU_EN 0
#define MIC_DUAL_ENABLED 1 //Use single thread, dual PDM mic
#define XUA_MIC_FRAME_SIZE 240
#endif // __custom_defines_h__

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2.7
# Copyright (c) 2018, XMOS Ltd, All rights reserved
import xmostest
import os.path

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python
# Copyright (c) 2018, XMOS Ltd, All rights reserved
import xmostest
def runtest_one_config(env, format, i2s_role, num_chans_in, num_chans_out, sample_rate):