Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

The following structures provide predefined USB interface descriptors.

It must be used to define the final USB descriptors.

Data Structures

struct  udi_cdc_comm_desc_t
 Communication Class interface descriptor. More...
 
struct  udi_cdc_data_desc_t
 Data Class interface descriptor. More...
 

Macros

#define UDI_CDC_COMM_DESC(port)
 Content of CDC COMM interface descriptor for all speeds. More...
 
#define UDI_CDC_COMM_EP_SIZE   64
 CDC communication endpoints size for all speeds. More...
 
#define UDI_CDC_DATA_DESC_COMMON
 Content of CDC DATA interface descriptors. More...
 
#define UDI_CDC_DATA_DESC_FS(port)
 
#define UDI_CDC_DATA_DESC_HS(port)
 
#define UDI_CDC_DATA_EPS_FS_SIZE   64
 CDC data endpoints size for FS speed (8B, 16B, 32B, 64B) More...
 
#define UDI_CDC_DATA_EPS_HS_SIZE   512
 CDC data endpoints size for HS speed (512B only) More...
 
#define UDI_CDC_IAD_DESC(port)
 Content of CDC IAD interface descriptor for all speeds. More...
 

Content of interface descriptors

Up to 7 CDC interfaces can be implemented on a USB device.

#define UDI_CDC_IAD_STRING_ID_0   0
 By default no string associated to these interfaces. More...
 
#define UDI_CDC_COMM_STRING_ID_0   0
 
#define UDI_CDC_DATA_STRING_ID_0   0
 
#define UDI_CDC_IAD_DESC_0   UDI_CDC_IAD_DESC(0)
 
#define UDI_CDC_COMM_DESC_0   UDI_CDC_COMM_DESC(0)
 
#define UDI_CDC_DATA_DESC_0_FS   UDI_CDC_DATA_DESC_FS(0)
 
#define UDI_CDC_DATA_DESC_0_HS   UDI_CDC_DATA_DESC_HS(0)
 
#define UDI_CDC_IAD_STRING_ID_1   0
 By default no string associated to these interfaces. More...
 
#define UDI_CDC_COMM_STRING_ID_1   0
 
#define UDI_CDC_DATA_STRING_ID_1   0
 
#define UDI_CDC_IAD_DESC_1   UDI_CDC_IAD_DESC(1)
 
#define UDI_CDC_COMM_DESC_1   UDI_CDC_COMM_DESC(1)
 
#define UDI_CDC_DATA_DESC_1_FS   UDI_CDC_DATA_DESC_FS(1)
 
#define UDI_CDC_DATA_DESC_1_HS   UDI_CDC_DATA_DESC_HS(1)
 
#define UDI_CDC_IAD_STRING_ID_2   0
 By default no string associated to these interfaces. More...
 
#define UDI_CDC_COMM_STRING_ID_2   0
 
#define UDI_CDC_DATA_STRING_ID_2   0
 
#define UDI_CDC_IAD_DESC_2   UDI_CDC_IAD_DESC(2)
 
#define UDI_CDC_COMM_DESC_2   UDI_CDC_COMM_DESC(2)
 
#define UDI_CDC_DATA_DESC_2_FS   UDI_CDC_DATA_DESC_FS(2)
 
#define UDI_CDC_DATA_DESC_2_HS   UDI_CDC_DATA_DESC_HS(2)
 
#define UDI_CDC_IAD_STRING_ID_3   0
 By default no string associated to these interfaces. More...
 
#define UDI_CDC_COMM_STRING_ID_3   0
 
#define UDI_CDC_DATA_STRING_ID_3   0
 
#define UDI_CDC_IAD_DESC_3   UDI_CDC_IAD_DESC(3)
 
#define UDI_CDC_COMM_DESC_3   UDI_CDC_COMM_DESC(3)
 
#define UDI_CDC_DATA_DESC_3_FS   UDI_CDC_DATA_DESC_FS(3)
 
