forked from PAWPAW-Mirror/lib_xua
Adding SPDIF in to main (note, currently has build issues)
This commit is contained in:
@@ -32,6 +32,11 @@
|
|||||||
#include "mixer.h"
|
#include "mixer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
#include "SpdifReceive.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 +103,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,6 +129,10 @@ 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 */
|
||||||
|
#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;
|
||||||
|
|
||||||
@@ -141,6 +152,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)
|
||||||
@@ -225,7 +240,7 @@ void xscope_user_init()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SELF_POWERED
|
#ifdef SELF_POWERED
|
||||||
#define pwrConfig XUD_PWR_SELF
|
#define pwrConfig XUD_PWR_BUS
|
||||||
#else
|
#else
|
||||||
#define pwrConfig XUD_PWR_BUS
|
#define pwrConfig XUD_PWR_BUS
|
||||||
#endif
|
#endif
|
||||||
@@ -341,21 +356,23 @@ void usb_audio_io(chanend c_aud_in, chanend ?c_adc
|
|||||||
, chanend c_mix_ctl
|
, chanend c_mix_ctl
|
||||||
#endif
|
#endif
|
||||||
, chanend ?c_aud_cfg
|
, chanend ?c_aud_cfg
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
, chanend ?c_dig_rx
|
||||||
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#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;
|
|
||||||
#else
|
|
||||||
#define c_dig_rx null
|
|
||||||
#endif
|
|
||||||
|
|
||||||
par
|
par
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MIXER
|
#ifdef MIXER
|
||||||
/* Mixer cores(s) */
|
/* Mixer cores(s) */
|
||||||
{
|
{
|
||||||
@@ -410,6 +427,14 @@ int main()
|
|||||||
#define c_aud_cfg null
|
#define c_aud_cfg null
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDIF_RX
|
||||||
|
chan c_dig_rx;
|
||||||
|
streaming chan c_spdif_rx;
|
||||||
|
#else
|
||||||
|
#define c_dig_rx null
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
USER_MAIN_DECLARATIONS
|
USER_MAIN_DECLARATIONS
|
||||||
|
|
||||||
par
|
par
|
||||||
@@ -431,6 +456,8 @@ int main()
|
|||||||
, c_mix_ctl
|
, c_mix_ctl
|
||||||
#endif
|
#endif
|
||||||
, c_aud_cfg
|
, c_aud_cfg
|
||||||
|
|
||||||
|
, c_dig_rx
|
||||||
);
|
);
|
||||||
|
|
||||||
#if defined(MIDI) && defined(IAP) && (IAP_TILE == MIDI_TILE)
|
#if defined(MIDI) && defined(IAP) && (IAP_TILE == MIDI_TILE)
|
||||||
@@ -458,6 +485,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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user