forked from PAWPAW-Mirror/lib_xua
Stable -> master conflicted merge
This commit is contained in:
@@ -3,21 +3,22 @@ sc_usb_audio Change Log
|
||||
|
||||
6.14.0
|
||||
------
|
||||
- ADDED: Support for the use and integration of PDM microphones (including PDM to PCM
|
||||
conversion) via lib_mic_array
|
||||
- ADDED: Support for various "low" sample rates (i.e. < 44100) into UAC2 sample rate list
|
||||
and UAC1 descriptors
|
||||
- ADDED: Support for for master-clock/sample-rate divides that are not a power of 2
|
||||
(i.e. 32kHz from 24.567MHz)
|
||||
- ADDED: Extended available sample-rate/master-clock ratios. Previous restriction was <=
|
||||
512x (i.e. could not support 1024x and above e.g. 49.152MHz MCLK for Sample Rates
|
||||
below 96kHz) (#13893)
|
||||
- ADDED: Support for various "low" sample rates (i.e. < 44100) into UAC 2.0 sample rate
|
||||
list and UAC 1.0 descriptors
|
||||
- ADDED: Support for the use and integration of PDM microphones (including PDM to PCM
|
||||
conversion) via lib_mic_array
|
||||
- RESOLVED: MIDI data not accepted after "sleep" in OSX 10.11 (El Capitan) - related to sc_xud
|
||||
bug #17092
|
||||
- CHANGE: Asynchronous feedback system re-implemented to allow the previous two changelog
|
||||
items
|
||||
issue #17092
|
||||
- CHANGE: Asynchronous feedback system re-implemented to allow for the first two ADDED
|
||||
changelog items
|
||||
- CHANGE: Hardware divider used to generate bit-clock from master clock (xCORE-200 only).
|
||||
Allows easy support for greater number of master-clock to sample-rate ratios.
|
||||
- CHANGE: module_queue no longer uses any assert module/lib
|
||||
|
||||
6.13.0
|
||||
------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
USB Audio Shared
|
||||
................
|
||||
|
||||
:Latest release: 6.13.0beta2
|
||||
:Latest release: 6.14.0beta2
|
||||
:Maintainer: xross
|
||||
:Description: USB Audio Shared Components. For use in the XMOS USB Audio Refererence Designs.
|
||||
|
||||
@@ -9,5 +9,5 @@ USB Audio Shared
|
||||
Required software (dependencies)
|
||||
================================
|
||||
|
||||
* lib_xassert (git@github.com:xmos/lib_xassert.git)
|
||||
* None
|
||||
|
||||
|
||||
@@ -156,10 +156,7 @@
|
||||
<option id = "com.xmos.xc.compiler.option.include.paths.84748440" name="com.xmos.xc.compiler.option.include.paths" superClass="com.xmos.xc.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include""/>
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/gcc""/>
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/api}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue}"' />
|
||||
|
||||
</option>
|
||||
@@ -272,10 +269,7 @@
|
||||
<option id = "com.xmos.c.compiler.option.include.paths.1482631" name="com.xmos.c.compiler.option.include.paths" superClass="com.xmos.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include""/>
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/gcc""/>
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/api}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue}"' />
|
||||
|
||||
</option>
|
||||
@@ -394,10 +388,7 @@
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/gcc""/>
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/c++/4.2.1""/>
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/c++/4.2.1/xcore-xmos-elf""/>
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/api}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue}"' />
|
||||
|
||||
</option>
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
|
||||
MODULE_XCC_XC_FLAGS = $(XCC_XC_FLAGS)
|
||||
|
||||
DEPENDENT_MODULES = lib_xassert
|
||||
DEPENDENT_MODULES =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef QUEUE_H_
|
||||
#define QUEUE_H_
|
||||
|
||||
#include <xassert.h>
|
||||
#define assert(x) asm("ecallf %0"::"r"(x));
|
||||
|
||||
typedef struct queue_t {
|
||||
/// Read index.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,90 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>module_usb_audio</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.xmos.cdt.core.LegacyProjectCheckerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.xmos.cdt.core.ProjectInfoSyncBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.xmos.cdt.core.ModulePathBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>?children?</key>
|
||||
<value>?name?=outputEntries\|?children?=?name?=entry\\\\|\\|\||</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>?name?</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildArguments</key>
|
||||
<value>CONFIG=Debug</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildCommand</key>
|
||||
<value>xmake</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
|
||||
<value>clean</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.contents</key>
|
||||
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
<nature>com.xmos.cdt.core.XdeProjectNature</nature>
|
||||
</natures>
|
||||
<name>module_usb_audio</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>?children?</key>
|
||||
<value>?name?=outputEntries\|?children?=?name?=entry\\\\|\\|\||</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>?name?</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildArguments</key>
|
||||
<value>CONFIG=Debug</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildCommand</key>
|
||||
<value>xmake</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
|
||||
<value>clean</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.contents</key>
|
||||
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
<nature>com.xmos.cdt.core.XdeProjectNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ void audio(chanend c_in,
|
||||
#if (XUD_TILE != 0)
|
||||
, server interface i_dfu dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
, chanend c_pdm_in
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -705,14 +705,14 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out,
|
||||
#endif
|
||||
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
/* Get samples from PDM->PCM comverter */
|
||||
/* Get samples from PDM->PCM comverter */
|
||||
c_pdm_pcm <: 1;
|
||||
#pragma loop unroll
|
||||
for(int i = 0; i < NUM_PDM_MICS; i++)
|
||||
{
|
||||
c_pdm_pcm :> samplesIn_0[i];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1190,7 +1190,7 @@ chanend ?c_config, chanend ?c
|
||||
|
||||
#if NUM_PDM_MICS > 0
|
||||
/* Send decimation factor to PDM task(s) */
|
||||
c_pdm_in <: curSamFreq;
|
||||
c_pdm_in <: curSamFreq;
|
||||
#endif
|
||||
|
||||
#ifdef ADAT_TX
|
||||
|
||||
@@ -123,7 +123,7 @@ unsafe
|
||||
{
|
||||
unsigned * unsafe curSamFreqMultiplier = &g_curSamFreqMultiplier;
|
||||
|
||||
static void setG_curSamFreqMultiplier(unsigned x)
|
||||
static void setG_curSamFreqMultiplier(unsigned x)
|
||||
{
|
||||
// asm(" stw %0, dp[g_curSamFreqMultiplier]" :: "r"(x));
|
||||
*curSamFreqMultiplier = x;
|
||||
@@ -337,7 +337,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
|
||||
}
|
||||
|
||||
setG_curSamFreqMultiplier(g_curSamFreq/(newMasterClock/512));
|
||||
#endif
|
||||
#endif
|
||||
#ifdef ADAT_RX
|
||||
/* Configure ADAT SMUX based on sample rate */
|
||||
outuint(c_clk_ctl, SET_SMUX);
|
||||
@@ -875,7 +875,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
|
||||
#endif
|
||||
/* Special case for some low sample rates */
|
||||
unsigned lowSampleRateList[] = {8000, 11025, 12000, 16000, 32000};
|
||||
|
||||
|
||||
for (int k = 0; k < sizeof(lowSampleRateList)/sizeof(unsigned); k++)
|
||||
{
|
||||
if((lowSampleRateList[k] >= MIN_FREQ) && (lowSampleRateList[k] <= MAX_FREQ))
|
||||
@@ -884,7 +884,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
|
||||
num_freqs++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Just keep doubling for standard freqs >= 44.1/48kHz */
|
||||
currentFreq44 = 44100;
|
||||
currentFreq48 = 48000;
|
||||
@@ -917,7 +917,7 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c
|
||||
num_freqs++;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
storeShort(buffer, 0, num_freqs);
|
||||
|
||||
return XUD_DoGetRequest(ep0_out, ep0_in, buffer, i, sp.wLength);
|
||||
|
||||
@@ -2208,38 +2208,38 @@ unsigned char cfgDesc_Null[] =
|
||||
|
||||
#define AC_LENGTH (8 + INPUT_INTERFACES_A1 + OUTPUT_INTERFACES_A1)
|
||||
|
||||
/* In UAC1 supported sample rates are listed in descriptor
|
||||
/* In UAC1 supported sample rates are listed in descriptor
|
||||
* Note, using a value of <=2 or > 7 for num_freqs_a1 causes enumeration issues on Windows.
|
||||
* To work around this we repeat MAX_FREQ_FS multiple times in some cases */
|
||||
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
const unsigned num_freqs_a1 = MAX(3, (0
|
||||
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
|
||||
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
|
||||
+ 1
|
||||
#endif
|
||||
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
|
||||
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
|
||||
+1
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
|
||||
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
|
||||
+1
|
||||
#endif
|
||||
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
|
||||
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
|
||||
+1
|
||||
#endif
|
||||
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
|
||||
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
|
||||
+1
|
||||
#endif
|
||||
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
|
||||
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
|
||||
+1
|
||||
#endif
|
||||
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
|
||||
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
|
||||
+1
|
||||
#endif
|
||||
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
|
||||
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
|
||||
+1
|
||||
#endif
|
||||
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
|
||||
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
|
||||
+1
|
||||
#endif
|
||||
));
|
||||
@@ -2260,7 +2260,7 @@ const unsigned num_freqs_a1 = MAX(3, (0
|
||||
#define CHARIFY_SR(x) (x & 0xff),((x & 0xff00)>> 8),((x & 0xff0000)>> 16)
|
||||
|
||||
#if (MIN_FREQ_FS < 12000) && (MAX_FREQ_FS > 48000)
|
||||
#error SAMPLE RATE RANGE TO GREAT FOR UAC1 ON WINDOWS
|
||||
#error SAMPLE RATE RANGE TO GREAT FOR UAC1 ON WINDOWS
|
||||
#endif
|
||||
|
||||
unsigned char cfgDesc_Audio1[] =
|
||||
@@ -2431,47 +2431,47 @@ unsigned char cfgDesc_Audio1[] =
|
||||
|| (MIN_FREQ == 16000) && (MAX_FREQ_FS == 32000) \
|
||||
|| (MIN_FREQ == 44100) && (MAX_FREQ_FS == 48000) \
|
||||
|| (MIN_FREQ == 48000) && (MAX_FREQ_FS == 88200) \
|
||||
|| (MIN_FREQ == 88200) && (MAX_FREQ_FS == 96000)
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
|| (MIN_FREQ == 88200) && (MAX_FREQ_FS == 96000)
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
#endif
|
||||
#if (MIN_FREQ == MAX_FREQ_FS)
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
|
||||
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
|
||||
0x40, 0x1F, 0x00, /* sampleFreq - 8KHz */
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
|
||||
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
|
||||
0x11, 0x2B, 0x00, /* sampleFreq - 11.25KHz */
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
|
||||
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
|
||||
0xE0, 0x2E, 0x00, /* sampleFreq - 12KHz */
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
|
||||
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
|
||||
CHARIFY_SR(16000), /* sampleFreq - 16KHz */
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
|
||||
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
|
||||
CHARIFY_SR(32000), /* sampleFreq - 32KHz */
|
||||
#endif
|
||||
|
||||
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
|
||||
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
|
||||
0x44, 0xAC, 0x00, /* sampleFreq - 44.1Khz */
|
||||
#endif
|
||||
|
||||
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
|
||||
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
|
||||
0x80, 0xBB, 0x00, /* sampleFreq - 48KHz */
|
||||
#endif
|
||||
|
||||
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
|
||||
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
|
||||
0x88, 0x58, 0x01, /* sampleFreq - 88.2KHz */
|
||||
#endif
|
||||
|
||||
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
|
||||
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
|
||||
0x00, 0x77, 0x01, /* sampleFreq - 96KHz */
|
||||
#endif
|
||||
|
||||
@@ -2559,50 +2559,50 @@ unsigned char cfgDesc_Audio1[] =
|
||||
|| (MIN_FREQ == 16000) && (MAX_FREQ_FS == 32000) \
|
||||
|| (MIN_FREQ == 44100) && (MAX_FREQ_FS == 48000) \
|
||||
|| (MIN_FREQ == 48000) && (MAX_FREQ_FS == 88200) \
|
||||
|| (MIN_FREQ == 88200) && (MAX_FREQ_FS == 96000)
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
|| (MIN_FREQ == 88200) && (MAX_FREQ_FS == 96000)
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
#endif
|
||||
#if (MIN_FREQ == MAX_FREQ_FS)
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
CHARIFY_SR(MAX_FREQ_FS),
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
|
||||
#if(MIN_FREQ <= 8000) && (MAX_FREQ_FS >= 8000)
|
||||
0x40, 0x1F, 0x00, /* sampleFreq - 8000KHz */
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
|
||||
#if(MIN_FREQ <= 11025) && (MAX_FREQ_FS >= 11025)
|
||||
0x11, 0x2B, 0x00, /* sampleFreq - 11025KHz */
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
|
||||
#if(MIN_FREQ <= 12000) && (MAX_FREQ_FS >= 12000)
|
||||
0xE0, 0x2E, 0x00, /* sampleFreq - 12000KHz */
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
|
||||
#if(MIN_FREQ <= 16000) && (MAX_FREQ_FS >= 16000)
|
||||
CHARIFY_SR(16000), /* sampleFreq - 32KHz */
|
||||
#endif
|
||||
|
||||
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
|
||||
#if(MIN_FREQ <= 32000) && (MAX_FREQ_FS >= 32000)
|
||||
CHARIFY_SR(32000), /* sampleFreq - 32KHz */
|
||||
#endif
|
||||
|
||||
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
|
||||
#if (MIN_FREQ <= 44100) && (MAX_FREQ_FS >= 44100)
|
||||
0x44, 0xAC, 0x00, /* sampleFreq - 44.1Khz */
|
||||
#endif
|
||||
|
||||
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
|
||||
#if (MIN_FREQ <= 48000) && (MAX_FREQ_FS >= 48000)
|
||||
0x80, 0xBB, 0x00, /* sampleFreq - 48KHz */
|
||||
#endif
|
||||
|
||||
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
|
||||
#if (MIN_FREQ <= 88200) && (MAX_FREQ_FS >= 88200)
|
||||
0x88, 0x58, 0x01, /* sampleFreq - 88.2KHz */
|
||||
#endif
|
||||
|
||||
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
|
||||
#if (MIN_FREQ <= 96000) && (MAX_FREQ_FS >= 96000)
|
||||
0x00, 0x77, 0x01, /* sampleFreq - 96KHz */
|
||||
#endif
|
||||
|
||||
|
||||
/* Standard Endpoint Descriptor */
|
||||
0x09,
|
||||
0x05, /* ENDPOINT */
|
||||
|
||||
@@ -454,7 +454,7 @@ void usb_audio_io(chanend c_aud_in, chanend ?c_adc,
|
||||
#if XUD_TILE != 0
|
||||
, dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
, c_pdm_pcm
|
||||
#endif
|
||||
);
|
||||
@@ -653,7 +653,7 @@ int main()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
on stdcore[PDM_TILE]: pcm_pdm_mic(c_pdm_pcm);
|
||||
#endif
|
||||
USER_MAIN_CORES
|
||||
|
||||
@@ -189,7 +189,7 @@ DOMIX_BOT(7)
|
||||
.linkset setPtr.maxtimers, 0;
|
||||
.linkset setPtr.maxthreads, 1;
|
||||
setPtr:
|
||||
ENTSP_lu6 0
|
||||
ENTSP_lu6 0
|
||||
shl r2, r2, 1
|
||||
.xtabranch .label_0
|
||||
bru r2
|
||||
|
||||
@@ -29,7 +29,7 @@ void user_pdm_init();
|
||||
int data_0[4*COEFS_PER_PHASE*MAX_DECIMATION_FACTOR] = {0};
|
||||
int data_1[4*COEFS_PER_PHASE*MAX_DECIMATION_FACTOR] = {0};
|
||||
|
||||
frame_audio mic_audio[2];
|
||||
frame_audio mic_audio[2];
|
||||
|
||||
void pdm_process(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, chanend c_audio)
|
||||
{
|
||||
@@ -38,13 +38,13 @@ void pdm_process(streaming chanend c_ds_output_0, streaming chanend c_ds_output_
|
||||
int output[NUM_PDM_MICS];
|
||||
|
||||
user_pdm_init();
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
{
|
||||
unsigned samplerate;
|
||||
|
||||
c_audio :> samplerate;
|
||||
|
||||
|
||||
unsigned decimationfactor = 48000/samplerate;
|
||||
|
||||
unsafe
|
||||
@@ -60,16 +60,16 @@ void pdm_process(streaming chanend c_ds_output_0, streaming chanend c_ds_output_
|
||||
while(1)
|
||||
{
|
||||
frame_audio * unsafe current = decimator_get_next_audio_frame(c_ds_output_0, c_ds_output_1, buffer, mic_audio);
|
||||
|
||||
|
||||
unsafe
|
||||
{
|
||||
int req;
|
||||
user_pdm_process(current, output);
|
||||
|
||||
|
||||
c_audio :> req;
|
||||
|
||||
|
||||
if(req)
|
||||
{
|
||||
{
|
||||
for(int i = 0; i < NUM_PDM_MICS; i++)
|
||||
{
|
||||
c_audio <: output[i]*decimationfactor;
|
||||
@@ -80,7 +80,7 @@ void pdm_process(streaming chanend c_ds_output_0, streaming chanend c_ds_output_
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,14 +92,14 @@ void pcm_pdm_mic(chanend c_pcm_out)
|
||||
{
|
||||
streaming chan c_4x_pdm_mic_0, c_4x_pdm_mic_1;
|
||||
streaming chan c_ds_output_0, c_ds_output_1;
|
||||
|
||||
/* TODO, always run mics at 3MHz */
|
||||
|
||||
/* TODO, always run mics at 3MHz */
|
||||
configure_clock_src_divide(pdmclk, p_mclk, 2);
|
||||
configure_port_clock_output(p_pdm_clk, pdmclk);
|
||||
configure_in_port(p_pdm_mics, pdmclk);
|
||||
start_clock(pdmclk);
|
||||
|
||||
par
|
||||
par
|
||||
{
|
||||
pdm_rx(p_pdm_mics, c_4x_pdm_mic_0, c_4x_pdm_mic_1);
|
||||
decimate_to_pcm_4ch(c_4x_pdm_mic_0, c_ds_output_0);
|
||||
|
||||
@@ -56,7 +56,7 @@ unsigned int divide)
|
||||
#endif
|
||||
|
||||
#if defined(__XS2A__)
|
||||
/* Clock bitclock clock block from master clock pin (divided) */
|
||||
/* Clock bitclock clock block from master clock pin (divided) */
|
||||
configure_clock_src_divide(clk_audio_bclk, p_mclk_in, (divide/2));
|
||||
configure_port_clock_output(p_bclk, clk_audio_bclk);
|
||||
#else
|
||||
|
||||
@@ -481,10 +481,10 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in,
|
||||
|
||||
/* Number of MCLK ticks in this SOF period (E.g = 125 * 24.576 = 3072) */
|
||||
int count = (int) ((short)(u_tmp - lastClock));
|
||||
|
||||
unsigned long long full_result = count * feedbackMul * sampleFreq;
|
||||
|
||||
clockcounter += full_result;
|
||||
|
||||
unsigned long long full_result = count * feedbackMul * sampleFreq;
|
||||
|
||||
clockcounter += full_result;
|
||||
|
||||
/* Store MCLK for next time around... */
|
||||
lastClock = u_tmp;
|
||||
@@ -494,20 +494,20 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in,
|
||||
if(sofCount == 128)
|
||||
{
|
||||
sofCount = 0;
|
||||
|
||||
|
||||
clockcounter += mod_from_last_time;
|
||||
clocks = clockcounter / masterClockFreq;
|
||||
mod_from_last_time = clockcounter % masterClockFreq;
|
||||
|
||||
|
||||
if(usb_speed == XUD_SPEED_HS)
|
||||
{
|
||||
{
|
||||
clocks <<= 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
clocks <<= 6;
|
||||
}
|
||||
|
||||
|
||||
#ifdef FB_TOLERANCE_TEST
|
||||
if (clocks > (expected_fb - FB_TOLERANCE) &&
|
||||
clocks < (expected_fb + FB_TOLERANCE))
|
||||
|
||||
@@ -156,10 +156,7 @@
|
||||
<option id = "com.xmos.xc.compiler.option.include.paths.70620891" name="com.xmos.xc.compiler.option.include.paths" superClass="com.xmos.xc.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include""/>
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/gcc""/>
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/api}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_usb_midi/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_usb_midi}"' />
|
||||
@@ -274,10 +271,7 @@
|
||||
<option id = "com.xmos.c.compiler.option.include.paths.57949831" name="com.xmos.c.compiler.option.include.paths" superClass="com.xmos.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include""/>
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/gcc""/>
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/api}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_usb_midi/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_usb_midi}"' />
|
||||
@@ -398,10 +392,7 @@
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/gcc""/>
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/c++/4.2.1""/>
|
||||
<listOptionValue builtIn="false" value=""${XMOS_TOOL_PATH}/target/include/c++/4.2.1/xcore-xmos-elf""/>
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/api}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/lib_xassert}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_queue}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_usb_midi/src}"' />
|
||||
<listOptionValue builtIn="false" value='"${workspace_loc:/module_usb_midi}"' />
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
* @file midiinparse.xc
|
||||
* @brief Generates USB MIDI events from MIDI events
|
||||
* @author Russell Gallop, XMOS Semiconductor
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
#include <print.h>
|
||||
//#include <assert.h>
|
||||
#include "midiinparse.h"
|
||||
|
||||
/**
|
||||
@@ -14,13 +12,13 @@
|
||||
*
|
||||
*/
|
||||
void dump_midi_in_parse_state(struct midi_in_parse_state &s) {
|
||||
printstr("expect_msg_len: 0x"); printhexln(s.expect_msg_len);
|
||||
printstr("msg_type: 0x"); printhexln(s.msg_type);
|
||||
printstr("receivebuffer: 0x"); printhex(s.receivebuffer[0]);
|
||||
printstr(", 0x"); printhex(s.receivebuffer[1]);
|
||||
printstr(", 0x"); printhexln(s.receivebuffer[2]);
|
||||
printstr("received: 0x"); printhexln(s.received);
|
||||
printstr("codeIndexNumber: 0x"); printhexln(s.codeIndexNumber);
|
||||
printstr("expect_msg_len: 0x"); printhexln(s.expect_msg_len);
|
||||
printstr("msg_type: 0x"); printhexln(s.msg_type);
|
||||
printstr("receivebuffer: 0x"); printhex(s.receivebuffer[0]);
|
||||
printstr(", 0x"); printhex(s.receivebuffer[1]);
|
||||
printstr(", 0x"); printhexln(s.receivebuffer[2]);
|
||||
printstr("received: 0x"); printhexln(s.received);
|
||||
printstr("codeIndexNumber: 0x"); printhexln(s.codeIndexNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
11
xpd.xml
11
xpd.xml
@@ -7,7 +7,6 @@
|
||||
</component>
|
||||
<component description = "queue" type = "demoCode" scope = "General Use" path = "module_queue" local = "false" id = "module_queue" name = "Queuing Module For USB Audio Framework">
|
||||
<board></board>
|
||||
<componentDependency repo = "git://github.com/xmos/lib_xassert.git">lib_xassert</componentDependency>
|
||||
<keyword>UAC2</keyword>
|
||||
</component>
|
||||
<component description = "Core USB Audio Module" type = "demoCode" scope = "General Use" path = "module_usb_audio" local = "false" id = "module_usb_audio" name = "USB AUDIO MODULE">
|
||||
@@ -16,16 +15,10 @@
|
||||
</component>
|
||||
<component description = "MIDI" type = "demoCode" scope = "General Use" path = "module_usb_midi" local = "false" id = "module_usb_midi" name = "MIDI Module for USB Audio Framework">
|
||||
<board></board>
|
||||
<componentDependency version = "6.13.0">module_queue</componentDependency>
|
||||
<componentDependency repo = "git://github.com/xmos/lib_xassert.git">lib_xassert</componentDependency>
|
||||
<componentDependency version = "6.14.0">module_queue</componentDependency>
|
||||
<keyword>MIDI</keyword>
|
||||
</component>
|
||||
</components>
|
||||
<dependency repo = "lib_xassert">
|
||||
<gitbranch>master</gitbranch>
|
||||
<githash>9c4955e3ab0604e6ba4b66ad46e01b5d96d5d6fb</githash>
|
||||
<uri>git@github.com:xmos/lib_xassert.git</uri>
|
||||
</dependency>
|
||||
<description>USB Audio Shared Components. For use in the XMOS USB Audio Refererence Designs.</description>
|
||||
<docdir>module_dfu/doc</docdir>
|
||||
<git_export>False</git_export>
|
||||
@@ -112,4 +105,4 @@
|
||||
<version_define name = "BCD_DEVICE_N" format = "%POINT%"></version_define>
|
||||
</version_defines>
|
||||
<xpd_version>1.0</xpd_version>
|
||||
</xpd>
|
||||
</xpd>
|
||||
|
||||
Reference in New Issue
Block a user