#define UDI_CDC_DATA_DESC_3_HS   UDI_CDC_DATA_DESC_HS(3)
 
#define UDI_CDC_IAD_STRING_ID_4   0
 By default no string associated to these interfaces. More...
 
#define UDI_CDC_COMM_STRING_ID_4   0
 
#define UDI_CDC_DATA_STRING_ID_4   0
 
#define UDI_CDC_IAD_DESC_4   UDI_CDC_IAD_DESC(4)
 
#define UDI_CDC_COMM_DESC_4   UDI_CDC_COMM_DESC(4)
 
#define UDI_CDC_DATA_DESC_4_FS   UDI_CDC_DATA_DESC_FS(4)
 
#define UDI_CDC_DATA_DESC_4_HS   UDI_CDC_DATA_DESC_HS(4)
 
#define UDI_CDC_IAD_STRING_ID_5   0
 By default no string associated to these interfaces. More...
 
#define UDI_CDC_COMM_STRING_ID_5   0
 
#define UDI_CDC_DATA_STRING_ID_5   0
 
#define UDI_CDC_IAD_DESC_5   UDI_CDC_IAD_DESC(5)
 
#define UDI_CDC_COMM_DESC_5   UDI_CDC_COMM_DESC(5)
 
#define UDI_CDC_DATA_DESC_5_FS   UDI_CDC_DATA_DESC_FS(5)
 
#define UDI_CDC_DATA_DESC_5_HS   UDI_CDC_DATA_DESC_HS(5)
 
#define UDI_CDC_IAD_STRING_ID_6   0
 By default no string associated to these interfaces. More...
 
#define UDI_CDC_COMM_STRING_ID_6   0
 
#define UDI_CDC_DATA_STRING_ID_6   0
 
#define UDI_CDC_IAD_DESC_6   UDI_CDC_IAD_DESC(6)
 
#define UDI_CDC_COMM_DESC_6   UDI_CDC_COMM_DESC(6)
 
#define UDI_CDC_DATA_DESC_6_FS   UDI_CDC_DATA_DESC_FS(6)
 
#define UDI_CDC_DATA_DESC_6_HS   UDI_CDC_DATA_DESC_HS(6)
 

#define UDI_CDC_COMM_DESC (   port)

Content of CDC COMM interface descriptor for all speeds.

#define UDI_CDC_COMM_DESC_0   UDI_CDC_COMM_DESC(0)
#define UDI_CDC_COMM_DESC_1   UDI_CDC_COMM_DESC(1)
#define UDI_CDC_COMM_DESC_2   UDI_CDC_COMM_DESC(2)
#define UDI_CDC_COMM_DESC_3   UDI_CDC_COMM_DESC(3)
#define UDI_CDC_COMM_DESC_4   UDI_CDC_COMM_DESC(4)
#define UDI_CDC_COMM_DESC_5   UDI_CDC_COMM_DESC(5)
#define UDI_CDC_COMM_DESC_6   UDI_CDC_COMM_DESC(6)
#define UDI_CDC_COMM_EP_SIZE   64

CDC communication endpoints size for all speeds.

