forked from PAWPAW-Mirror/lib_xua
xpd: Cleaned up whitespace
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
on tile[0]: out port p_ctrl = XS1_PORT_8D;
|
on tile[0]: out port p_ctrl = XS1_PORT_8D;
|
||||||
|
|
||||||
/* p_ctrl:
|
/* p_ctrl:
|
||||||
* [0:3] - Unused
|
* [0:3] - Unused
|
||||||
* [4] - EN_3v3_N
|
* [4] - EN_3v3_N
|
||||||
* [5] - EN_3v3A
|
* [5] - EN_3v3A
|
||||||
* [6] - EXT_PLL_SEL (CS2100:0, SI: 1)
|
* [6] - EXT_PLL_SEL (CS2100:0, SI: 1)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
on tile[0]: out port p_ctrl = XS1_PORT_8D;
|
on tile[0]: out port p_ctrl = XS1_PORT_8D;
|
||||||
|
|
||||||
/* p_ctrl:
|
/* p_ctrl:
|
||||||
* [0:3] - Unused
|
* [0:3] - Unused
|
||||||
* [4] - EN_3v3_N
|
* [4] - EN_3v3_N
|
||||||
* [5] - EN_3v3A
|
* [5] - EN_3v3A
|
||||||
* [6] - EXT_PLL_SEL (CS2100:0, SI: 1)
|
* [6] - EXT_PLL_SEL (CS2100:0, SI: 1)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ void XUA_Buffer(
|
|||||||
#if (NUM_USB_CHAN_IN > 0) || defined(__DOXYGEN__)
|
#if (NUM_USB_CHAN_IN > 0) || defined(__DOXYGEN__)
|
||||||
chanend c_aud_in,
|
chanend c_aud_in,
|
||||||
#endif
|
#endif
|
||||||
#if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP)
|
#if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP)
|
||||||
chanend c_aud_fb,
|
chanend c_aud_fb,
|
||||||
#endif
|
#endif
|
||||||
#if defined(MIDI) || defined(__DOXYGEN__)
|
#if defined(MIDI) || defined(__DOXYGEN__)
|
||||||
|
|||||||
@@ -966,7 +966,7 @@
|
|||||||
* Default: XUA_POWERMODE_BUS
|
* Default: XUA_POWERMODE_BUS
|
||||||
*/
|
*/
|
||||||
#ifndef XUA_POWERMODE
|
#ifndef XUA_POWERMODE
|
||||||
#define XUA_POWERMODE XUA_POWERMODE_BUS
|
#define XUA_POWERMODE XUA_POWERMODE_BUS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1136,7 +1136,7 @@
|
|||||||
#undef UAC_FORCE_FEEDBACK_EP
|
#undef UAC_FORCE_FEEDBACK_EP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Synchronisation defines */
|
/* Synchronisation defines */
|
||||||
#define XUA_SYNCMODE_ASYNC (1) // USB_ENDPOINT_SYNCTYPE_ASYNC
|
#define XUA_SYNCMODE_ASYNC (1) // USB_ENDPOINT_SYNCTYPE_ASYNC
|
||||||
#define XUA_SYNCMODE_ADAPT (2) // USB_ENDPOINT_SYNCTYPE_ADAPT
|
#define XUA_SYNCMODE_ADAPT (2) // USB_ENDPOINT_SYNCTYPE_ADAPT
|
||||||
#define XUA_SYNCMODE_SYNC (3) // USB_ENDPOINT_SYNCTYPE_SYNC
|
#define XUA_SYNCMODE_SYNC (3) // USB_ENDPOINT_SYNCTYPE_SYNC
|
||||||
|
|||||||
@@ -22,15 +22,15 @@
|
|||||||
* present
|
* present
|
||||||
* \param c_clk_ctl Optional chanend to be connected to the clockgen core if
|
* \param c_clk_ctl Optional chanend to be connected to the clockgen core if
|
||||||
* present
|
* present
|
||||||
* \param dfuInterface Interface to DFU task (this task must be run on a tile
|
* \param dfuInterface Interface to DFU task (this task must be run on a tile
|
||||||
* connected to boot flash.
|
* connected to boot flash.
|
||||||
* \param c_EANativeTransport_ctrl Optional chanend to be connected to EA Native
|
* \param c_EANativeTransport_ctrl Optional chanend to be connected to EA Native
|
||||||
* endpoint manager if present
|
* endpoint manager if present
|
||||||
*/
|
*/
|
||||||
void XUA_Endpoint0(chanend c_ep0_out,
|
void XUA_Endpoint0(chanend c_ep0_out,
|
||||||
chanend c_ep0_in, chanend ?c_audioCtrl,
|
chanend c_ep0_in, chanend ?c_audioCtrl,
|
||||||
chanend ?c_mix_ctl, chanend ?c_clk_ctl,
|
chanend ?c_mix_ctl, chanend ?c_clk_ctl,
|
||||||
chanend ?c_EANativeTransport_ctrl,
|
chanend ?c_EANativeTransport_ctrl,
|
||||||
client interface i_dfu ?dfuInterface
|
client interface i_dfu ?dfuInterface
|
||||||
#if !defined(__DOXYGEN__)
|
#if !defined(__DOXYGEN__)
|
||||||
VENDOR_REQUESTS_PARAMS_DEC_
|
VENDOR_REQUESTS_PARAMS_DEC_
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ void PllRefPinTask(server interface pll_ref_if i_pll_ref, out port p_pll_ref)
|
|||||||
pinVal = ~pinVal;
|
pinVal = ~pinVal;
|
||||||
p_pll_ref <: pinVal;
|
p_pll_ref <: pinVal;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case i_pll_ref.init():
|
case i_pll_ref.init():
|
||||||
p_pll_ref <: pinVal @ pinTime;
|
p_pll_ref <: pinVal @ pinTime;
|
||||||
pinTime += (unsigned short)(LOCAL_CLOCK_INCREMENT - (LOCAL_CLOCK_INCREMENT/2));
|
pinTime += (unsigned short)(LOCAL_CLOCK_INCREMENT - (LOCAL_CLOCK_INCREMENT/2));
|
||||||
@@ -61,9 +61,9 @@ void PllRefPinTask(server interface pll_ref_if i_pll_ref, out port p_pll_ref)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case i_pll_ref.toggle_timed(int relative):
|
case i_pll_ref.toggle_timed(int relative):
|
||||||
|
|
||||||
if (!relative)
|
if (!relative)
|
||||||
{
|
{
|
||||||
pinTime += (short) LOCAL_CLOCK_INCREMENT;
|
pinTime += (short) LOCAL_CLOCK_INCREMENT;
|
||||||
pinVal = !pinVal;
|
pinVal = !pinVal;
|
||||||
p_pll_ref @ pinTime <: pinVal;
|
p_pll_ref @ pinTime <: pinVal;
|
||||||
@@ -353,7 +353,7 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interfa
|
|||||||
|
|
||||||
/* Initial ref clock output and get timestamp */
|
/* Initial ref clock output and get timestamp */
|
||||||
i_pll_ref.init();
|
i_pll_ref.init();
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
select
|
select
|
||||||
@@ -485,8 +485,8 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interfa
|
|||||||
timeNextClockDetection = timeNextEdge + (LOCAL_CLOCK_INCREMENT/2);
|
timeNextClockDetection = timeNextEdge + (LOCAL_CLOCK_INCREMENT/2);
|
||||||
timeNextEdge += LOCAL_CLOCK_INCREMENT;
|
timeNextEdge += LOCAL_CLOCK_INCREMENT;
|
||||||
|
|
||||||
/* If we are in an external clock mode and this fire, then clock invalid
|
/* If we are in an external clock mode and this fire, then clock invalid
|
||||||
* reset counters in case we are moved to digital clock - we want a well timed
|
* reset counters in case we are moved to digital clock - we want a well timed
|
||||||
* first edge */
|
* first edge */
|
||||||
#if (XUA_SPDIF_RX_EN)
|
#if (XUA_SPDIF_RX_EN)
|
||||||
spdifCounters.receivedSamples = 0;
|
spdifCounters.receivedSamples = 0;
|
||||||
@@ -707,7 +707,7 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interfa
|
|||||||
|
|
||||||
/* Toggle edge */
|
/* Toggle edge */
|
||||||
i_pll_ref.toggle_timed(1);
|
i_pll_ref.toggle_timed(1);
|
||||||
|
|
||||||
/* Reset counters */
|
/* Reset counters */
|
||||||
adatCounters.receivedSamples = 0;
|
adatCounters.receivedSamples = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
#define ISO_EP_ATTRIBUTES_ASYNC ((USB_ENDPOINT_TRANSTYPE_ISO << USB_ENDPOINT_TRANSTYPE_SHIFT)\
|
#define ISO_EP_ATTRIBUTES_ASYNC ((USB_ENDPOINT_TRANSTYPE_ISO << USB_ENDPOINT_TRANSTYPE_SHIFT)\
|
||||||
| (USB_ENDPOINT_SYNCTYPE_ASYNC << USB_ENDPOINT_SYNCTYPE_SHIFT)\
|
| (USB_ENDPOINT_SYNCTYPE_ASYNC << USB_ENDPOINT_SYNCTYPE_SHIFT)\
|
||||||
| (USB_ENDPOINT_USAGETYPE_DATA << USB_ENDPOINT_USAGETYPE_SHIFT))
|
| (USB_ENDPOINT_USAGETYPE_DATA << USB_ENDPOINT_USAGETYPE_SHIFT))
|
||||||
|
|
||||||
#define ISO_EP_ATTRIBUTES_ADAPTIVE ((USB_ENDPOINT_TRANSTYPE_ISO << USB_ENDPOINT_TRANSTYPE_SHIFT)\
|
#define ISO_EP_ATTRIBUTES_ADAPTIVE ((USB_ENDPOINT_TRANSTYPE_ISO << USB_ENDPOINT_TRANSTYPE_SHIFT)\
|
||||||
| (USB_ENDPOINT_SYNCTYPE_ADAPT << USB_ENDPOINT_SYNCTYPE_SHIFT)\
|
| (USB_ENDPOINT_SYNCTYPE_ADAPT << USB_ENDPOINT_SYNCTYPE_SHIFT)\
|
||||||
| (USB_ENDPOINT_USAGETYPE_DATA << USB_ENDPOINT_USAGETYPE_SHIFT))
|
| (USB_ENDPOINT_USAGETYPE_DATA << USB_ENDPOINT_USAGETYPE_SHIFT))
|
||||||
@@ -1486,7 +1486,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
#elif (XUA_SYNCMODE == XUA_SYNCMODE_SYNC)
|
#elif (XUA_SYNCMODE == XUA_SYNCMODE_SYNC)
|
||||||
.bmAttributes = ISO_EP_ATTRIBUTES_SYNC,
|
.bmAttributes = ISO_EP_ATTRIBUTES_SYNC,
|
||||||
#else
|
#else
|
||||||
#error "Bad XUA_SYNCMODE"
|
#error "Bad XUA_SYNCMODE"
|
||||||
#endif
|
#endif
|
||||||
.wMaxPacketSize = HS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE,
|
.wMaxPacketSize = HS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE,
|
||||||
.bInterval = 1,
|
.bInterval = 1,
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ VENDOR_REQUESTS_PARAMS_DEC_
|
|||||||
unsigned usbSpeed = (AUDIO_CLASS == 2) ? XUD_SPEED_HS : XUD_SPEED_FS;
|
unsigned usbSpeed = (AUDIO_CLASS == 2) ? XUD_SPEED_HS : XUD_SPEED_FS;
|
||||||
|
|
||||||
unsigned xudPwrCfg = (XUA_POWERMODE == XUA_POWERMODE_SELF) ? XUD_PWR_SELF : XUD_PWR_BUS;
|
unsigned xudPwrCfg = (XUA_POWERMODE == XUA_POWERMODE_SELF) ? XUD_PWR_SELF : XUD_PWR_BUS;
|
||||||
|
|
||||||
/* USB interface core */
|
/* USB interface core */
|
||||||
XUD_Main(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
|
XUD_Main(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
|
||||||
c_sof, epTypeTableOut, epTypeTableIn, usbSpeed, xudPwrCfg);
|
c_sof, epTypeTableOut, epTypeTableIn, usbSpeed, xudPwrCfg);
|
||||||
@@ -491,8 +491,8 @@ void usb_audio_io(chanend ?c_aud_in,
|
|||||||
|
|
||||||
#if (XUA_SPDIF_RX_EN || XUA_ADAT_RX_EN)
|
#if (XUA_SPDIF_RX_EN || XUA_ADAT_RX_EN)
|
||||||
{
|
{
|
||||||
/* ClockGen must currently run on same tile as AudioHub due to shared memory buffer
|
/* ClockGen must currently run on same tile as AudioHub due to shared memory buffer
|
||||||
* However, due to the use of an interface the pll reference signal port can be on another tile
|
* However, due to the use of an interface the pll reference signal port can be on another tile
|
||||||
*/
|
*/
|
||||||
thread_speed();
|
thread_speed();
|
||||||
clockGen(c_spdif_rx, c_adat_rx, i_pll_ref, c_dig_rx, c_clk_ctl, c_clk_int);
|
clockGen(c_spdif_rx, c_adat_rx, i_pll_ref, c_dig_rx, c_clk_ctl, c_clk_int);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
||||||
|
|
||||||
/* Simple test to ensure reference clock to CS2100 device continues when SOF clock not available
|
/* Simple test to ensure reference clock to CS2100 device continues when SOF clock not available
|
||||||
* Note, this test uses "nice" numbers (i.e. MISSIG_SOFS %8 == 0) and therefore doesn't check
|
* Note, this test uses "nice" numbers (i.e. MISSIG_SOFS %8 == 0) and therefore doesn't check
|
||||||
* for a graceful change over from internal to SOF clock
|
* for a graceful change over from internal to SOF clock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#define EP_COUNT_IN (3)
|
#define EP_COUNT_IN (3)
|
||||||
#define EP_COUNT_OUT (3)
|
#define EP_COUNT_OUT (3)
|
||||||
|
|
||||||
out port p_pll_ref = XS1_PORT_1A;
|
out port p_pll_ref = XS1_PORT_1A;
|
||||||
in port p_off_mclk = XS1_PORT_1M;
|
in port p_off_mclk = XS1_PORT_1M;
|
||||||
in port p_pll_loop = XS1_PORT_1B; /* Note, this is externally looped back using the loopback plugin */
|
in port p_pll_loop = XS1_PORT_1B; /* Note, this is externally looped back using the loopback plugin */
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ void delay(unsigned d)
|
|||||||
unsigned time;
|
unsigned time;
|
||||||
t :> time;
|
t :> time;
|
||||||
t when timerafter(time + d) :> int x;
|
t when timerafter(time + d) :> int x;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* From lib_xud */
|
/* From lib_xud */
|
||||||
void SetupEndpoints(chanend c_ep_out[], int noEpOut, chanend c_ep_in[], int noEpIn, XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[]);
|
void SetupEndpoints(chanend c_ep_out[], int noEpOut, chanend c_ep_in[], int noEpIn, XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[]);
|
||||||
@@ -80,41 +80,41 @@ void fake_xud(chanend c_out[], chanend c_in[], chanend c_sof)
|
|||||||
{
|
{
|
||||||
timer t;
|
timer t;
|
||||||
unsigned time;
|
unsigned time;
|
||||||
|
|
||||||
|
|
||||||
/* Makes traces a bit nicer to look at */
|
|
||||||
|
/* Makes traces a bit nicer to look at */
|
||||||
t :> time;
|
t :> time;
|
||||||
t when timerafter(SOF_PERIOD_TICKS * 2) :> int x;
|
t when timerafter(SOF_PERIOD_TICKS * 2) :> int x;
|
||||||
|
|
||||||
p_test0 <: 1;
|
p_test0 <: 1;
|
||||||
|
|
||||||
/* Endpoint type tables */
|
/* Endpoint type tables */
|
||||||
XUD_EpType epTypeTableOut[EP_COUNT_OUT] = {XUD_EPTYPE_CTL, XUD_EPTYPE_ISO, XUD_EPTYPE_DIS};
|
XUD_EpType epTypeTableOut[EP_COUNT_OUT] = {XUD_EPTYPE_CTL, XUD_EPTYPE_ISO, XUD_EPTYPE_DIS};
|
||||||
XUD_EpType epTypeTableIn[EP_COUNT_IN] = {XUD_EPTYPE_CTL, XUD_EPTYPE_ISO, XUD_EPTYPE_ISO};
|
XUD_EpType epTypeTableIn[EP_COUNT_IN] = {XUD_EPTYPE_CTL, XUD_EPTYPE_ISO, XUD_EPTYPE_ISO};
|
||||||
|
|
||||||
SetupEndpoints(c_out, EP_COUNT_OUT, c_in, EP_COUNT_IN, epTypeTableOut, epTypeTableIn);
|
SetupEndpoints(c_out, EP_COUNT_OUT, c_in, EP_COUNT_IN, epTypeTableOut, epTypeTableIn);
|
||||||
|
|
||||||
driveSofs(c_sof, 32/SOF_DIVIDE);
|
driveSofs(c_sof, 32/SOF_DIVIDE);
|
||||||
|
|
||||||
p_test0 <: 0;
|
p_test0 <: 0;
|
||||||
|
|
||||||
/* Sim missing SOFs */
|
/* Sim missing SOFs */
|
||||||
delay(MISSING_SOF_PERIOD);
|
delay(MISSING_SOF_PERIOD);
|
||||||
|
|
||||||
p_test0 <: 1;
|
p_test0 <: 1;
|
||||||
|
|
||||||
driveSofs(c_sof, 16/SOF_DIVIDE);
|
driveSofs(c_sof, 16/SOF_DIVIDE);
|
||||||
|
|
||||||
p_test0 <: 0;
|
p_test0 <: 0;
|
||||||
|
|
||||||
delay(MISSING_SOF_PERIOD);
|
delay(MISSING_SOF_PERIOD);
|
||||||
|
|
||||||
p_test0 <: 1;
|
p_test0 <: 1;
|
||||||
|
|
||||||
driveSofs(c_sof, 16/SOF_DIVIDE);
|
driveSofs(c_sof, 16/SOF_DIVIDE);
|
||||||
|
|
||||||
p_test0 <: 0;
|
p_test0 <: 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern XUD_BusSpeed_t g_curUsbSpeed;
|
extern XUD_BusSpeed_t g_curUsbSpeed;
|
||||||
@@ -124,7 +124,7 @@ extern XUD_BusSpeed_t g_curUsbSpeed;
|
|||||||
|
|
||||||
void checker()
|
void checker()
|
||||||
{
|
{
|
||||||
timer t;
|
timer t;
|
||||||
unsigned t0, t1;
|
unsigned t0, t1;
|
||||||
unsigned x = 0;
|
unsigned x = 0;
|
||||||
int fail = 0;
|
int fail = 0;
|
||||||
@@ -141,7 +141,7 @@ void checker()
|
|||||||
t :> t0;
|
t :> t0;
|
||||||
p_pll_loop when pinsneq(x) :> x;
|
p_pll_loop when pinsneq(x) :> x;
|
||||||
t :> t1;
|
t :> t1;
|
||||||
|
|
||||||
int period = t1-t0;
|
int period = t1-t0;
|
||||||
|
|
||||||
/* Check the period of the reference clock we are generating */
|
/* Check the period of the reference clock we are generating */
|
||||||
@@ -190,7 +190,7 @@ int main()
|
|||||||
}
|
}
|
||||||
|
|
||||||
fake_xud(c_out, c_in, c_sof);
|
fake_xud(c_out, c_in, c_sof);
|
||||||
|
|
||||||
checker();
|
checker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define I2S_CHANS_ADC (2)
|
#define I2S_CHANS_ADC (2)
|
||||||
|
|
||||||
#define XUA_SYNCMODE XUA_SYNCMODE_SYNC
|
#define XUA_SYNCMODE XUA_SYNCMODE_SYNC
|
||||||
#define UAC_FORCE_FEEDBACK_EP (0)
|
#define UAC_FORCE_FEEDBACK_EP (0)
|
||||||
|
|
||||||
#define EXCLUDE_USB_AUDIO_MAIN
|
#define EXCLUDE_USB_AUDIO_MAIN
|
||||||
#define XUA_NUM_PDM_MICS 0
|
#define XUA_NUM_PDM_MICS 0
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define I2S_CHANS_ADC (2)
|
#define I2S_CHANS_ADC (2)
|
||||||
|
|
||||||
#define XUA_SYNCMODE XUA_SYNCMODE_SYNC
|
#define XUA_SYNCMODE XUA_SYNCMODE_SYNC
|
||||||
#define UAC_FORCE_FEEDBACK_EP (0)
|
#define UAC_FORCE_FEEDBACK_EP (0)
|
||||||
|
|
||||||
#define EXCLUDE_USB_AUDIO_MAIN
|
#define EXCLUDE_USB_AUDIO_MAIN
|
||||||
#define XUA_NUM_PDM_MICS 0
|
#define XUA_NUM_PDM_MICS 0
|
||||||
|
|||||||
Reference in New Issue
Block a user