forked from PAWPAW-Mirror/lib_xua
Merge branch 'master' into REINSTATE_MIXER
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
sc_usb_audio Change Log
|
sc_usb_audio Change Log
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
6.6.0
|
6.7.0
|
||||||
-----
|
-----
|
||||||
|
|
||||||
* see sw_usb_audio for changelog
|
* see sw_usb_audio for changelog
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
USB Audio Shared
|
USB Audio Shared
|
||||||
................
|
................
|
||||||
|
|
||||||
:Latest release: 6.6.0rc2
|
:Latest release: 6.7.0alpha0
|
||||||
:Maintainer: xross
|
:Maintainer: xross
|
||||||
:Description: USB Audio Shared Components. For use in the XMOS USB Audio Refererence Designs.
|
:Description: USB Audio Shared Components. For use in the XMOS USB Audio Refererence Designs.
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ unsigned testsamples[100];
|
|||||||
int p = 0;
|
int p = 0;
|
||||||
unsigned lastSample = 0;
|
unsigned lastSample = 0;
|
||||||
#if (DSD_CHANS_DAC != 0)
|
#if (DSD_CHANS_DAC != 0)
|
||||||
extern unsigned p_dsd_dac[DSD_CHANS_DAC];
|
extern buffered out port:32 p_dsd_dac[DSD_CHANS_DAC];
|
||||||
extern port p_dsd_clk;
|
extern buffered out port:32 p_dsd_clk;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned g_adcVal = 0;
|
unsigned g_adcVal = 0;
|
||||||
@@ -461,9 +461,8 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, unsi
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* TODO - requires clock gen */
|
|
||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
|
/* Sync with clockgen */
|
||||||
inuint(c_dig_rx);
|
inuint(c_dig_rx);
|
||||||
#endif
|
#endif
|
||||||
#ifdef SPDIF_RX
|
#ifdef SPDIF_RX
|
||||||
@@ -485,7 +484,6 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out, unsigned divide, unsi
|
|||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
/* Request digital data (with prefill) */
|
/* Request digital data (with prefill) */
|
||||||
outuint(c_dig_rx, 0);
|
outuint(c_dig_rx, 0);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
@@ -832,6 +830,15 @@ void audio(chanend c_mix_out, chanend ?c_dig_rx, chanend ?c_config, chanend ?c)
|
|||||||
|
|
||||||
start_clock(clk_audio_mclk);
|
start_clock(clk_audio_mclk);
|
||||||
|
|
||||||
|
#if (DSD_CHANS_DAC > 0)
|
||||||
|
/* Make sure the DSD ports are on and buffered - just in case they are not shared with I2S */
|
||||||
|
EnableBufferedPort(p_dsd_clk, 32);
|
||||||
|
for(int i = 0; i< DSD_CHANS_DAC; i++)
|
||||||
|
{
|
||||||
|
EnableBufferedPort(p_dsd_dac[i], 32);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SPDIF
|
#ifdef SPDIF
|
||||||
SpdifTransmitPortConfig(p_spdif_tx, clk_mst_spd, p_mclk_in);
|
SpdifTransmitPortConfig(p_spdif_tx, clk_mst_spd, p_mclk_in);
|
||||||
#endif
|
#endif
|
||||||
@@ -872,28 +879,31 @@ void audio(chanend c_mix_out, chanend ?c_dig_rx, chanend ?c_config, chanend ?c)
|
|||||||
divide = mClk / ( curSamFreq * numBits );
|
divide = mClk / ( curSamFreq * numBits );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (DSD_CHANS_DAC != 0)
|
|
||||||
|
#if (DSD_CHANS_DAC > 0)
|
||||||
|
if(dsdMode)
|
||||||
|
{
|
||||||
/* Configure audio ports */
|
/* Configure audio ports */
|
||||||
ConfigAudioPortsWrapper(
|
ConfigAudioPortsWrapper(
|
||||||
#if (I2S_CHANS_DAC != 0)
|
#if (I2S_CHANS_DAC != 0)
|
||||||
p_i2s_dac,
|
p_dsd_dac,
|
||||||
|
DSD_CHANS_DAC,
|
||||||
#endif
|
#endif
|
||||||
#if (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_ADC != 0)
|
||||||
p_i2s_adc,
|
p_i2s_adc,
|
||||||
|
I2S_WIRES_ADC,
|
||||||
#endif
|
#endif
|
||||||
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
||||||
#ifndef CODEC_MASTER
|
null,
|
||||||
p_lrclk,
|
p_dsd_clk,
|
||||||
p_bclk,
|
|
||||||
#else
|
|
||||||
p_lrclk,
|
|
||||||
p_bclk,
|
|
||||||
#endif
|
#endif
|
||||||
|
divide, dsdMode);
|
||||||
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
divide, dsdMode);
|
{
|
||||||
#else
|
|
||||||
/* Configure audio ports */
|
ConfigAudioPortsWrapper(
|
||||||
ConfigAudioPorts(
|
|
||||||
#if (I2S_CHANS_DAC != 0)
|
#if (I2S_CHANS_DAC != 0)
|
||||||
p_i2s_dac,
|
p_i2s_dac,
|
||||||
I2S_WIRES_DAC,
|
I2S_WIRES_DAC,
|
||||||
@@ -911,9 +921,9 @@ void audio(chanend c_mix_out, chanend ?c_dig_rx, chanend ?c_config, chanend ?c)
|
|||||||
p_bclk,
|
p_bclk,
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
divide);
|
divide, dsdMode);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
unsigned curFreq = curSamFreq;
|
unsigned curFreq = curSamFreq;
|
||||||
|
|||||||
@@ -13,6 +13,6 @@
|
|||||||
* \param c_clk_int channel connected to the decouple() thread for clock
|
* \param c_clk_int channel connected to the decouple() thread for clock
|
||||||
interrupts
|
interrupts
|
||||||
*/
|
*/
|
||||||
void clockGen (streaming chanend c_spdif_rx, chanend c_adat_rx, out port p, chanend c_audio, chanend c_clk_ctl, chanend c_clk_int);
|
void clockGen (streaming chanend c_spdif_rx, chanend ?c_adat_rx, out port p, chanend c_audio, chanend c_clk_ctl, chanend c_clk_int);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ extern int samples_to_host_inputs_buff[NUM_USB_CHAN_IN]; /* Audio transmi
|
|||||||
int VendorAudCoreReqs(unsigned cmd, chanend c);
|
int VendorAudCoreReqs(unsigned cmd, chanend c);
|
||||||
|
|
||||||
#pragma unsafe arrays
|
#pragma unsafe arrays
|
||||||
void clockGen (streaming chanend c_spdif_rx, chanend c_adat_rx, out port p, chanend c_dig_rx, chanend c_clk_ctl, chanend c_clk_int)
|
void clockGen (streaming chanend c_spdif_rx, chanend ?c_adat_rx, out port p, chanend c_dig_rx, chanend c_clk_ctl, chanend c_clk_int)
|
||||||
{
|
{
|
||||||
timer t_local;
|
timer t_local;
|
||||||
unsigned timeNextEdge, timeLastEdge, timeNextClockDetection;
|
unsigned timeNextEdge, timeLastEdge, timeNextClockDetection;
|
||||||
@@ -256,7 +256,6 @@ void clockGen (streaming chanend c_spdif_rx, chanend c_adat_rx, out port p, chan
|
|||||||
g_digData[i] = 0;
|
g_digData[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Init clock unit state */
|
/* Init clock unit state */
|
||||||
#ifdef SPDIF_RX
|
#ifdef SPDIF_RX
|
||||||
clockFreq[CLOCK_SPDIF_INDEX] = 0;
|
clockFreq[CLOCK_SPDIF_INDEX] = 0;
|
||||||
|
|||||||
@@ -386,7 +386,7 @@
|
|||||||
* @brief Device firmware version number in Binary Coded Decimal format: 0xJJMN where JJ: major, M: minor, N: sub-minor version number.
|
* @brief Device firmware version number in Binary Coded Decimal format: 0xJJMN where JJ: major, M: minor, N: sub-minor version number.
|
||||||
*/
|
*/
|
||||||
#ifndef BCD_DEVICE_M
|
#ifndef BCD_DEVICE_M
|
||||||
#define BCD_DEVICE_M 6
|
#define BCD_DEVICE_M 7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ StringDescTable_t g_strTable =
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*** INPUT CHANNEL STRINGS ***/
|
/*** INPUT CHANNEL STRINGS ***/
|
||||||
|
|
||||||
#if (NUM_USB_CHAN_IN > 0)
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
#if defined(SPDIF_RX) && (SPDIF_RX_INDEX == 0)
|
#if defined(SPDIF_RX) && (SPDIF_RX_INDEX == 0)
|
||||||
#if defined(SPDIF_RX) && (SPDIF_RX_INDEX < I2S_CHANS_ADC)
|
#if defined(SPDIF_RX) && (SPDIF_RX_INDEX < I2S_CHANS_ADC)
|
||||||
@@ -849,8 +849,8 @@ StringDescTable_t g_strTable =
|
|||||||
|
|
||||||
#if (NUM_USB_CHAN_IN > 18)
|
#if (NUM_USB_CHAN_IN > 18)
|
||||||
#error NUM_USB_CHAN_IN > 18
|
#error NUM_USB_CHAN_IN > 18
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.iAPInterfaceStr = "iAP Interface",
|
.iAPInterfaceStr = "iAP Interface",
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -1119,6 +1119,9 @@ typedef struct
|
|||||||
#endif
|
#endif
|
||||||
USB_Descriptor_Audio_OutputTerminal_t Audio_In_OutputTerminal;
|
USB_Descriptor_Audio_OutputTerminal_t Audio_In_OutputTerminal;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined (SPDIF_RX) || defined (ADAT_RX)
|
||||||
|
USB_Descriptor_Endpoint_t Audio_Int_Endpoint;
|
||||||
|
#endif
|
||||||
} __attribute__((packed)) USB_CfgDesc_Audio2_CS_Control_Int;
|
} __attribute__((packed)) USB_CfgDesc_Audio2_CS_Control_Int;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -1576,6 +1579,19 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
.iTerminal = offsetof(StringDescTable_t, usbOutputTermStr_Audio2)/sizeof(char *)
|
.iTerminal = offsetof(StringDescTable_t, usbOutputTermStr_Audio2)/sizeof(char *)
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
|
/* Standard AS Interrupt Endpoint Descriptor (4.8.2.1): */
|
||||||
|
.Audio_Int_Endpoint =
|
||||||
|
{
|
||||||
|
.bLength = sizeof(USB_Descriptor_Endpoint_t),
|
||||||
|
.bDescriptorType = USB_DESCTYPE_ENDPOINT,
|
||||||
|
.bEndpointAddress = ENDPOINT_ADDRESS_IN_INTERRUPT, /* (D7: 0:out, 1:in) */
|
||||||
|
.bmAttributes = 0x03, /* (bitmap) */
|
||||||
|
.wMaxPacketSize = 6,
|
||||||
|
.bInterval = 8,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
}, /* End of .Audio_CS_Control_Int */
|
}, /* End of .Audio_CS_Control_Int */
|
||||||
|
|
||||||
#if (NUM_USB_CHAN_OUT > 0)
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
|
|||||||
@@ -32,6 +32,12 @@
|
|||||||
#include "mixer.h"
|
#include "mixer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
#include "SpdifReceive.h"
|
||||||
|
#include "clocking.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Audio I/O - Port declarations */
|
/* Audio I/O - Port declarations */
|
||||||
#if I2S_WIRES_DAC > 0
|
#if I2S_WIRES_DAC > 0
|
||||||
on tile[AUDIO_IO_TILE] : buffered out port:32 p_i2s_dac[I2S_WIRES_DAC] =
|
on tile[AUDIO_IO_TILE] : buffered out port:32 p_i2s_dac[I2S_WIRES_DAC] =
|
||||||
@@ -98,11 +104,13 @@ on tile[AUDIO_IO_TILE] : buffered in port:32 p_i2s_adc[I2S_WIRES_ADC] =
|
|||||||
* This is a clash with S/PDIF Tx but simultaneous S/PDIF and MIDI not currently supported on single tile device
|
* This is a clash with S/PDIF Tx but simultaneous S/PDIF and MIDI not currently supported on single tile device
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
/* TODO should include tile here */
|
||||||
#define CLKBLK_MIDI XS1_CLKBLK_1;
|
#define CLKBLK_MIDI XS1_CLKBLK_1;
|
||||||
#else
|
#else
|
||||||
#define CLKBLK_MIDI XS1_CLKBLK_REF;
|
#define CLKBLK_MIDI XS1_CLKBLK_REF;
|
||||||
#endif
|
#endif
|
||||||
#define CLKBLK_SPDIF_TX XS1_CLKBLK_1
|
#define CLKBLK_SPDIF_TX XS1_CLKBLK_1
|
||||||
|
#define CLKBLK_SPDIF_RX XS1_CLKBLK_1
|
||||||
#define CLKBLK_MCLK XS1_CLKBLK_2
|
#define CLKBLK_MCLK XS1_CLKBLK_2
|
||||||
#define CLKBLK_I2S_BIT XS1_CLKBLK_3
|
#define CLKBLK_I2S_BIT XS1_CLKBLK_3
|
||||||
#define CLKBLK_XUD XS1_CLKBLK_4 /* Note XUD for U-series uses CLKBLK_5 also (see XUD_Ports.xc) */
|
#define CLKBLK_XUD XS1_CLKBLK_4 /* Note XUD for U-series uses CLKBLK_5 also (see XUD_Ports.xc) */
|
||||||
@@ -122,13 +130,18 @@ on tile[XUD_TILE] : in port p_for_mclk_count = PORT_MCLK_COUNT;
|
|||||||
on tile[AUDIO_IO_TILE] : buffered out port:32 p_spdif_tx = PORT_SPDIF_OUT;
|
on tile[AUDIO_IO_TILE] : buffered out port:32 p_spdif_tx = PORT_SPDIF_OUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
on tile[XUD_TILE] : buffered in port:4 p_spdif_rx = PORT_SPDIF_IN; /* K: coax, J: optical */
|
||||||
|
on tile[AUDIO_IO_TILE] : out port p_pll_clk = PORT_PLL_REF;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MIDI
|
#ifdef MIDI
|
||||||
on tile[AUDIO_IO_TILE] : port p_midi_tx = PORT_MIDI_OUT;
|
on tile[AUDIO_IO_TILE] : port p_midi_tx = PORT_MIDI_OUT;
|
||||||
|
|
||||||
#if(MIDI_RX_PORT_WIDTH == 4)
|
#if(MIDI_RX_PORT_WIDTH == 4)
|
||||||
on tile[AUDIO_IO_TILE] : buffered in port:4 p_midi_rx = PORT_MIDI_IN;
|
on tile[AUDIO_IO_TILE] : buffered in port:4 p_midi_rx = PORT_MIDI_IN;
|
||||||
#elif(MIDI_RX_PORT_WIDTH == 1)
|
#elif(MIDI_RX_PORT_WIDTH == 1)
|
||||||
on tile[AUDIO_IO_TILE] : buffered in port:1 p_midi_rx = PORT_MIDI_IN;
|
on tile[AUDIO_IO_TILE] : buffered in port:1 p_midi_rx = PORT_MIDI_IN;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -141,6 +154,10 @@ on tile[AUDIO_IO_TILE] : clock clk_midi = CLKBLK_MIDI;
|
|||||||
on tile[AUDIO_IO_TILE] : clock clk_mst_spd = CLKBLK_SPDIF_TX;
|
on tile[AUDIO_IO_TILE] : clock clk_mst_spd = CLKBLK_SPDIF_TX;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
on tile[XUD_TILE] : clock clk_spd_rx = CLKBLK_SPDIF_RX;
|
||||||
|
#endif
|
||||||
|
|
||||||
on tile[AUDIO_IO_TILE] : clock clk_audio_mclk = CLKBLK_MCLK; /* Master clock */
|
on tile[AUDIO_IO_TILE] : clock clk_audio_mclk = CLKBLK_MCLK; /* Master clock */
|
||||||
|
|
||||||
#if(AUDIO_IO_TILE != XUD_TILE)
|
#if(AUDIO_IO_TILE != XUD_TILE)
|
||||||
@@ -235,6 +252,8 @@ void usb_audio_core(chanend c_mix_out
|
|||||||
#ifdef MIXER
|
#ifdef MIXER
|
||||||
, chanend c_mix_ctl
|
, chanend c_mix_ctl
|
||||||
#endif
|
#endif
|
||||||
|
, chanend ?c_clk_int
|
||||||
|
, chanend ?c_clk_ctl
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
chan c_sof;
|
chan c_sof;
|
||||||
@@ -299,6 +318,7 @@ void usb_audio_core(chanend c_mix_out
|
|||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
/* Audio Interrupt - only used for interrupts on external clock change */
|
/* Audio Interrupt - only used for interrupts on external clock change */
|
||||||
c_xud_in[ENDPOINT_NUMBER_IN_INTERRUPT],
|
c_xud_in[ENDPOINT_NUMBER_IN_INTERRUPT],
|
||||||
|
c_clk_int,
|
||||||
#endif
|
#endif
|
||||||
c_sof, c_aud_ctl, p_for_mclk_count
|
c_sof, c_aud_ctl, p_for_mclk_count
|
||||||
#ifdef HID_CONTROLS
|
#ifdef HID_CONTROLS
|
||||||
@@ -314,13 +334,13 @@ void usb_audio_core(chanend c_mix_out
|
|||||||
/* Endpoint 0 Core */
|
/* Endpoint 0 Core */
|
||||||
{
|
{
|
||||||
thread_speed();
|
thread_speed();
|
||||||
Endpoint0( c_xud_out[0], c_xud_in[0], c_aud_ctl, c_mix_ctl, null);
|
Endpoint0( c_xud_out[0], c_xud_in[0], c_aud_ctl, c_mix_ctl, c_clk_ctl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Decoupling core */
|
/* Decoupling core */
|
||||||
{
|
{
|
||||||
thread_speed();
|
thread_speed();
|
||||||
decouple(c_mix_out, null
|
decouple(c_mix_out
|
||||||
#ifdef CHAN_BUFF_CTRL
|
#ifdef CHAN_BUFF_CTRL
|
||||||
, c_buff_ctrl
|
, c_buff_ctrl
|
||||||
#endif
|
#endif
|
||||||
@@ -330,26 +350,24 @@ void usb_audio_core(chanend c_mix_out
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void usb_audio_io(chanend c_aud_in, chanend ?c_adc
|
void usb_audio_io(chanend c_aud_in, chanend ?c_adc,
|
||||||
#ifdef MIXER
|
#ifdef MIXER
|
||||||
, chanend c_mix_ctl
|
chanend c_mix_ctl,
|
||||||
#endif
|
#endif
|
||||||
, chanend ?c_aud_cfg
|
chanend ?c_aud_cfg,
|
||||||
|
streaming chanend ?c_spdif_rx,
|
||||||
|
chanend ?c_clk_ctl,
|
||||||
|
chanend ?c_clk_int
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifdef MIXER
|
#ifdef MIXER
|
||||||
chan c_mix_out;
|
chan c_mix_out;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (SPDIF_RX) || (defined ADAT_RX)
|
|
||||||
chan c_dig_rx;
|
chan c_dig_rx;
|
||||||
#else
|
|
||||||
#define c_dig_rx null
|
|
||||||
#endif
|
|
||||||
|
|
||||||
par
|
par
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef MIXER
|
#ifdef MIXER
|
||||||
/* Mixer cores(s) */
|
/* Mixer cores(s) */
|
||||||
{
|
{
|
||||||
@@ -366,6 +384,15 @@ void usb_audio_io(chanend c_aud_in, chanend ?c_adc
|
|||||||
audio(c_aud_in, c_dig_rx, c_aud_cfg, c_adc);
|
audio(c_aud_in, c_dig_rx, c_aud_cfg, c_adc);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
{
|
||||||
|
thread_speed();
|
||||||
|
|
||||||
|
clockGen(c_spdif_rx, null, p_pll_clk, c_dig_rx, c_clk_ctl, c_clk_int);
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
//:
|
//:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -402,6 +429,17 @@ int main()
|
|||||||
chan c_aud_cfg;
|
chan c_aud_cfg;
|
||||||
#else
|
#else
|
||||||
#define c_aud_cfg null
|
#define c_aud_cfg null
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
streaming chan c_spdif_rx;
|
||||||
|
chan c_clk_ctl;
|
||||||
|
chan c_clk_int;
|
||||||
|
#else
|
||||||
|
#define c_dig_rx null
|
||||||
|
#define c_clk_int null
|
||||||
|
#define c_clk_ctl null
|
||||||
|
#define c_spdif_rx null
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
USER_MAIN_DECLARATIONS
|
USER_MAIN_DECLARATIONS
|
||||||
@@ -418,13 +456,14 @@ int main()
|
|||||||
#ifdef MIXER
|
#ifdef MIXER
|
||||||
, c_mix_ctl
|
, c_mix_ctl
|
||||||
#endif
|
#endif
|
||||||
|
, c_clk_int, c_clk_ctl
|
||||||
);
|
);
|
||||||
|
|
||||||
on tile[AUDIO_IO_TILE]: usb_audio_io(c_mix_out, c_adc
|
on tile[AUDIO_IO_TILE]: usb_audio_io(c_mix_out, c_adc
|
||||||
#ifdef MIXER
|
#ifdef MIXER
|
||||||
, c_mix_ctl
|
, c_mix_ctl
|
||||||
#endif
|
#endif
|
||||||
, c_aud_cfg
|
,c_aud_cfg, c_spdif_rx, c_clk_ctl, c_clk_int
|
||||||
);
|
);
|
||||||
|
|
||||||
#if defined(MIDI) && defined(IAP) && (IAP_TILE == MIDI_TILE)
|
#if defined(MIDI) && defined(IAP) && (IAP_TILE == MIDI_TILE)
|
||||||
@@ -452,6 +491,13 @@ int main()
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
on tile[0]:
|
||||||
|
{
|
||||||
|
thread_speed();
|
||||||
|
SpdifReceive(p_spdif_rx, c_spdif_rx, 1, clk_spd_rx);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
USER_MAIN_CORES
|
USER_MAIN_CORES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "devicedefines.h"
|
#include "devicedefines.h"
|
||||||
#include "audioports.h"
|
#include "audioports.h"
|
||||||
|
|
||||||
#if (DSD_CHANS_DAC != 0)
|
|
||||||
/* Note since DSD ports could be reused for I2S ports we do all the setup manually in C */
|
/* Note since DSD ports could be reused for I2S ports we do all the setup manually in C */
|
||||||
#if DSD_CHANS_DAC > 0
|
#if DSD_CHANS_DAC > 0
|
||||||
port p_dsd_dac[DSD_CHANS_DAC] = {
|
port p_dsd_dac[DSD_CHANS_DAC] = {
|
||||||
@@ -23,23 +22,21 @@ port p_dsd_dac[DSD_CHANS_DAC] = {
|
|||||||
port p_dsd_clk = PORT_DSD_CLK;
|
port p_dsd_clk = PORT_DSD_CLK;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void EnableBufferedPort(port p, unsigned transferWidth)
|
void EnableBufferedPort(port p, unsigned transferWidth)
|
||||||
{
|
{
|
||||||
//set_port_use_on(p_dsd_dac[i]);
|
|
||||||
asm volatile("setc res[%0], %1"::"r"(p), "r"(XS1_SETC_INUSE_ON));
|
asm volatile("setc res[%0], %1"::"r"(p), "r"(XS1_SETC_INUSE_ON));
|
||||||
asm volatile("setc res[%0], %1"::"r"(p), "r"(XS1_SETC_BUF_BUFFERS));
|
asm volatile("setc res[%0], %1"::"r"(p), "r"(XS1_SETC_BUF_BUFFERS));
|
||||||
asm volatile("settw res[%0], %1"::"r"(p),"r"(transferWidth));
|
asm volatile("settw res[%0], %1"::"r"(p),"r"(transferWidth));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* C wrapper for ConfigAudioPorts() to handle DSD ports */
|
||||||
/* C wrapper for ConfigAudioPorts() such that we can mess around with arrays of ports */
|
|
||||||
void ConfigAudioPortsWrapper(
|
void ConfigAudioPortsWrapper(
|
||||||
#if (I2S_CHANS_DAC != 0)
|
#if (I2S_CHANS_DAC != 0)
|
||||||
port p_i2s_dac[I2S_WIRES_DAC],
|
port p_dac[], int numPortsDac,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_ADC != 0)
|
||||||
port p_i2s_adc[I2S_WIRES_ADC],
|
port p_adc[], int numPortsAdc,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
||||||
@@ -53,63 +50,16 @@ void ConfigAudioPortsWrapper(
|
|||||||
#endif
|
#endif
|
||||||
unsigned int divide, unsigned int dsdMode)
|
unsigned int divide, unsigned int dsdMode)
|
||||||
{
|
{
|
||||||
/* Ensure dsd clock is on in all modes since I2S mode sets it low on exit
|
|
||||||
* to avoid stop_clock() potentially pausing forever. If this is not done
|
|
||||||
* an exception will be raised with audio() attempts to set this port low
|
|
||||||
*/
|
|
||||||
/* TODO Do we really need to do this on every SF change? Once is probably enough */
|
|
||||||
EnableBufferedPort(p_dsd_clk, 32);
|
|
||||||
|
|
||||||
if(dsdMode)
|
|
||||||
{
|
|
||||||
/* Make sure the ports are on and buffered - just in case they are not shared with I2S */
|
|
||||||
for(int i = 0; i< DSD_CHANS_DAC; i++)
|
|
||||||
{
|
|
||||||
EnableBufferedPort(p_dsd_dac[i], 32);
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigAudioPorts(
|
|
||||||
#if (DSD_CHANS_DAC != 0)
|
|
||||||
p_dsd_dac,
|
|
||||||
DSD_CHANS_DAC,
|
|
||||||
#endif
|
|
||||||
#if (I2S_CHANS_ADC != 0)
|
|
||||||
p_i2s_adc,
|
|
||||||
I2S_WIRES_ADC,
|
|
||||||
#endif
|
|
||||||
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
|
||||||
#ifndef CODEC_MASTER
|
|
||||||
0, /* NULL */
|
|
||||||
p_dsd_clk,
|
|
||||||
#else
|
|
||||||
0, /* NULL */
|
|
||||||
p_dsd_clk,
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
divide);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ConfigAudioPorts(
|
ConfigAudioPorts(
|
||||||
#if (I2S_CHANS_DAC != 0)
|
#if (I2S_CHANS_DAC != 0)
|
||||||
p_i2s_dac,
|
p_dac,
|
||||||
I2S_WIRES_DAC,
|
numPortsDac,
|
||||||
#endif
|
#endif
|
||||||
#if (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_ADC != 0)
|
||||||
p_i2s_adc,
|
p_adc,
|
||||||
I2S_WIRES_ADC,
|
numPortsAdc,
|
||||||
#endif
|
#endif
|
||||||
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
|
||||||
#ifndef CODEC_MASTER
|
|
||||||
p_lrclk,
|
p_lrclk,
|
||||||
p_bclk,
|
p_bclk,
|
||||||
#else
|
|
||||||
p_lrclk,
|
|
||||||
p_bclk,
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
divide);
|
divide);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
#include <xccompat.h>
|
#include <xccompat.h>
|
||||||
#include "devicedefines.h"
|
#include "devicedefines.h"
|
||||||
|
|
||||||
void ConfigAudioPorts_dsd(unsigned int divide);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __XC__
|
#ifdef __XC__
|
||||||
void ConfigAudioPorts(
|
void ConfigAudioPorts(
|
||||||
#if (I2S_CHANS_DAC != 0) || (DSD_CHANS_DAC != 0)
|
#if (I2S_CHANS_DAC != 0) || (DSD_CHANS_DAC != 0)
|
||||||
@@ -61,19 +58,19 @@ void ConfigAudioPorts(
|
|||||||
#ifdef __XC__
|
#ifdef __XC__
|
||||||
void ConfigAudioPortsWrapper(
|
void ConfigAudioPortsWrapper(
|
||||||
#if (I2S_CHANS_DAC != 0)
|
#if (I2S_CHANS_DAC != 0)
|
||||||
buffered out port:32 p_i2s_dac[I2S_WIRES_DAC],
|
buffered out port:32 p_i2s_dac[], int numPortsDAC,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_ADC != 0)
|
||||||
buffered in port:32 p_i2s_adc[I2S_WIRES_ADC],
|
buffered in port:32 p_i2s_adc[], int numPortsADC,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
||||||
#ifndef CODEC_MASTER
|
#ifndef CODEC_MASTER
|
||||||
buffered out port:32 p_lrclk,
|
buffered out port:32 ?p_lrclk,
|
||||||
buffered out port:32 p_bclk,
|
buffered out port:32 p_bclk,
|
||||||
#else
|
#else
|
||||||
in port p_lrclk,
|
in port ?p_lrclk,
|
||||||
in port p_bclk,
|
in port p_bclk,
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -82,28 +79,26 @@ void ConfigAudioPortsWrapper(
|
|||||||
|
|
||||||
void ConfigAudioPortsWrapper(
|
void ConfigAudioPortsWrapper(
|
||||||
#if (I2S_CHANS_DAC != 0)
|
#if (I2S_CHANS_DAC != 0)
|
||||||
port p_i2s_dac[I2S_WIRES_DAC],
|
port p_i2s_dac[], int numPortsDAC,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_ADC != 0)
|
||||||
port p_i2s_adc[I2S_WIRES_ADC],
|
port p_i2s_adc[], int numPortsADC,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
#if (I2S_CHANS_DAC != 0) || (I2S_CHANS_ADC != 0)
|
||||||
#ifndef CODEC_MASTER
|
|
||||||
port p_lrclk,
|
port p_lrclk,
|
||||||
port p_bclk,
|
port p_bclk,
|
||||||
#else
|
|
||||||
port p_lrclk,
|
|
||||||
port p_bclk,
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
unsigned int divide, unsigned int dsdMode);
|
unsigned int divide, unsigned int dsdMode);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __XC__*/
|
#endif /* __XC__*/
|
||||||
|
|
||||||
|
#ifdef __XC__
|
||||||
|
void EnableBufferedPort(buffered out port:32 p, unsigned transferWidth);
|
||||||
|
#else
|
||||||
|
void EnableBufferedPort(port p, unsigned transferWidth);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _AUDIOPORTS_H_ */
|
#endif /* _AUDIOPORTS_H_ */
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ unsigned int divide)
|
|||||||
#ifndef CODEC_MASTER
|
#ifndef CODEC_MASTER
|
||||||
/* Note this call to stop_clock() will pause forever if the port clocking the clock-block is not low.
|
/* Note this call to stop_clock() will pause forever if the port clocking the clock-block is not low.
|
||||||
* deliver() should return with this being the case */
|
* deliver() should return with this being the case */
|
||||||
|
|
||||||
stop_clock(clk_audio_bclk);
|
stop_clock(clk_audio_bclk);
|
||||||
|
|
||||||
if(!isnull(p_lrclk))
|
if(!isnull(p_lrclk))
|
||||||
|
|||||||
@@ -6,12 +6,10 @@
|
|||||||
* Audio I/O driver.
|
* Audio I/O driver.
|
||||||
*
|
*
|
||||||
* \param c_audio_out Channel connected to the audio() or mixer() threads
|
* \param c_audio_out Channel connected to the audio() or mixer() threads
|
||||||
* \param c_clk_int Optional chanend connected to the clockGen() thread if present
|
|
||||||
*/
|
*/
|
||||||
void decouple(chanend c_audio_out,
|
void decouple(chanend c_audio_out
|
||||||
chanend ?c_clk_int
|
|
||||||
#ifdef CHAN_BUFF_CTRL
|
#ifdef CHAN_BUFF_CTRL
|
||||||
, chanend c_buff_ctrl
|
, chanend c_buff_ctrl
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ void GetADCCounts(unsigned samFreq, int &min, int &mid, int &max);
|
|||||||
/* Globals for EP types */
|
/* Globals for EP types */
|
||||||
XUD_ep aud_from_host_usb_ep = 0;
|
XUD_ep aud_from_host_usb_ep = 0;
|
||||||
XUD_ep aud_to_host_usb_ep = 0;
|
XUD_ep aud_to_host_usb_ep = 0;
|
||||||
XUD_ep int_usb_ep = 0;
|
|
||||||
|
|
||||||
/* Shared global audio buffering variables */
|
/* Shared global audio buffering variables */
|
||||||
unsigned g_aud_from_host_buffer;
|
unsigned g_aud_from_host_buffer;
|
||||||
@@ -569,43 +568,6 @@ __builtin_unreachable();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned g_intFlag = 0;
|
|
||||||
|
|
||||||
extern unsigned char g_intData[8];
|
|
||||||
|
|
||||||
static void check_for_interrupt(chanend ?c_clk_int) {
|
|
||||||
unsigned tmp;
|
|
||||||
|
|
||||||
select
|
|
||||||
{
|
|
||||||
/* Clocking thread wants to produce an interrupt... */
|
|
||||||
case inuint_byref(c_clk_int, tmp):
|
|
||||||
chkct(c_clk_int, XS1_CT_END);
|
|
||||||
|
|
||||||
/* Check if we have interrupt pending */
|
|
||||||
/* TODO This means we can loose interrupts */
|
|
||||||
if(!g_intFlag)
|
|
||||||
{
|
|
||||||
int x;
|
|
||||||
|
|
||||||
g_intFlag = 1;
|
|
||||||
|
|
||||||
g_intData[5] = tmp;
|
|
||||||
|
|
||||||
/* Make request to send to XUD endpoint - response handled in usb_buffer */
|
|
||||||
//XUD_SetReady(int_usb_ep, 0);
|
|
||||||
|
|
||||||
//asm("ldaw %0, dp[g_intData]":"=r"(x));
|
|
||||||
//XUD_SetReady_In(int_usb_ep, g_intData, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Mark Endpoint (IN) ready with an appropriately sized zero buffer */
|
/* Mark Endpoint (IN) ready with an appropriately sized zero buffer */
|
||||||
static inline void SetupZerosSendBuffer(XUD_ep aud_to_host_usb_ep, unsigned sampFreq, unsigned slotSize)
|
static inline void SetupZerosSendBuffer(XUD_ep aud_to_host_usb_ep, unsigned sampFreq, unsigned slotSize)
|
||||||
{
|
{
|
||||||
@@ -636,10 +598,9 @@ static inline void SetupZerosSendBuffer(XUD_ep aud_to_host_usb_ep, unsigned samp
|
|||||||
unsigned char tmpBuffer[1026];
|
unsigned char tmpBuffer[1026];
|
||||||
|
|
||||||
#pragma unsafe arrays
|
#pragma unsafe arrays
|
||||||
void decouple(chanend c_mix_out,
|
void decouple(chanend c_mix_out
|
||||||
chanend ?c_clk_int
|
|
||||||
#ifdef CHAN_BUFF_CTRL
|
#ifdef CHAN_BUFF_CTRL
|
||||||
, chanend c_buf_ctrl
|
, chanend c_buf_ctrl
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -680,14 +641,6 @@ void decouple(chanend c_mix_out,
|
|||||||
t = array_to_xc_ptr(inZeroBuff);
|
t = array_to_xc_ptr(inZeroBuff);
|
||||||
g_aud_to_host_zeros = t;
|
g_aud_to_host_zeros = t;
|
||||||
|
|
||||||
/* Init interrupt report */
|
|
||||||
g_intData[0] = 0; // Class-specific, caused by interface
|
|
||||||
g_intData[1] = 1; // attribute: CUR
|
|
||||||
g_intData[2] = 0; // CN/ MCN
|
|
||||||
g_intData[3] = 0; // CS
|
|
||||||
g_intData[4] = 0; // interface
|
|
||||||
g_intData[5] = 0; // ID of entity causing interrupt - this will get modified
|
|
||||||
|
|
||||||
/* Init vol mult tables */
|
/* Init vol mult tables */
|
||||||
#ifndef OUT_VOLUME_IN_MIXER
|
#ifndef OUT_VOLUME_IN_MIXER
|
||||||
for (int i = 0; i < NUM_USB_CHAN_OUT + 1; i++)
|
for (int i = 0; i < NUM_USB_CHAN_OUT + 1; i++)
|
||||||
@@ -748,12 +701,6 @@ void decouple(chanend c_mix_out,
|
|||||||
inuchar(c_buf_ctrl);
|
inuchar(c_buf_ctrl);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!isnull(c_clk_int))
|
|
||||||
{
|
|
||||||
check_for_interrupt(c_clk_int);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
asm("#decouple-default");
|
asm("#decouple-default");
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
* \param c_midi_from_host MIDI OUT endpoint channel connected to the XUD
|
* \param c_midi_from_host MIDI OUT endpoint channel connected to the XUD
|
||||||
* \param c_midi_to_host MIDI IN endpoint channel connected to the XUD
|
* \param c_midi_to_host MIDI IN endpoint channel connected to the XUD
|
||||||
* \param c_int Audio clocking interrupt endpoint channel connected to the XUD
|
* \param c_int Audio clocking interrupt endpoint channel connected to the XUD
|
||||||
|
* \param c_clk_int Optional chanend connected to the clockGen() thread if present
|
||||||
* \param c_sof Start of frame channel connected to the XUD
|
* \param c_sof Start of frame channel connected to the XUD
|
||||||
* \param c_aud_ctl Audio control channel connected to Endpoint0()
|
* \param c_aud_ctl Audio control channel connected to Endpoint0()
|
||||||
* \param p_off_mclk A port that is clocked of the MCLK input (not the MCLK input itself)
|
* \param p_off_mclk A port that is clocked of the MCLK input (not the MCLK input itself)
|
||||||
@@ -33,7 +34,8 @@ void buffer(chanend c_aud_out,
|
|||||||
chanend c_iap,
|
chanend c_iap,
|
||||||
#endif
|
#endif
|
||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
chanend? c_int,
|
chanend ?c_int,
|
||||||
|
chanend ?c_clk_int,
|
||||||
#endif
|
#endif
|
||||||
chanend c_sof,
|
chanend c_sof,
|
||||||
chanend c_aud_ctl,
|
chanend c_aud_ctl,
|
||||||
|
|||||||
@@ -38,8 +38,23 @@ extern unsigned int g_curSamFreqMultiplier;
|
|||||||
unsigned g_speed;
|
unsigned g_speed;
|
||||||
unsigned g_freqChange = 0;
|
unsigned g_freqChange = 0;
|
||||||
|
|
||||||
/* Interrupt EP data */
|
#if defined (SPDIF_RX) || defined (ADAT_RX)
|
||||||
unsigned char g_intData[8];
|
/* When digital Rx enabled we enable an interrupt EP to inform host about changes in clock validity */
|
||||||
|
/* Interrupt EP report data */
|
||||||
|
unsigned char g_intData[8] =
|
||||||
|
{
|
||||||
|
0, // Class-specific, caused by interface
|
||||||
|
1, // attribute: CUR
|
||||||
|
0, // CN/ MCN
|
||||||
|
0, // CS
|
||||||
|
0, // interface
|
||||||
|
0, // ID of entity causing interrupt - this will get modified;
|
||||||
|
0, // Spare
|
||||||
|
0, // Spare
|
||||||
|
};
|
||||||
|
|
||||||
|
unsigned g_intFlag = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (MIDI) || defined(IAP)
|
#if defined (MIDI) || defined(IAP)
|
||||||
static inline void swap(xc_ptr &a, xc_ptr &b)
|
static inline void swap(xc_ptr &a, xc_ptr &b)
|
||||||
@@ -91,7 +106,8 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
|
|||||||
chanend c_iap,
|
chanend c_iap,
|
||||||
#endif
|
#endif
|
||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
chanend ?c_int,
|
chanend ?c_ep_int,
|
||||||
|
chanend ?c_clk_int,
|
||||||
#endif
|
#endif
|
||||||
chanend c_sof,
|
chanend c_sof,
|
||||||
chanend c_aud_ctl,
|
chanend c_aud_ctl,
|
||||||
@@ -119,7 +135,7 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
XUD_ep ep_int = XUD_InitEp(c_int);
|
XUD_ep ep_int = XUD_InitEp(c_ep_int);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HID_CONTROLS
|
#ifdef HID_CONTROLS
|
||||||
@@ -172,9 +188,6 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
|
|||||||
int iap_draining_chan = 0;
|
int iap_draining_chan = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
|
||||||
asm("stw %0, dp[int_usb_ep]"::"r"(ep_int));
|
|
||||||
#endif
|
|
||||||
/* Store EP's to globals so that decouple() can access them */
|
/* Store EP's to globals so that decouple() can access them */
|
||||||
asm("stw %0, dp[aud_from_host_usb_ep]"::"r"(ep_aud_out));
|
asm("stw %0, dp[aud_from_host_usb_ep]"::"r"(ep_aud_out));
|
||||||
asm("stw %0, dp[aud_to_host_usb_ep]"::"r"(ep_aud_in));
|
asm("stw %0, dp[aud_to_host_usb_ep]"::"r"(ep_aud_in));
|
||||||
@@ -216,11 +229,27 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
|
|||||||
select
|
select
|
||||||
{
|
{
|
||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
/* Interrupt EP, send back interrupt data. Note, request made from decouple */
|
/* Clocking thread wants to produce an interrupt... */
|
||||||
case XUD_SetData_Select(c_int, ep_int, result):
|
case inuint_byref(c_clk_int, u_tmp):
|
||||||
|
chkct(c_clk_int, XS1_CT_END);
|
||||||
|
|
||||||
|
/* Check if we have interrupt pending.
|
||||||
|
* Note, this his means we can loose interrupts... */
|
||||||
|
if(!g_intFlag)
|
||||||
|
{
|
||||||
|
g_intFlag = 1;
|
||||||
|
|
||||||
|
/* Append Unit ID onto packet */
|
||||||
|
g_intData[5] = u_tmp;
|
||||||
|
|
||||||
|
XUD_SetReady_In(ep_int, g_intData, 6);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Interrupt EP data sent, clear flag */
|
||||||
|
case XUD_SetData_Select(c_ep_int, ep_int, result):
|
||||||
{
|
{
|
||||||
int sent_ok = 0;
|
g_intFlag = 0;
|
||||||
asm("stw %0, dp[g_intFlag]" :: "r" (0) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
9
xpd.xml
9
xpd.xml
@@ -5,7 +5,7 @@
|
|||||||
<board>XMOS USB Audio Reference Designes</board>
|
<board>XMOS USB Audio Reference Designes</board>
|
||||||
<keyword>DFU</keyword>
|
<keyword>DFU</keyword>
|
||||||
</component>
|
</component>
|
||||||
<component description = "queue" type = "demoCode" scope = "General Use" path = "module_queue" local = "false" id = "module_queue" name = "Queing Module For USB Audio Framwwork">
|
<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>
|
<board></board>
|
||||||
<componentDependency repo = "git://github.com/xcore/sc_util" version = "1.0.4">module_xassert</componentDependency>
|
<componentDependency repo = "git://github.com/xcore/sc_util" version = "1.0.4">module_xassert</componentDependency>
|
||||||
<keyword>UAC2</keyword>
|
<keyword>UAC2</keyword>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
</component>
|
</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">
|
<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>
|
<board></board>
|
||||||
<componentDependency version = "6.6.0">module_queue</componentDependency>
|
<componentDependency version = "6.6.1">module_queue</componentDependency>
|
||||||
<componentDependency repo = "git://github.com/xcore/sc_util" version = "1.0.4">module_xassert</componentDependency>
|
<componentDependency repo = "git://github.com/xcore/sc_util" version = "1.0.4">module_xassert</componentDependency>
|
||||||
<keyword>MIDI</keyword>
|
<keyword>MIDI</keyword>
|
||||||
</component>
|
</component>
|
||||||
@@ -67,7 +67,10 @@
|
|||||||
<release parenthash = "ccf7c66588501a090ab25003f3d646b22c03b243" version = "6.6.0beta1" githash = "91c7bcff7a403fc9638bd05fcb4b63f75b7eccca"></release>
|
<release parenthash = "ccf7c66588501a090ab25003f3d646b22c03b243" version = "6.6.0beta1" githash = "91c7bcff7a403fc9638bd05fcb4b63f75b7eccca"></release>
|
||||||
<release parenthash = "91c7bcff7a403fc9638bd05fcb4b63f75b7eccca" version = "6.6.0rc0" githash = "3a340d50732b31012b412d35598bbf311df2b914"></release>
|
<release parenthash = "91c7bcff7a403fc9638bd05fcb4b63f75b7eccca" version = "6.6.0rc0" githash = "3a340d50732b31012b412d35598bbf311df2b914"></release>
|
||||||
<release parenthash = "d7f0cdd4be780869137968f00f1d2a46663a1f33" version = "6.6.0rc1" githash = "a714e668020fe14128b213eae7ea3290d4ddf28a"></release>
|
<release parenthash = "d7f0cdd4be780869137968f00f1d2a46663a1f33" version = "6.6.0rc1" githash = "a714e668020fe14128b213eae7ea3290d4ddf28a"></release>
|
||||||
<release parenthash = "192b263d764650b2b498157b192dbda8882aba99" version = "6.6.0rc2"></release>
|
<release parenthash = "192b263d764650b2b498157b192dbda8882aba99" version = "6.6.0rc2" githash = "74d448097f79524c97fc2967bb227264a39be016"></release>
|
||||||
|
<release parenthash = "9be1ef8d706be7027c3712a2fef15144767dfe55" version = "6.6.1rc0" githash = "6456645f423546b708db53aa5979967b3c8019aa"></release>
|
||||||
|
<release parenthash = "7c17932c58c8e1d32a9002fe635672b95fff259d" version = "6.6.1rc1" githash = "9ce2f74146e6be516ed19cc767a03e52a6eb31a2"></release>
|
||||||
|
<release parenthash = "1677eb49b0fec05c231727d6938643e0e7f07a10" version = "6.7.0alpha0"></release>
|
||||||
<subpartnumber>XM-004720-SM</subpartnumber>
|
<subpartnumber>XM-004720-SM</subpartnumber>
|
||||||
<vendor>XMOS</vendor>
|
<vendor>XMOS</vendor>
|
||||||
<version_defines>
|
<version_defines>
|
||||||
|
|||||||
Reference in New Issue
Block a user