#define UDI_CDC_COMM_STRING_ID_0   0
#define UDI_CDC_COMM_STRING_ID_1   0
#define UDI_CDC_COMM_STRING_ID_2   0
#define UDI_CDC_COMM_STRING_ID_3   0
#define UDI_CDC_COMM_STRING_ID_4   0
#define UDI_CDC_COMM_STRING_ID_5   0
#define UDI_CDC_COMM_STRING_ID_6   0
#define UDI_CDC_DATA_DESC_0_FS   UDI_CDC_DATA_DESC_FS(0)
#define UDI_CDC_DATA_DESC_0_HS   UDI_CDC_DATA_DESC_HS(0)
#define UDI_CDC_DATA_DESC_1_FS   UDI_CDC_DATA_DESC_FS(1)
#define UDI_CDC_DATA_DESC_1_HS   UDI_CDC_DATA_DESC_HS(1)
#define UDI_CDC_DATA_DESC_2_FS   UDI_CDC_DATA_DESC_FS(2)
#define UDI_CDC_DATA_DESC_2_HS   UDI_CDC_DATA_DESC_HS(2)
#define UDI_CDC_DATA_DESC_3_FS   UDI_CDC_DATA_DESC_FS(3)
#define UDI_CDC_DATA_DESC_3_HS   UDI_CDC_DATA_DESC_HS(3)
#define UDI_CDC_DATA_DESC_4_FS   UDI_CDC_DATA_DESC_FS(4)
#define UDI_CDC_DATA_DESC_4_HS   UDI_CDC_DATA_DESC_HS(4)
#define UDI_CDC_DATA_DESC_5_FS   UDI_CDC_DATA_DESC_FS(5)
#define UDI_CDC_DATA_DESC_5_HS   UDI_CDC_DATA_DESC_HS(5)
#define UDI_CDC_DATA_DESC_6_FS   UDI_CDC_DATA_DESC_FS(6)
#define UDI_CDC_DATA_DESC_6_HS   UDI_CDC_DATA_DESC_HS(6)
#define UDI_CDC_DATA_DESC_COMMON
Value:
.iface.bLength = sizeof(usb_iface_desc_t),\
.iface.bDescriptorType = USB_DT_INTERFACE,\
.iface.bAlternateSetting = 0,\
.iface.bNumEndpoints = 2,\
.iface.bInterfaceClass = CDC_CLASS_DATA,\
.iface.bInterfaceSubClass = 0,\
.iface.bInterfaceProtocol = 0,\
.ep_in.bLength = sizeof(usb_ep_desc_t),\
.ep_in.bDescriptorType = USB_DT_ENDPOINT,\
.ep_in.bmAttributes = USB_EP_TYPE_BULK,\
.ep_in.bInterval = 0,\
.ep_out.bLength = sizeof(usb_ep_desc_t),\
.ep_out.bDescriptorType = USB_DT_ENDPOINT,\
.ep_out.bmAttributes = USB_EP_TYPE_BULK,\
.ep_out.bInterval = 0,
Definition: usb_protocol.h:194
Definition: usb_protocol.h:193
Standard USB interface descriptor structure.
Definition: usb_protocol.h:446
Definition: usb_protocol.h:251
Standard USB endpoint descriptor structure.
Definition: usb_protocol.h:461
#define CDC_CLASS_DATA
CDC Data Class Interface.
Definition: usb_protocol_cdc.h:53

Content of CDC DATA interface descriptors.

#define UDI_CDC_DATA_DESC_FS (   port)
Value:
{ \
.ep_in.wMaxPacketSize = LE16(UDI_CDC_DATA_EPS_FS_SIZE),\
.ep_out.wMaxPacketSize = LE16(UDI_CDC_DATA_EPS_FS_SIZE),\
.ep_in.bEndpointAddress = UDI_CDC_DATA_EP_IN_##port,\
.ep_out.bEndpointAddress = UDI_CDC_DATA_EP_OUT_##port,\
.iface.bInterfaceNumber = UDI_CDC_DATA_IFACE_NUMBER_##port,\
.iface.iInterface = UDI_CDC_DATA_STRING_ID_##port,\
}
#define UDI_CDC_DATA_DESC_COMMON
Content of CDC DATA interface descriptors.
Definition: udi_cdc.h:285
#define UDI_CDC_DATA_EPS_FS_SIZE
CDC data endpoints size for FS speed (8B, 16B, 32B, 64B)
Definition: udi_cdc.h:118
#define LE16(x)
Definition: compiler.h:773
#define UDI_CDC_DATA_DESC_HS (   port)
Value:
{ \
.ep_in.wMaxPacketSize = LE16(UDI_CDC_DATA_EPS_HS_SIZE),\
.ep_out.wMaxPacketSize = LE16(UDI_CDC_DATA_EPS_HS_SIZE),\
.ep_in.bEndpointAddress = UDI_CDC_DATA_EP_IN_##port,\
.ep_out.bEndpointAddress = UDI_CDC_DATA_EP_OUT_##port,\
.iface.bInterfaceNumber = UDI_CDC_DATA_IFACE_NUMBER_##port,\
.iface.iInterface = UDI_CDC_DATA_STRING_ID_##port,\
}
#define UDI_CDC_DATA_EPS_HS_SIZE
CDC data endpoints size for HS speed (512B only)
Definition: udi_cdc.h:120
#define UDI_CDC_DATA_DESC_COMMON
Content of CDC DATA interface descriptors.
Definition: udi_cdc.h:285
#define LE16(x)
Definition: compiler.h:773
#define UDI_CDC_DATA_EPS_FS_SIZE   64

