forked from PAWPAW-Mirror/lib_xua
Endpoint numbers now in an enum. Removed old INTERFACES defines - were used to generate EP count.
This commit is contained in:
@@ -575,99 +575,80 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DFU) && DFU != 0
|
/* Audio input USB interface count */
|
||||||
#define DFU_INTERFACES (1) /* DFU interface count */
|
#if defined(INPUT) && (INTPUT != 0)
|
||||||
#else
|
|
||||||
#define DFU_INTERFACES (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef INPUT
|
|
||||||
#define INPUT_INTERFACES (1)
|
#define INPUT_INTERFACES (1)
|
||||||
#else
|
#else
|
||||||
#define INPUT_INTERFACES (0)
|
#define INPUT_INTERFACES (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OUTPUT) && OUTPUT != 0
|
/* Audio output USB interface count */
|
||||||
|
#if defined(OUTPUT) && (OUTPUT != 0)
|
||||||
#define OUTPUT_INTERFACES (1)
|
#define OUTPUT_INTERFACES (1)
|
||||||
#else
|
#else
|
||||||
#define OUTPUT_INTERFACES (0)
|
#define OUTPUT_INTERFACES (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EP_CNT_OUT_AUD (OUTPUT_INTERFACES)
|
/* Total audio USB interface count (+1 for mandatory control interface) */
|
||||||
#define EP_CNT_IN_AUD (OUTPUT_INTERFACES + INPUT_INTERFACES)
|
#define AUDIO_INTERFACE_COUNT (1 + OUTPUT_INTERFACES + INPUT_INTERFACES)
|
||||||
|
|
||||||
|
/* MIDI USB interface count */
|
||||||
#if defined(MIDI)
|
#if defined(MIDI)
|
||||||
#define MIDI_INTERFACES (2)
|
#define MIDI_INTERFACES (2)
|
||||||
#define EP_CNT_OUT_MIDI (1)
|
|
||||||
#define EP_CNT_IN_MIDI (1)
|
|
||||||
#else
|
#else
|
||||||
#define MIDI_INTERFACES (0)
|
#define MIDI_INTERFACES (0)
|
||||||
#define EP_CNT_OUT_MIDI (0)
|
|
||||||
#define EP_CNT_IN_MIDI (0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* iAP USB interface count */
|
||||||
#if defined(IAP)
|
#if defined(IAP)
|
||||||
#define IAP_INTERFACES (1)
|
#define IAP_INTERFACES (1)
|
||||||
#else
|
#else
|
||||||
#define IAP_INTERFACES (0)
|
#define IAP_INTERFACES (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* HID USB interface count */
|
||||||
#if defined(HID_CONTROLS)
|
#if defined(HID_CONTROLS)
|
||||||
#define HID_INTERFACES (1)
|
#define HID_INTERFACES (1)
|
||||||
#else
|
#else
|
||||||
#define HID_INTERFACES (0)
|
#define HID_INTERFACES (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EP_CNT_OUT_IAP (IAP_INTERFACES)
|
/* Endpoint addresses enums */
|
||||||
#ifdef IAP_INT_EP
|
enum USBEndpointNumber_In
|
||||||
#define EP_CNT_IN_IAP (IAP_INTERFACES * 2)
|
{
|
||||||
#else
|
ENDPOINT_NUMBER_IN_CONTROL, /* Endpoint 0 */
|
||||||
#define EP_CNT_IN_IAP (IAP_INTERFACES)
|
ENDPOINT_NUMBER_IN_FEEDBACK,
|
||||||
#endif
|
ENDPOINT_NUMBER_IN_AUDIO,
|
||||||
|
|
||||||
#define EP_CNT_OUT_HID (0)
|
|
||||||
#define EP_CNT_IN_HID (HID_INTERFACES)
|
|
||||||
|
|
||||||
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
#if defined(SPDIF_RX) || defined(ADAT_RX)
|
||||||
#define EP_CNT_IN_AUD_INT (1)
|
ENDPOINT_NUMBER_IN_INTERRUPT, /* Audio interrupt/status EP */
|
||||||
#else
|
|
||||||
#define EP_CNT_IN_AUD_INT (0)
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MIDI
|
||||||
/* Endpoint Number Defines */
|
ENDPOINT_NUMBER_IN_MIDI,
|
||||||
#define EP_NUM_IN_FB (1) /* Always 1 */
|
#endif
|
||||||
#define EP_NUM_IN_AUD (2) /* Always 2 */
|
#ifdef HID_CONTROLS
|
||||||
#define EP_NUM_IN_AUD_INT (EP_NUM_IN_AUD + EP_CNT_IN_AUD_INT) /* Audio interrupt/status EP */
|
ENDPOINT_NUMBER_IN_HID,
|
||||||
#define EP_NUM_IN_MIDI (EP_NUM_IN_AUD_INT + 1)
|
#endif
|
||||||
#define EP_NUM_IN_HID (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + 1)
|
#ifdef IAP
|
||||||
#define EP_NUM_IN_IAP (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + EP_CNT_IN_HID + 1) /* iAP Bulk */
|
|
||||||
#ifdef IAP_INT_EP
|
#ifdef IAP_INT_EP
|
||||||
#define EP_NUM_IN_IAP_INT (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + EP_CNT_IN_HID + 2) /* iAP interrupt */
|
ENDPOINT_NUMBER_IN_IAP_INT,
|
||||||
#endif
|
#endif
|
||||||
|
ENDPOINT_NUMBER_IN_IAP,
|
||||||
#define EP_NUM_OUT_AUD (1) /* Always 1 */
|
|
||||||
#define EP_NUM_OUT_MIDI (2) /* Always 2 */
|
|
||||||
#define EP_NUM_OUT_IAP (EP_NUM_OUT_AUD + EP_CNT_OUT_MIDI + 1)
|
|
||||||
|
|
||||||
/* Endpoint Address Defines */
|
|
||||||
#define EP_ADR_IN_FB (EP_NUM_IN_FB | 0x80)
|
|
||||||
#define EP_ADR_IN_AUD (EP_NUM_IN_AUD | 0x80)
|
|
||||||
#define EP_ADR_IN_AUD_INT (EP_NUM_IN_AUD_INT | 0x80)
|
|
||||||
#define EP_ADR_IN_MIDI (EP_NUM_IN_MIDI | 0x80)
|
|
||||||
#define EP_ADR_IN_HID (EP_NUM_IN_HID | 0x80)
|
|
||||||
#define EP_ADR_IN_IAP (EP_NUM_IN_IAP | 0x80)
|
|
||||||
#ifdef IAP_INT_EP
|
|
||||||
#define EP_ADR_IN_IAP_INT (EP_NUM_IN_IAP_INT | 0x80)
|
|
||||||
#endif
|
#endif
|
||||||
|
ENDPOINT_COUNT_IN /* End marker */
|
||||||
|
};
|
||||||
|
|
||||||
#define EP_ADR_OUT_AUD EP_NUM_OUT_AUD
|
enum USBEndpointNumber_Out
|
||||||
#define EP_ADR_OUT_MIDI EP_NUM_OUT_MIDI
|
{
|
||||||
#define EP_ADR_OUT_IAP EP_NUM_OUT_IAP
|
ENDPOINT_NUMBER_OUT_CONTROL, /* Endpoint 0 */
|
||||||
|
ENDPOINT_NUMBER_OUT_AUDIO,
|
||||||
|
#ifdef MIDI
|
||||||
/* Endpoint count totals */
|
ENDPOINT_NUMBER_OUT_MIDI,
|
||||||
#define EP_CNT_OUT (1 + 1 /*NUM_EP_OUT_AUD*/ + EP_CNT_OUT_MIDI + EP_CNT_OUT_IAP) /* +1 due to EP0 */
|
#endif
|
||||||
#define EP_CNT_IN (1 + 2 /*NUM_EP_IN_AUD*/ + EP_CNT_IN_AUD_INT + EP_CNT_IN_MIDI + EP_CNT_IN_IAP + EP_CNT_IN_HID) /* +1 due to EP0 */
|
#ifdef IAP
|
||||||
|
ENDPOINT_NUMBER_OUT_IAP,
|
||||||
|
#endif
|
||||||
|
ENDPOINT_COUNT_OUT /* End marker */
|
||||||
|
};
|
||||||
|
|
||||||
#define AUDIO_STOP_FOR_DFU (0x12345678)
|
#define AUDIO_STOP_FOR_DFU (0x12345678)
|
||||||
#define AUDIO_START_FROM_DFU (0x87654321)
|
#define AUDIO_START_FROM_DFU (0x87654321)
|
||||||
@@ -694,13 +675,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Total number of USB interfaces this device implements (+1 for required control interface) */
|
|
||||||
//#define NUM_INTERFACES INPUT_INTERFACES + OUTPUT_INTERFACES + DFU_INTERFACES + MIDI_INTERFACES + IAP_INTERFACES + 1 + HID_INTERFACES
|
|
||||||
|
|
||||||
/* Number of interfaces for Audio 1.0 */
|
/* Number of interfaces for Audio 1.0 */
|
||||||
#define NUM_INTERFACES_A1 (1+INPUT_INTERFACES+OUTPUT_INTERFACES)
|
#define NUM_INTERFACES_A1 (1+INPUT_INTERFACES+OUTPUT_INTERFACES)
|
||||||
|
|
||||||
|
|
||||||
/* Audio Unit ID defines */
|
/* Audio Unit ID defines */
|
||||||
#define FU_USBIN 11 /* Feature Unit: USB Audio device -> host */
|
#define FU_USBIN 11 /* Feature Unit: USB Audio device -> host */
|
||||||
#define FU_USBOUT 10 /* Feature Unit: USB Audio host -> device*/
|
#define FU_USBOUT 10 /* Feature Unit: USB Audio host -> device*/
|
||||||
@@ -755,7 +732,6 @@
|
|||||||
#define VOLUME_RES (0x100)
|
#define VOLUME_RES (0x100)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef MIN_MIXER_VOLUME
|
#ifndef MIN_MIXER_VOLUME
|
||||||
/* The minimum volume setting for the mixer unit above -inf.
|
/* The minimum volume setting for the mixer unit above -inf.
|
||||||
This is a signed 8.8 fixed point
|
This is a signed 8.8 fixed point
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
* @author Ross Owen, XMOS Limited
|
* @author Ross Owen, XMOS Limited
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _DEVICE_DESCRIPTORS_
|
#ifndef _DEVICE_DESCRIPTORS_
|
||||||
#define _DEVICE_DESCRIPTORS_
|
#define _DEVICE_DESCRIPTORS_
|
||||||
|
|
||||||
@@ -617,13 +615,35 @@ enum USBInterfaceNumber
|
|||||||
INTERFACE_COUNT /* End marker */
|
INTERFACE_COUNT /* End marker */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Define for number of audio interfaces (+1 for mandatory control interface) */
|
/* Endpoint address defines */
|
||||||
#if defined(OUTPUT) && defined(INPUT)
|
#define ENDPOINT_ADDRESS_IN_CONTROL (ENDPOINT_NUMBER_IN_CONTROL | 0x80)
|
||||||
#define AUDIO_INTERFACE_COUNT 3
|
#define ENDPOINT_ADDRESS_IN_FEEDBACK (ENDPOINT_NUMBER_IN_FEEDBACK | 0x80)
|
||||||
#elif #defined(OUTPUT) || defined(INPUT)
|
#define ENDPOINT_ADDRESS_IN_AUDIO (ENDPOINT_NUMBER_IN_AUDIO | 0x80)
|
||||||
#define AUDIO_INTERFACE_COUNT 2
|
#define ENDPOINT_ADDRESS_IN_INTERRUPT (ENDPOINT_NUMBER_IN_INTERRUPT | 0x80)
|
||||||
#else
|
#define ENDPOINT_ADDRESS_IN_MIDI (ENDPOINT_NUMBER_IN_MIDI | 0x80)
|
||||||
#define AUDIO_INTERFACE_COUNT 1
|
#define ENDPOINT_ADDRESS_IN_HID (ENDPOINT_NUMBER_IN_HID | 0x80)
|
||||||
|
#define ENDPOINT_ADDRESS_IN_IAP_INT (ENDPOINT_NUMBER_IN_IAP_INT | 0x80)
|
||||||
|
#define ENDPOINT_ADDRESS_IN_IAP (ENDPOINT_NUMBER_IN_IAP | 0x80)
|
||||||
|
|
||||||
|
#define ENDPOINT_ADDRESS_OUT_CONTROL (ENDPOINT_NUMBER_OUT_CONTROL)
|
||||||
|
#define ENDPOINT_ADDRESS_OUT_AUDIO (ENDPOINT_NUMBER_OUT_AUDIO)
|
||||||
|
#define ENDPOINT_ADDRESS_OUT_MIDI (ENDPOINT_NUMBER_OUT_MIDI)
|
||||||
|
#define ENDPOINT_ADDRESS_OUT_IAP (ENDPOINT_NUMBER_OUT_IAP)
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#define EP_NUM_IN_FB (1) /* Always 1 */
|
||||||
|
#define EP_NUM_IN_AUD (2) /* Always 2 */
|
||||||
|
#define EP_NUM_IN_AUD_INT (EP_NUM_IN_AUD + EP_CNT_IN_AUD_INT) /* Audio interrupt/status EP */
|
||||||
|
#define EP_NUM_IN_MIDI (EP_NUM_IN_AUD_INT + 1)
|
||||||
|
#define EP_NUM_IN_HID (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + 1)
|
||||||
|
#define EP_NUM_IN_IAP (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + EP_CNT_IN_HID + 1) /* iAP Bulk */
|
||||||
|
#ifdef IAP_INT_EP
|
||||||
|
#define EP_NUM_IN_IAP_INT (EP_NUM_IN_AUD_INT + EP_CNT_IN_MIDI + EP_CNT_IN_HID + 2) /* iAP interrupt */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define EP_NUM_OUT_AUD (1) /* Always 1 */
|
||||||
|
#define EP_NUM_OUT_MIDI (2) /* Always 2 */
|
||||||
|
#define EP_NUM_OUT_IAP (EP_NUM_OUT_AUD + EP_CNT_OUT_MIDI + 1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/***** Device Descriptors *****/
|
/***** Device Descriptors *****/
|
||||||
@@ -1622,7 +1642,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
/* Table B-11: MIDI Adapter Standard Bulk OUT Endpoint Descriptor */
|
/* Table B-11: MIDI Adapter Standard Bulk OUT Endpoint Descriptor */
|
||||||
0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||||
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
||||||
EP_ADR_OUT_MIDI, /* 2 bEndpointAddress : OUT Endpoint 3. (field size 1 bytes) */
|
ENDPOINT_ADDRESS_OUT_MIDI, /* 2 bEndpointAddress : OUT Endpoint 3. (field size 1 bytes) */
|
||||||
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
||||||
0x00, /* 4 wMaxPacketSize : 512 bytes per packet. (field size 2 bytes) - has to be 0x200 for compliance*/
|
0x00, /* 4 wMaxPacketSize : 512 bytes per packet. (field size 2 bytes) - has to be 0x200 for compliance*/
|
||||||
0x02, /* 5 wMaxPacketSize */
|
0x02, /* 5 wMaxPacketSize */
|
||||||
@@ -1640,7 +1660,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
/* Table B-13: MIDI Adapter Standard Bulk IN Endpoint Descriptor */
|
/* Table B-13: MIDI Adapter Standard Bulk IN Endpoint Descriptor */
|
||||||
0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||||
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
||||||
EP_ADR_IN_MIDI, /* 2 bEndpointAddress : IN Endpoint 3. (field size 1 bytes) */
|
ENDPOINT_ADDRESS_IN_MIDI, /* 2 bEndpointAddress : IN Endpoint 3. (field size 1 bytes) */
|
||||||
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
||||||
0x00, /* 4 wMaxPacketSize : 512 bytes per packet. (field size 2 bytes) - has to be 0x200 for compliance*/
|
0x00, /* 4 wMaxPacketSize : 512 bytes per packet. (field size 2 bytes) - has to be 0x200 for compliance*/
|
||||||
0x02, /* 5 wMaxPacketSize */
|
0x02, /* 5 wMaxPacketSize */
|
||||||
@@ -1715,7 +1735,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
{
|
{
|
||||||
0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||||
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
||||||
EP_ADR_OUT_IAP, /* 2 bEndpointAddress : OUT Endpoint 3. High bit isIn (field size 1 bytes) */
|
ENDPOINT_ADDRESS_OUT_IAP, /* 2 bEndpointAddress : OUT Endpoint 3. High bit isIn (field size 1 bytes) */
|
||||||
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
||||||
0x0200, /* 4 wMaxPacketSize : Has to be 0x200 for compliance*/
|
0x0200, /* 4 wMaxPacketSize : Has to be 0x200 for compliance*/
|
||||||
0x00, /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */
|
0x00, /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */
|
||||||
@@ -1726,7 +1746,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
{
|
{
|
||||||
0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||||
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
||||||
EP_ADR_IN_IAP, /* 2 bEndpointAddress : IN Endpoint 5. (field size 1 bytes) */
|
ENDPOINT_ADDRESS_IN_IAP, /* 2 bEndpointAddress : IN Endpoint 5. (field size 1 bytes) */
|
||||||
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
||||||
0x0200, /* 4 wMaxPacketSize : Has to be 0x200 for compliance*/
|
0x0200, /* 4 wMaxPacketSize : Has to be 0x200 for compliance*/
|
||||||
0x00, /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */
|
0x00, /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */
|
||||||
@@ -1738,7 +1758,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
{
|
{
|
||||||
0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||||
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
||||||
EP_ADR_IN_IAP_INT, /* 2 bEndpointAddress : IN Endpoint 6. (field size 1 bytes) */
|
ENDPOINT_ADDRESS_IN_IAP_INT, /* 2 bEndpointAddress : IN Endpoint 6. (field size 1 bytes) */
|
||||||
0x03, /* 3 bmAttributes : Interrupt, not shared. (field size 1 bytes) */
|
0x03, /* 3 bmAttributes : Interrupt, not shared. (field size 1 bytes) */
|
||||||
0x0040, /* 4 wMaxPacketSize : 64 bytes per packet. (field size 2 bytes) - has to be 0x40 for compliance*/
|
0x0040, /* 4 wMaxPacketSize : 64 bytes per packet. (field size 2 bytes) - has to be 0x40 for compliance*/
|
||||||
0x08, /* 6 bInterval : (2^(bInterval-1))/8 ms. Must be between 4 and 32ms (field size 1 bytes) */
|
0x08, /* 6 bInterval : (2^(bInterval-1))/8 ms. Must be between 4 and 32ms (field size 1 bytes) */
|
||||||
@@ -1773,14 +1793,11 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
/* Endpoint descriptor (IN) */
|
/* Endpoint descriptor (IN) */
|
||||||
0x7, /* 0 bLength */
|
0x7, /* 0 bLength */
|
||||||
5, /* 1 bDescriptorType */
|
5, /* 1 bDescriptorType */
|
||||||
EP_ADR_IN_HID, /* 2 bEndpointAddress */
|
ENDPOINT_ADDRESS_IN_HID, /* 2 bEndpointAddress */
|
||||||
3, /* 3 bmAttributes (INTERRUPT) */
|
3, /* 3 bmAttributes (INTERRUPT) */
|
||||||
64, /* 4 wMaxPacketSize */
|
64, /* 4 wMaxPacketSize */
|
||||||
8, /* 6 bInterval */
|
8, /* 6 bInterval */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ on tile [IAP_TILE] : struct r_i2c r_i2c = {PORT_I2C_SCL, PORT_I2C_SDA};
|
|||||||
|
|
||||||
|
|
||||||
/* Endpoint type tables for XUD */
|
/* Endpoint type tables for XUD */
|
||||||
XUD_EpType epTypeTableOut[EP_CNT_OUT] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE,
|
XUD_EpType epTypeTableOut[ENDPOINT_COUNT_OUT] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE,
|
||||||
XUD_EPTYPE_ISO, /* Audio */
|
XUD_EPTYPE_ISO, /* Audio */
|
||||||
#ifdef MIDI
|
#ifdef MIDI
|
||||||
XUD_EPTYPE_BUL, /* MIDI */
|
XUD_EPTYPE_BUL, /* MIDI */
|
||||||
@@ -184,7 +184,7 @@ XUD_EpType epTypeTableOut[EP_CNT_OUT] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE,
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
XUD_EpType epTypeTableIn[EP_CNT_IN] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE,
|
XUD_EpType epTypeTableIn[ENDPOINT_COUNT_IN] = { XUD_EPTYPE_CTL | XUD_STATUS_ENABLE,
|
||||||
XUD_EPTYPE_ISO,
|
XUD_EPTYPE_ISO,
|
||||||
XUD_EPTYPE_ISO,
|
XUD_EPTYPE_ISO,
|
||||||
#if defined (SPDIF_RX) || defined (ADAT_RX)
|
#if defined (SPDIF_RX) || defined (ADAT_RX)
|
||||||
@@ -244,8 +244,8 @@ void usb_audio_core(chanend c_mix_out
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
chan c_sof;
|
chan c_sof;
|
||||||
chan c_xud_out[EP_CNT_OUT]; /* Endpoint channels for XUD */
|
chan c_xud_out[ENDPOINT_COUNT_OUT]; /* Endpoint channels for XUD */
|
||||||
chan c_xud_in[EP_CNT_IN];
|
chan c_xud_in[ENDPOINT_COUNT_IN];
|
||||||
chan c_aud_ctl;
|
chan c_aud_ctl;
|
||||||
#ifdef TEST_MODE_SUPPORT
|
#ifdef TEST_MODE_SUPPORT
|
||||||
#warning Building with test mode support
|
#warning Building with test mode support
|
||||||
@@ -266,11 +266,11 @@ void usb_audio_core(chanend c_mix_out
|
|||||||
{
|
{
|
||||||
/* USB Interface Core */
|
/* USB Interface Core */
|
||||||
#if (AUDIO_CLASS==2)
|
#if (AUDIO_CLASS==2)
|
||||||
XUD_Manager(c_xud_out, EP_CNT_OUT, c_xud_in, EP_CNT_IN,
|
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
|
||||||
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
|
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
|
||||||
clk, 1, XUD_SPEED_HS, c_usb_test, pwrConfig);
|
clk, 1, XUD_SPEED_HS, c_usb_test, pwrConfig);
|
||||||
#else
|
#else
|
||||||
XUD_Manager(c_xud_out, EP_CNT_OUT, c_xud_in, EP_CNT_IN,
|
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
|
||||||
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
|
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
|
||||||
clk, 1, XUD_SPEED_FS, c_usb_test, pwrConfig);
|
clk, 1, XUD_SPEED_FS, c_usb_test, pwrConfig);
|
||||||
#endif
|
#endif
|
||||||
@@ -291,29 +291,29 @@ void usb_audio_core(chanend c_mix_out
|
|||||||
asm("ldw %0, dp[clk_audio_mclk]":"=r"(x));
|
asm("ldw %0, dp[clk_audio_mclk]":"=r"(x));
|
||||||
asm("setclk res[%0], %1"::"r"(p_for_mclk_count), "r"(x));
|
asm("setclk res[%0], %1"::"r"(p_for_mclk_count), "r"(x));
|
||||||
#endif
|
#endif
|
||||||
buffer(c_xud_out[EP_NUM_OUT_AUD],/* Audio Out*/
|
buffer(c_xud_out[ENDPOINT_NUMBER_OUT_AUDIO],/* Audio Out*/
|
||||||
c_xud_in[EP_NUM_IN_AUD], /* Audio In */
|
c_xud_in[ENDPOINT_NUMBER_IN_AUDIO], /* Audio In */
|
||||||
c_xud_in[EP_NUM_IN_FB], /* Audio FB */
|
c_xud_in[ENDPOINT_NUMBER_IN_FEEDBACK], /* Audio FB */
|
||||||
#ifdef MIDI
|
#ifdef MIDI
|
||||||
c_xud_out[EP_NUM_OUT_MIDI], /* MIDI Out */ // 2
|
c_xud_out[ENDPOINT_NUMBER_OUT_MIDI], /* MIDI Out */ // 2
|
||||||
c_xud_in[EP_NUM_IN_MIDI], /* MIDI In */ // 4
|
c_xud_in[ENDPOINT_NUMBER_IN_MIDI], /* MIDI In */ // 4
|
||||||
c_midi,
|
c_midi,
|
||||||
#endif
|
#endif
|
||||||
#ifdef IAP
|
#ifdef IAP
|
||||||
c_xud_out[EP_NUM_OUT_IAP], /* iAP Out */
|
c_xud_out[ENDPOINT_NUMBER_OUT_IAP], /* iAP Out */
|
||||||
c_xud_in[EP_NUM_IN_IAP], /* iAP In */
|
c_xud_in[ENDPOINT_NUMBER_IN_IAP], /* iAP In */
|
||||||
#ifdef IAP_INT_EP
|
#ifdef IAP_INT_EP
|
||||||
c_xud_in[EP_NUM_IN_IAP_INT], /* iAP Interrupt In */
|
c_xud_in[ENDPOINT_NUMBER_IN_IAP_INT], /* iAP Interrupt In */
|
||||||
#endif
|
#endif
|
||||||
c_iap,
|
c_iap,
|
||||||
#endif
|
#endif
|
||||||
#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[EP_NUM_IN_AUD_INT],
|
c_xud_in[ENDPOINT_NUMBER_IN_INTERUUPT],
|
||||||
#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
|
||||||
, c_xud_in[EP_NUM_IN_HID]
|
, c_xud_in[ENDPOINT_NUMBER_IN_HID]
|
||||||
#endif
|
#endif
|
||||||
#ifdef CHAN_BUFF_CTRL
|
#ifdef CHAN_BUFF_CTRL
|
||||||
, c_buff_ctrl
|
, c_buff_ctrl
|
||||||
|
|||||||
Reference in New Issue
Block a user