Merge pull request #7 from ed-xmos/remove_xud_dep_for_i2s

Remove xud dep for i2s in vf
This commit is contained in:
Ross Owen
2017-07-18 15:36:40 +01:00
committed by GitHub
15 changed files with 41 additions and 18 deletions

View File

@@ -2,6 +2,7 @@
#include <platform.h>
#include "devicedefines.h"
#ifndef NO_USB
#include "xud.h"
#include "usb_std_requests.h"
@@ -580,4 +581,4 @@ int DFUDeviceRequests(XUD_ep ep0_out, XUD_ep &?ep0_in, USB_SetupPacket_t &sp, ch
}
return returnVal;
}
#endif /* NO_USB */

View File

@@ -1048,8 +1048,10 @@ void SpdifTxWrapper(chanend c_spdif_tx)
/* This function is a dummy version of the deliver thread that does not
connect to the codec ports. It is used during DFU reset. */
#if DFU
[[distributable]]
void DFUHandler(server interface i_dfu i, chanend ?c_user_cmd);
#endif
#pragma select handler
void testct_byref(chanend c, int &returnVal)

View File

@@ -3,7 +3,9 @@
#if __XC__
#ifndef NO_USB
#include "dfu_interface.h"
#endif
typedef interface audManage_if
{

View File

@@ -2,7 +2,7 @@
* @brief Implements relevant requests from the USB Audio 2.0 Specification
* @author Ross Owen, XMOS Semiconductor
*/
#ifndef NO_USB
#include <xs1.h>
#include "xud.h"
#include "usb_std_requests.h"
@@ -1282,4 +1282,4 @@ XUD_Result_t AudioClassRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket
return XUD_RES_ERR;
}
#endif
#endif /* NO_USB */

View File

@@ -7,6 +7,7 @@
#include <safestring.h>
#include <stddef.h>
#ifndef NO_USB
#include "xud.h" /* XUD user defines and functions */
#include "usb_std_requests.h"
#include "usbaudio20.h" /* Defines from USB Audio 2.0 spec */
@@ -801,3 +802,4 @@ void Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
}
}
}
#endif /* NO_USB */

View File

@@ -1,4 +1,4 @@
#ifndef NO_USB
#include "xud.h"
#include "vendorrequests.h"
@@ -31,3 +31,4 @@ void VendorRequests_Init(VENDOR_REQUESTS_PARAMS_DEC)
}
#endif /* NO_USB */

View File

@@ -1,8 +1,6 @@
#ifdef DFU
#include "devicedefines.h"
#include "uac_hwresources.h"
#ifdef DFU
#include <xs1.h>
#include <xclib.h>
#ifdef QUAD_SPI_FLASH

View File

