forked from PAWPAW-Mirror/lib_xua
Removal of historical OUTPUT and INPUT usage. NUM_USB_CHAN_ used instead.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file DeviceDescriptors.h
|
* @file descriptors.h
|
||||||
* @brief Device Descriptors
|
* @brief Device Descriptors
|
||||||
* @author Ross Owen, XMOS Limited
|
* @author Ross Owen, XMOS Limited
|
||||||
*/
|
*/
|
||||||
@@ -593,10 +593,10 @@ StringDescTable_t g_strTable =
|
|||||||
enum USBInterfaceNumber
|
enum USBInterfaceNumber
|
||||||
{
|
{
|
||||||
INTERFACE_NUMBER_AUDIO_CONTROL = 0,
|
INTERFACE_NUMBER_AUDIO_CONTROL = 0,
|
||||||
#if defined(OUTPUT) && (OUTPUT != 0)
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
INTERFACE_NUMBER_AUDIO_OUTPUT,
|
INTERFACE_NUMBER_AUDIO_OUTPUT,
|
||||||
#endif
|
#endif
|
||||||
#if defined(INPUT) && (INPUT != 0)
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
INTERFACE_NUMBER_AUDIO_INPUT,
|
INTERFACE_NUMBER_AUDIO_INPUT,
|
||||||
#endif
|
#endif
|
||||||
#if defined(MIDI) && (MIDI != 0)
|
#if defined(MIDI) && (MIDI != 0)
|
||||||
@@ -615,9 +615,9 @@ enum USBInterfaceNumber
|
|||||||
INTERFACE_COUNT /* End marker */
|
INTERFACE_COUNT /* End marker */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(INPUT) && defined(OUTPUT)
|
#if (NUM_USB_CHAN_IN > 0) && (NUM_USB_CHAN_OUT > 0)
|
||||||
#define AUDIO_INTERFACE_COUNT 3
|
#define AUDIO_INTERFACE_COUNT 3
|
||||||
#elif defined(INPUT) || defined(OUTPUT)
|
#elif (NUM_USB_CHAN_IN > 0) || (NUM_USB_CHAN_OUT > 0)
|
||||||
#define AUDIO_INTERFACE_COUNT 2
|
#define AUDIO_INTERFACE_COUNT 2
|
||||||
#else
|
#else
|
||||||
#define AUDIO_INTERFACE_COUNT 1
|
#define AUDIO_INTERFACE_COUNT 1
|
||||||
@@ -837,7 +837,7 @@ typedef struct
|
|||||||
USB_Descriptor_Audio_ClockSource_t Audio_ClockSource_ADAT;
|
USB_Descriptor_Audio_ClockSource_t Audio_ClockSource_ADAT;
|
||||||
#endif
|
#endif
|
||||||
USB_Descriptor_Audio_ClockSelector_t Audio_ClockSelector;
|
USB_Descriptor_Audio_ClockSelector_t Audio_ClockSelector;
|
||||||
#ifdef OUTPUT
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
/* Output path */
|
/* Output path */
|
||||||
USB_Descriptor_Audio_InputTerminal_t Audio_Out_InputTerminal;
|
USB_Descriptor_Audio_InputTerminal_t Audio_Out_InputTerminal;
|
||||||
#if(OUTPUT_VOLUME_CONTROL == 1)
|
#if(OUTPUT_VOLUME_CONTROL == 1)
|
||||||
@@ -845,7 +845,7 @@ typedef struct
|
|||||||
#endif
|
#endif
|
||||||
USB_Descriptor_Audio_OutputTerminal_t Audio_Out_OutputTerminal;
|
USB_Descriptor_Audio_OutputTerminal_t Audio_Out_OutputTerminal;
|
||||||
#endif
|
#endif
|
||||||
#ifdef INPUT
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
/* Input path */
|
/* Input path */
|
||||||
USB_Descriptor_Audio_InputTerminal_t Audio_In_InputTerminal;
|
USB_Descriptor_Audio_InputTerminal_t Audio_In_InputTerminal;
|
||||||
#if(INPUT_VOLUME_CONTROL == 1)
|
#if(INPUT_VOLUME_CONTROL == 1)
|
||||||
@@ -865,7 +865,7 @@ typedef struct
|
|||||||
USB_Descriptor_Interface_t Audio_StdControlInterface; /* Standard Audio Control Interface Header Descriptor */
|
USB_Descriptor_Interface_t Audio_StdControlInterface; /* Standard Audio Control Interface Header Descriptor */
|
||||||
|
|
||||||
USB_CfgDesc_Audio2_CS_Control_Int Audio_CS_Control_Int;
|
USB_CfgDesc_Audio2_CS_Control_Int Audio_CS_Control_Int;
|
||||||
#ifdef OUTPUT
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
/* Audio streaming: Output stream */
|
/* Audio streaming: Output stream */
|
||||||
USB_Descriptor_Interface_t Audio_Out_StreamInterface_Alt0; /* Zero bandwith alternative */
|
USB_Descriptor_Interface_t Audio_Out_StreamInterface_Alt0; /* Zero bandwith alternative */
|
||||||
USB_Descriptor_Interface_t Audio_Out_StreamInterface_Alt1;
|
USB_Descriptor_Interface_t Audio_Out_StreamInterface_Alt1;
|
||||||
@@ -891,7 +891,7 @@ typedef struct
|
|||||||
USB_Descriptor_Endpoint_t Audio_Out_Fb_Endpoint_3;
|
USB_Descriptor_Endpoint_t Audio_Out_Fb_Endpoint_3;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef INPUT
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
/* Audio Streaming: Input stream */
|
/* Audio Streaming: Input stream */
|
||||||
USB_Descriptor_Interface_t Audio_In_StreamInterface_Alt0; /* Zero bandwith alternative */
|
USB_Descriptor_Interface_t Audio_In_StreamInterface_Alt0; /* Zero bandwith alternative */
|
||||||
USB_Descriptor_Interface_t Audio_In_StreamInterface_Alt1;
|
USB_Descriptor_Interface_t Audio_In_StreamInterface_Alt1;
|
||||||
@@ -1082,7 +1082,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
.iClockSelector = 13, /* TODO Shoudn't be hard-coded */
|
.iClockSelector = 13, /* TODO Shoudn't be hard-coded */
|
||||||
},
|
},
|
||||||
|
|
||||||
#ifdef OUTPUT
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
/* Input Terminal Descriptor (USB Input Terminal) */
|
/* Input Terminal Descriptor (USB Input Terminal) */
|
||||||
.Audio_Out_InputTerminal =
|
.Audio_Out_InputTerminal =
|
||||||
{
|
{
|
||||||
@@ -1196,7 +1196,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
0, /* 11 iTerminal */
|
0, /* 11 iTerminal */
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
#ifdef INPUT
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
/* Input Terminal Descriptor (Analogue Input Terminal) */
|
/* Input Terminal Descriptor (Analogue Input Terminal) */
|
||||||
.Audio_In_InputTerminal =
|
.Audio_In_InputTerminal =
|
||||||
{
|
{
|
||||||
@@ -1312,7 +1312,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
#endif
|
#endif
|
||||||
}, /* End of .Audio_CS_Control_Int */
|
}, /* End of .Audio_CS_Control_Int */
|
||||||
|
|
||||||
#ifdef OUTPUT
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
/* Zero bandwith alternative 0 */
|
/* Zero bandwith alternative 0 */
|
||||||
/* Standard AS Interface Descriptor (4.9.1) */
|
/* Standard AS Interface Descriptor (4.9.1) */
|
||||||
.Audio_Out_StreamInterface_Alt0 =
|
.Audio_Out_StreamInterface_Alt0 =
|
||||||
@@ -1549,7 +1549,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
},
|
},
|
||||||
#endif /* OUTPUT_FORMAT_COUNT > 2 */
|
#endif /* OUTPUT_FORMAT_COUNT > 2 */
|
||||||
#endif /* OUTPUT */
|
#endif /* OUTPUT */
|
||||||
#ifdef INPUT
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
|
|
||||||
/* Zero bandwith alternative 0 */
|
/* Zero bandwith alternative 0 */
|
||||||
/* Standard AS Interface Descriptor (4.9.1) */
|
/* Standard AS Interface Descriptor (4.9.1) */
|
||||||
@@ -1908,13 +1908,13 @@ unsigned char cfgDesc_Null[] =
|
|||||||
#if defined (AUDIO_CLASS_FALLBACK) || (AUDIO_CLASS == 1)
|
#if defined (AUDIO_CLASS_FALLBACK) || (AUDIO_CLASS == 1)
|
||||||
/* Configuration descriptor for Audio v1.0 */
|
/* Configuration descriptor for Audio v1.0 */
|
||||||
/* Note Audio 1.0 descriptors still a simple array so we need some extra defines regarding lengths.. */
|
/* Note Audio 1.0 descriptors still a simple array so we need some extra defines regarding lengths.. */
|
||||||
#ifdef INPUT
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
#define INPUT_INTERFACES_A1 (1)
|
#define INPUT_INTERFACES_A1 (1)
|
||||||
#else
|
#else
|
||||||
#define INPUT_INTERFACES_A1 (0)
|
#define INPUT_INTERFACES_A1 (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OUTPUT
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
#define OUTPUT_INTERFACES_A1 (1)
|
#define OUTPUT_INTERFACES_A1 (1)
|
||||||
#else
|
#else
|
||||||
#define OUTPUT_INTERFACES_A1 (0)
|
#define OUTPUT_INTERFACES_A1 (0)
|
||||||
@@ -1980,14 +1980,14 @@ unsigned char cfgDesc_Audio1[] =
|
|||||||
(AC_TOTAL_LENGTH & 0xFF), /* wTotallength (Combined length of this descriptor and all Unit and Terminal Descriptors) */
|
(AC_TOTAL_LENGTH & 0xFF), /* wTotallength (Combined length of this descriptor and all Unit and Terminal Descriptors) */
|
||||||
(AC_TOTAL_LENGTH >> 8), /* wTotalLength */
|
(AC_TOTAL_LENGTH >> 8), /* wTotalLength */
|
||||||
STREAMING_INTERFACES, /* Num streaming interfaces */
|
STREAMING_INTERFACES, /* Num streaming interfaces */
|
||||||
#ifdef OUTPUT
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
0x01, /* AudioStreaming interface 1 belongs to AC interface */
|
0x01, /* AudioStreaming interface 1 belongs to AC interface */
|
||||||
#endif
|
#endif
|
||||||
#ifdef INPUT
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
(OUTPUT_INTERFACES_A1 + 1), /* AudioStreaming interface 2 belongs to AC interface */
|
(OUTPUT_INTERFACES_A1 + 1), /* AudioStreaming interface 2 belongs to AC interface */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OUTPUT
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
/* CS_Interface Input Terminal 1 Descriptor - USB streaming Host to Device */
|
/* CS_Interface Input Terminal 1 Descriptor - USB streaming Host to Device */
|
||||||
0x0C,
|
0x0C,
|
||||||
UAC_CS_DESCTYPE_INTERFACE, /* UAC_CS_DESCTYPE_INTERFACE */
|
UAC_CS_DESCTYPE_INTERFACE, /* UAC_CS_DESCTYPE_INTERFACE */
|
||||||
@@ -2021,10 +2021,9 @@ unsigned char cfgDesc_Audio1[] =
|
|||||||
0x00, /* Associated terminal - unused */
|
0x00, /* Associated terminal - unused */
|
||||||
0x0A, /* sourceID */
|
0x0A, /* sourceID */
|
||||||
0x00, /* Unused */
|
0x00, /* Unused */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef INPUT
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
/* CS_Interface Input Terminal 2 Descriptor - Analog in from line in */
|
/* CS_Interface Input Terminal 2 Descriptor - Analog in from line in */
|
||||||
0x0C,
|
0x0C,
|
||||||
UAC_CS_DESCTYPE_INTERFACE,
|
UAC_CS_DESCTYPE_INTERFACE,
|
||||||
@@ -2060,7 +2059,7 @@ unsigned char cfgDesc_Audio1[] =
|
|||||||
0x00, /* String table index */
|
0x00, /* String table index */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OUTPUT
|
#if (NUM_USB_CHAN_OUT > 0)
|
||||||
/* Standard AS Interface Descriptor (4.5.1) */
|
/* Standard AS Interface Descriptor (4.5.1) */
|
||||||
0x09, /* bLength */
|
0x09, /* bLength */
|
||||||
0x04, /* INTERFACE */
|
0x04, /* INTERFACE */
|
||||||
@@ -2142,7 +2141,7 @@ unsigned char cfgDesc_Audio1[] =
|
|||||||
0x0, /* bSynchAddress */
|
0x0, /* bSynchAddress */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef INPUT
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
/* Standard Interface Descriptor - Audio streaming IN */
|
/* Standard Interface Descriptor - Audio streaming IN */
|
||||||
0x09,
|
0x09,
|
||||||
0x04, /* INTERFACE */
|
0x04, /* INTERFACE */
|
||||||
|
|||||||
Reference in New Issue
Block a user