forked from PAWPAW-Mirror/lib_xua
Added iAP EA Native Transport interface and EPs
This commit is contained in:
@@ -12,6 +12,19 @@
|
||||
#include "usbaudiocommon.h"
|
||||
#include "usb_std_descriptors.h"
|
||||
|
||||
#ifdef IAP_EA_NATIVE
|
||||
/*
|
||||
* FIXME currently this will not build if IAP_EA_NATIVE_PROTOCOL_NAME is not defined in iap_conf.h,
|
||||
* would be nice if a default string was used instead, and a warning issued.
|
||||
*
|
||||
* Could get a default define by including the following line, but iap2.h cannot currently be included from C
|
||||
*/
|
||||
//#include "iap2.h" /* Defines iAP EA Native Transport protocol name */
|
||||
#ifdef __iap_conf_h_exists__
|
||||
#include "iap_conf.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define APPEND_VENDOR_STR(x) VENDOR_STR" "#x
|
||||
|
||||
#define APPEND_PRODUCT_STR_A2(x) PRODUCT_STR_A2 " "#x
|
||||
@@ -172,6 +185,7 @@ typedef struct
|
||||
#error NUM_USB_CHAN > 18
|
||||
#endif
|
||||
STR_TABLE_ENTRY(iAPInterfaceStr);
|
||||
STR_TABLE_ENTRY(iAP_EANative_InterfaceStr);
|
||||
} StringDescTable_t;
|
||||
|
||||
StringDescTable_t g_strTable =
|
||||
@@ -587,6 +601,7 @@ StringDescTable_t g_strTable =
|
||||
#error NUM_USB_CHAN > 18
|
||||
#endif
|
||||
.iAPInterfaceStr = "iAP Interface",
|
||||
.iAP_EANative_InterfaceStr = IAP_EA_NATIVE_PROTOCOL_NAME,
|
||||
|
||||
};
|
||||
|
||||
@@ -609,6 +624,9 @@ enum USBInterfaceNumber
|
||||
#endif
|
||||
#if defined(IAP) && (IAP != 0)
|
||||
INTERFACE_NUMBER_IAP,
|
||||
#if defined(IAP_EA_NATIVE) && (IAP_EA_NATIVE != 0)
|
||||
INTERFACE_NUMBER_IAP_EA_NATIVE,
|
||||
#endif
|
||||
#endif
|
||||
#if defined(HID_CONTROLS) && (HID_CONTROLS != 0)
|
||||
INTERFACE_NUMBER_HID,
|
||||
@@ -625,19 +643,21 @@ enum USBInterfaceNumber
|
||||
#endif
|
||||
|
||||
/* Endpoint address defines */
|
||||
#define ENDPOINT_ADDRESS_IN_CONTROL (ENDPOINT_NUMBER_IN_CONTROL | 0x80)
|
||||
#define ENDPOINT_ADDRESS_IN_FEEDBACK (ENDPOINT_NUMBER_IN_FEEDBACK | 0x80)
|
||||
#define ENDPOINT_ADDRESS_IN_AUDIO (ENDPOINT_NUMBER_IN_AUDIO | 0x80)
|
||||
#define ENDPOINT_ADDRESS_IN_INTERRUPT (ENDPOINT_NUMBER_IN_INTERRUPT | 0x80)
|
||||
#define ENDPOINT_ADDRESS_IN_MIDI (ENDPOINT_NUMBER_IN_MIDI | 0x80)
|
||||
#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_IN_CONTROL (ENDPOINT_NUMBER_IN_CONTROL | 0x80)
|
||||
#define ENDPOINT_ADDRESS_IN_FEEDBACK (ENDPOINT_NUMBER_IN_FEEDBACK | 0x80)
|
||||
#define ENDPOINT_ADDRESS_IN_AUDIO (ENDPOINT_NUMBER_IN_AUDIO | 0x80)
|
||||
#define ENDPOINT_ADDRESS_IN_INTERRUPT (ENDPOINT_NUMBER_IN_INTERRUPT | 0x80)
|
||||
#define ENDPOINT_ADDRESS_IN_MIDI (ENDPOINT_NUMBER_IN_MIDI | 0x80)
|
||||
#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_IN_IAP_EA_NATIVE (ENDPOINT_NUMBER_IN_IAP_EA_NATIVE | 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)
|
||||
#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)
|
||||
#define ENDPOINT_ADDRESS_OUT_IAP_EA_NATIVE (ENDPOINT_NUMBER_OUT_IAP_EA_NATIVE)
|
||||
|
||||
/***** Device Descriptors *****/
|
||||
|
||||
@@ -919,6 +939,12 @@ typedef struct
|
||||
#ifdef IAP_INT_EP
|
||||
USB_Descriptor_Endpoint_t iAP_Interrupt_Endpoint;
|
||||
#endif
|
||||
#ifdef IAP_EA_NATIVE
|
||||
USB_Descriptor_Interface_t iAP_EANativeTransport_Interface_Alt0;
|
||||
USB_Descriptor_Interface_t iAP_EANativeTransport_Interface_Alt1;
|
||||
USB_Descriptor_Endpoint_t iAP_EANatvieTransport_Out_Endpoint;
|
||||
USB_Descriptor_Endpoint_t iAP_EANativeTransport_In_Endpoint;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HID_CONTROLS
|
||||
@@ -1839,6 +1865,59 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
||||
0x08, /* 6 bInterval : (2^(bInterval-1))/8 ms. Must be between 4 and 32ms (field size 1 bytes) */
|
||||
},
|
||||
#endif
|
||||
#ifdef IAP_EA_NATIVE
|
||||
/* Zero bandwidth alternative 0 */
|
||||
/* iAP EA Native Transport Interface descriptor */
|
||||
.iAP_EANativeTransport_Interface_Alt0 =
|
||||
{
|
||||
.bLength = sizeof(USB_Descriptor_Interface_t),
|
||||
.bDescriptorType = USB_DESCTYPE_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NUMBER_IAP_EA_NATIVE,
|
||||
.bAlternateSetting = 0x00,
|
||||
.bNumEndpoints = 0x00,
|
||||
.bInterfaceClass = USB_CLASS_VENDOR_SPECIFIC,
|
||||
.bInterfaceSubClass = 0xF0, /* MFI Accessory (Table 21-2) */
|
||||
.bInterfaceProtocol = 0x01,
|
||||
.iInterface = offsetof(StringDescTable_t, iAP_EANative_InterfaceStr)/sizeof(char *),
|
||||
},
|
||||
|
||||
/* Alternative 1 */
|
||||
/* iAP EA Native Transport Interface descriptor */
|
||||
.iAP_EANativeTransport_Interface_Alt1 =
|
||||
{
|
||||
.bLength = sizeof(USB_Descriptor_Interface_t),
|
||||
.bDescriptorType = USB_DESCTYPE_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NUMBER_IAP_EA_NATIVE,
|
||||
.bAlternateSetting = 0x01,
|
||||
.bNumEndpoints = 0x02,
|
||||
.bInterfaceClass = USB_CLASS_VENDOR_SPECIFIC,
|
||||
.bInterfaceSubClass = 0xF0, /* MFI Accessory (Table 21-1) */
|
||||
.bInterfaceProtocol = 0x01,
|
||||
.iInterface = offsetof(StringDescTable_t, iAP_EANative_InterfaceStr)/sizeof(char *),
|
||||
},
|
||||
|
||||
/* iAP EA Native Transport Bulk OUT Endpoint Descriptor */
|
||||
.iAP_Out_Endpoint =
|
||||
{
|
||||
0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
||||
ENDPOINT_ADDRESS_OUT_IAP_EA_NATIVE, /* 2 bEndpointAddress : OUT Endpoint 3. High bit isIn (field size 1 bytes) */
|
||||
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
||||
0x0200, //TODO check this /* 4 wMaxPacketSize : Has to be 0x200 for compliance*/
|
||||
0x00, /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */
|
||||
},
|
||||
|
||||
/* iAP EA Native Transport Bulk IN Endpoint Descriptor */
|
||||
.iAP_In_Endpoint =
|
||||
{
|
||||
0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||
0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
|
||||
ENDPOINT_ADDRESS_IN_IAP_EA_NATIVE, /* 2 bEndpointAddress : OUT Endpoint 3. High bit isIn (field size 1 bytes) */
|
||||
0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
|
||||
0x0200, //TODO check this /* 4 wMaxPacketSize : Has to be 0x200 for compliance*/
|
||||
0x00, /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */
|
||||
},
|
||||
#endif
|
||||
#endif /* IAP */
|
||||
|
||||
#ifdef HID_CONTROLS
|
||||
|
||||
Reference in New Issue
Block a user