@@ -12,11 +12,13 @@
#include <xscope.h>
#endif
#ifndef NO_USB
#include "xud.h" /* XMOS USB Device Layer defines and functions */
#include "endpoint0.h"
#endif
#include "devicedefines.h" /* Device specific defines */
#include "uac_hwresources.h"
#include "endpoint0.h"
#include "usb_buffer.h"
#include "decouple.h"
#ifdef MIDI
@@ -48,8 +50,10 @@
#include "xua_pdm_mic.h"
#endif
#ifdef DFU
[[distributable]]
void DFUHandler(server interface i_dfu i, chanend ?c_user_cmd);
#endif
/* Audio I/O - Port declarations */
#if I2S_WIRES_DAC > 0
@@ -209,7 +213,7 @@ on tile [IAP_TILE] : struct r_i2c r_i2c = {PORT_I2C_SCL, PORT_I2C_SDA};
#endif
#endif
#ifndef NO_USB
/* Endpoint type tables for XUD */
XUD_EpType epTypeTableOut[ENDPOINT_COUNT_OUT] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE,
XUD_EPTYPE_ISO, /* Audio */
@@ -249,7 +253,7 @@ XUD_EpType epTypeTableIn[ENDPOINT_COUNT_IN] = { XUD_EPTYPE_CTL | XUD_STATUS_ENAB
#endif
#endif
};
#endif /* NO_USB */
void thread_speed()
{
@@ -270,6 +274,7 @@ void xscope_user_init()
}
#endif
#ifndef NO_USB
/* Core USB Audio functions - must be called on the Tile connected to the USB Phy */
void usb_audio_core(chanend c_mix_out
#ifdef MIDI
@@ -402,6 +407,7 @@ VENDOR_REQUESTS_PARAMS_DEC_
//:
}
}
#endif /* NO_USB */
void usb_audio_io(chanend c_aud_in, chanend ?c_adc,
#if defined(SPDIF_TX) && (SPDIF_TX_TILE != AUDIO_IO_TILE)

View File

@@ -2,11 +2,12 @@
#include <platform.h>
#include <xs1_su.h>
#include "xud.h"
#define XS1_SU_PERIPH_USB_ID 0x1
#if (XUD_SERIES_SUPPORT == XUD_X200_SERIES)
//Normally we would enumerate the XUD_SERIES_SUPPORT possibilities using defines in
//xud.h but we have hard coded them to remove dependancy of sc_xud
#if (XUD_SERIES_SUPPORT == 4)
#include "xs2_su_registers.h"
#define XS2_SU_PERIPH_USB_ID 0x1
#define PLL_MASK 0x7FFFFFFF
@@ -21,7 +22,7 @@ extern tileref tile[];
void device_reboot_aux(void)
{
#if (XUD_SERIES_SUPPORT == XUD_U_SERIES)
#if (XUD_SERIES_SUPPORT == 1)
/* Disconnect from bus */
unsigned data[] = {4};
write_periph_32(usb_tile, XS1_SU_PERIPH_USB_ID, XS1_SU_PER_UIFM_FUNC_CONTROL_NUM, 1, data);
@@ -35,7 +36,7 @@ void device_reboot_aux(void)
unsigned int tileId;
unsigned int tileArrayLength;
#if (XUD_SERIES_SUPPORT == XUD_X200_SERIES)
#if (XUD_SERIES_SUPPORT == 4)
/* Disconnect from bus */
unsigned data[] = {4};
write_periph_32(usb_tile, XS2_SU_PERIPH_USB_ID, XS1_GLX_PER_UIFM_FUNC_CONTROL_NUM, 1, data);

View File

@@ -2,7 +2,9 @@
#ifndef _UAC_HWRESOURCES_H_
#define _UAC_HWRESOURCES_H_
#ifndef NO_USB
#include "xud.h" /* XMOS USB Device Layer defines and functions */
#endif
#if ((XUD_SERIES_SUPPORT != XUD_U_SERIES) && (XUD_SERIES_SUPPORT != XUD_X200_SERIES))

View File

@@ -1,3 +1,4 @@
#ifndef NO_USB
#include <xs1.h>
#include "xc_ptr.h"
#include "devicedefines.h"
@@ -1019,4 +1020,4 @@ void decouple(chanend c_mix_out
#endif /* NUM_USB_CHAN_IN > 0 */
}
}
#endif /* NO_USB */

View File

@@ -1,3 +1,5 @@
#ifndef NO_USB
#include <interrupt.h>
register_interrupt_handler(handle_audio_request, 1, 200)
#endif

View File

@@ -1,3 +1,4 @@
#ifndef NO_USB
#include "xud.h"
extern XUD_BusSpeed_t g_curUsbSpeed;
@@ -48,3 +49,5 @@ void GetADCCounts(unsigned samFreq, int *min, int *mid, int *max)
}
}
#endif /* NO_USB */

View File

@@ -1,4 +1,4 @@
#ifndef NO_USB
#include <xs1.h>
#include <print.h>
@@ -957,3 +957,4 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in,
}
}
#endif /* NO_USB */

View File

@@ -1,4 +1,4 @@
#ifndef NO_USB
#include "devicedefines.h"
#include "hostactive.h"
#include "audiostream.h"
@@ -22,3 +22,4 @@ void XUD_UserResume(void)
UserHostActive(1);
}
}
#endif /* NO_USB */