CDC data endpoints size for FS speed (8B, 16B, 32B, 64B)

#define UDI_CDC_DATA_EPS_HS_SIZE   512

CDC data endpoints size for HS speed (512B only)

#define UDI_CDC_DATA_STRING_ID_0   0
#define UDI_CDC_DATA_STRING_ID_1   0
#define UDI_CDC_DATA_STRING_ID_2   0
#define UDI_CDC_DATA_STRING_ID_3   0
#define UDI_CDC_DATA_STRING_ID_4   0
#define UDI_CDC_DATA_STRING_ID_5   0
#define UDI_CDC_DATA_STRING_ID_6   0
#define UDI_CDC_IAD_DESC (   port)
Value:
{ \
.bLength = sizeof(usb_iad_desc_t),\
.bDescriptorType = USB_DT_IAD,\
.bInterfaceCount = 2,\
.bFunctionClass = CDC_CLASS_COMM,\
.bFunctionSubClass = CDC_SUBCLASS_ACM,\
.bFunctionProtocol = CDC_PROTOCOL_V25TER,\
.bFirstInterface = UDI_CDC_COMM_IFACE_NUMBER_##port,\
.iFunction = UDI_CDC_IAD_STRING_ID_##port,\
}
#define CDC_SUBCLASS_ACM
Abstract Control Model.
Definition: usb_protocol_cdc.h:59
Standard USB association descriptor structure.
Definition: usb_protocol.h:432
#define CDC_PROTOCOL_V25TER
Common AT commands.
Definition: usb_protocol_cdc.h:69
#define CDC_CLASS_COMM
CDC Communication Class Interface.
Definition: usb_protocol_cdc.h:52
Definition: usb_protocol.h:199

Content of CDC IAD interface descriptor for all speeds.

#define UDI_CDC_IAD_DESC_0   UDI_CDC_IAD_DESC(0)
#define UDI_CDC_IAD_DESC_1   UDI_CDC_IAD_DESC(1)
#define UDI_CDC_IAD_DESC_2   UDI_CDC_IAD_DESC(2)
#define UDI_CDC_IAD_DESC_3   UDI_CDC_IAD_DESC(3)
#define UDI_CDC_IAD_DESC_4   UDI_CDC_IAD_DESC(4)
#define UDI_CDC_IAD_DESC_5   UDI_CDC_IAD_DESC(5)
#define UDI_CDC_IAD_DESC_6   UDI_CDC_IAD_DESC(6)
#define UDI_CDC_IAD_STRING_ID_0   0

By default no string associated to these interfaces.

#define UDI_CDC_IAD_STRING_ID_1   0

By default no string associated to these interfaces.

#define UDI_CDC_IAD_STRING_ID_2   0

By default no string associated to these interfaces.

#define UDI_CDC_IAD_STRING_ID_3   0

By default no string associated to these interfaces.

#define UDI_CDC_IAD_STRING_ID_4   0

By default no string associated to these interfaces.

#define UDI_CDC_IAD_STRING_ID_5   0

By default no string associated to these interfaces.

#define UDI_CDC_IAD_STRING_ID_6   0

By default no string associated to these interfaces.