Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: AT91RM9200 as a Printer Device
PostPosted: Wed May 18, 2011 6:46 pm 
Offline

Joined: Wed May 18, 2011 6:20 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: