|
Hi,
I try to set the AT91RM9200 USB as a printer device. I want that linux recognize it as a printer even if I have not developed a printer driver (PPD-CUPS) until now.
I face some difficulties to define the (deviceDescriptor-deviceID). Is there some examples that could point me to the correct way??
char deviceDescriptor[] = { /* Device descriptor */ 0x12, // bLength 0x01, // bDescriptorType 0x00, // bcdUSBL 0x02, // 0x00, // bDeviceClass: CDC class code // 7 ---> Printer 0x00, // bDeviceSubclass: CDC class sub code 0x00, // bDeviceProtocol: CDC Device protocol 0x08, // bMaxPacketSize0 0xEB, // idVendorL 0x03, // 0x28, // idProductL 0x61, // 0x10, // bcdDeviceL 0x01, // 0x00, // iManufacturer //0x00 0x00, // iProduct 0x00, // SerialNumber 0x01 // bNumConfigs };
char configurationDescriptor[] = { /* ============== CONFIGURATION 1 =========== */ /* Configuration 1 descriptor */ 0x09, // CbLength 0x02, // CbDescriptorType 0x20, // CwTotalLength 2 EP + Control 0x00, 0x01, // CbNumInterfaces 0x01, // CbConfigurationValue 0x00, // CiConfiguration 0xC0, // CbmAttributes 0xA0 0x00, // CMaxPower
/* Communication Class Interface Descriptor Requirement */ 0x09, // bLength 0x04, // bDescriptorType 0x00, // bInterfaceNumber 0x00, // bAlternateSetting 0x02, // bNumEndpoints 0x07, // bInterfaceClass -----> 7 Printer 0x01, // bInterfaceSubclass 0x02, // bInterfaceProtocol 0x00, // iInterface
/* First alternate setting */ /* Endpoint 1 descriptor */ 0x07, // bLength 0x05, // bDescriptorType 0x01, // bEndpointAddress, Endpoint 01 - OUT 0x02, // bmAttributes BULK 0x40, // wMaxPacketSize 0x00, 0x00, // bInterval
/* Endpoint 2 descriptor */ 0x07, // bLength 0x05, // bDescriptorType 0x82, // bEndpointAddress, Endpoint 02 - IN 0x02, // bmAttributes BULK 0x40, // wMaxPacketSize 0x00, 0x00 // bInterval };
Thank you,
Coincoin
|