Ejemplo n.º 1
0
{
	u32	dwDTERate;
	u8	bCharFormat;
	u8 	bParityType;
	u8 	bDataBits;
	u8	lineState;
} LineInfo;

static volatile LineInfo _usbLineInfo = { 57600, 0x00, 0x00, 0x00, 0x00 };

#define WEAK __attribute__ ((weak))

extern const CDCDescriptor _cdcInterface PROGMEM;
const CDCDescriptor _cdcInterface =
{
	D_IAD(0,2,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,1),

	//	CDC communication interface
	D_INTERFACE(CDC_ACM_INTERFACE,1,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,0),
	D_CDCCS(CDC_HEADER,0x10,0x01),								// Header (1.10 bcd)
	D_CDCCS(CDC_CALL_MANAGEMENT,1,1),							// Device handles call management (not)
	D_CDCCS4(CDC_ABSTRACT_CONTROL_MANAGEMENT,6),				// SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported
	D_CDCCS(CDC_UNION,CDC_ACM_INTERFACE,CDC_DATA_INTERFACE),	// Communication interface is master, data interface is slave 0
	D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_ACM),USB_ENDPOINT_TYPE_INTERRUPT,0x10,0x40),

	//	CDC data interface
	D_INTERFACE(CDC_DATA_INTERFACE,2,CDC_DATA_INTERFACE_CLASS,0,0),
	D_ENDPOINT(USB_ENDPOINT_OUT(CDC_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,USB_EP_SIZE,0),
	D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_IN ),USB_ENDPOINT_TYPE_BULK,USB_EP_SIZE,0)
};
           CDC_ABSTRACT_CONTROL_MODEL,          // device protocol (ACM)
           64,                                  // packet size (64)
           USB_VID,                             // vendor ID for the USB device
           USB_PID,                             // product ID for the USB device
           0x100,                               // device release version as BCD (1.00)
           USB_STRING_INDEX_MANUFACTURER,       // string index for mfg
           USB_STRING_INDEX_PRODUCT,            // string index for product name
           USB_STRING_INDEX_SERIAL,             // string index for serial number (0 for 'none')
           1);                                  // number of configurations (1)


// IAD descriptor - REQUIRED for composite interfaces, sent via CDC_SendIAD()

const IADDescriptor _cdcIADDesc = D_IAD(0,                                  // first interface
                                        2,                                  // count (interfaces, not endpoints)
                                        CDC_COMMUNICATION_INTERFACE_CLASS,  // interface class
                                        CDC_ABSTRACT_CONTROL_MODEL,         // interface sub-class
                                        1);                                 // protocol

// CDC interface descriptor - sent by CDC_SendInterfaceData()

const CDCDescriptor _cdcInterface = // needs to be no more than 55 bytes in length
{
  //  FIRST INTERFACE
  //  CDC communication interface (endpoint 0)
  D_INTERFACE(CDC_ACM_INTERFACE,                            // 'n'
              1,                                            // number of endpoints
              CDC_COMMUNICATION_INTERFACE_CLASS,            // interface class
              CDC_ABSTRACT_CONTROL_MODEL,                   // interface sub-class
              0),                                           // protocol