2012-10-01 12 views
6

का उपयोग कर अनुकरण मैं के बाद से है कि इसके विज्ञापित सुविधाओं में से एक है कुंजीपटल अनुकरण के लिए एक Arduino Leonardo उपयोग करने के लिए कोशिश कर रहा हूँ। मैं लियोनार्डो के साथ खेल रहा हूं और ब्लिंक उदाहरण के आधार पर एक बहुत ही सरल स्केच लिखा है।जेनेरिक कुंजीपटल Arduino लियोनार्डो

// Pin 13 has an LED connected on most Arduino boards. 
int led = 13; 

// The setup routine runs once when you press reset: 
void setup() 
{ 
    // Initialize the digital pin as an output. 
    pinMode(led, OUTPUT); 
} 

// The loop routine runs over and over again forever: 
void loop() 
{ 
    delay(5000);    // Wait for five seconds 
    digitalWrite(led, HIGH); // Turn the LED on (HIGH is the voltage level) 
    delay(100);    // Wait for a secondA 
    digitalWrite(led, LOW); // Turn the LED off by making the voltage LOW 
    Keyboard.write('A');  // Write an A using keyboard emulator 
} 

अब यह उदाहरण मेरी विंडोज एक्सपी मशीन पर बहुत अच्छा काम करता है। इसे एक सामान्य HID कीबोर्ड के रूप में पहचाना जाता है और प्रत्येक पांच सेकंड में 'ए' टाइप करेगा।

लक्षित वातावरण मेरे ज्ञान के लिए डॉस चला रहा है, मुझे इस मशीन पर BIOS द्वारा मान्यता प्राप्त Arduino Leonardo प्राप्त करने की आवश्यकता है, जो यह नहीं है और यह डॉस में 'ए' टाइप नहीं करता है।

मैं लियोनार्डो के USB डिवाइस वर्णनकर्ता संशोधन करने की है, यह एक Dell L100 के रूप में ज्यादा संभव के रूप में मिलान करने के लिए कोशिश कर रहा। मेरे द्वारा किए गए संशोधनों में मदद नहीं मिली है, और मुझे संदेह है क्योंकि लियोनार्डो एक समग्र डिवाइस है जो एक ही यूएसबी पोर्ट पर सीरियल संचार, कीबोर्ड इम्यूलेशन और माउस इम्यूलेशन का खुलासा करता है। यूएसबी वर्णनकर्ता/विन्यास के लिए स्रोत कोड संपादित करने के लिए उपलब्ध है और पर स्थित है:

  • Arduino_Installation \ हार्डवेयर \ arduino \ कोर \ arduino \ HID.cpp
  • Arduino_Installation \ हार्डवेयर \ arduino \ कोर \ arduino \ USBDesc.h
  • Arduino_Installation \ हार्डवेयर \ arduino \ कोर \ arduino \ USBCore.h
  • Arduino_Installation \ हार्डवेयर \ arduino \ कोर \ arduino \ USBCore.cpp

निम्नलिखित यूएसबी डिवाइस से एक डंप हैलियोनार्डो के लिए व्यूअर:

[Port3] : USB Composite Device 

      ---===>Device Information<===--- 
English product name: "Arduino Leonardo" 

ConnectionStatus: 
Current Config Value:    0x01 -> Device Bus Speed: Full 
Device Address:     0x03 
Open Pipes:       4 

      ===>Endpoint Descriptor<=== 
bLength:       0x07 
bDescriptorType:     0x05 
bEndpointAddress:     0x81 -> Direction: IN - EndpointID: 1 
bmAttributes:      0x03 -> Interrupt Transfer Type 
wMaxPacketSize:     0x0010 = 0x10 bytes 
bInterval:       0x40 

      ===>Endpoint Descriptor<=== 
bLength:       0x07 
bDescriptorType:     0x05 
bEndpointAddress:     0x02 -> Direction: OUT - EndpointID: 2 
bmAttributes:      0x02 -> Bulk Transfer Type 
wMaxPacketSize:     0x0040 = 0x40 bytes 
bInterval:       0x00 

      ===>Endpoint Descriptor<=== 
bLength:       0x07 
bDescriptorType:     0x05 
bEndpointAddress:     0x83 -> Direction: IN - EndpointID: 3 
bmAttributes:      0x02 -> Bulk Transfer Type 
wMaxPacketSize:     0x0040 = 0x40 bytes 
bInterval:       0x00 

      ===>Endpoint Descriptor<=== 
bLength:       0x07 
bDescriptorType:     0x05 
bEndpointAddress:     0x84 -> Direction: IN - EndpointID: 4 
bmAttributes:      0x03 -> Interrupt Transfer Type 
wMaxPacketSize:     0x0040 = 0x40 bytes 
bInterval:       0x01 

      ===>Device Descriptor<=== 
bLength:       0x12 
bDescriptorType:     0x01 
bcdUSB:       0x0110 
bDeviceClass:      0x00 
*!*ERROR: device class should be Multi-interface Function 0xEF 
      When IAD descriptor is used 
bDeviceSubClass:     0x00 
*!*ERROR: device SubClass should be USB Common Sub Class 2 
      When IAD descriptor is used 
bDeviceProtocol:     0x00 
*!*ERROR: device Protocol should be USB IAD Protocol 1 
      When IAD descriptor is used 
bMaxPacketSize0:     0x40 = (64) Bytes 
idVendor:      0x2341 = Vendor ID not listed with USB.org as of 03-19-2008 
idProduct:      0x8036 
bcdDevice:      0x0100 
iManufacturer:      0x01 
    English (United States) "Arduino LLC" 
iProduct:       0x02 
    English (United States) "Arduino Leonardo" 
iSerialNumber:      0x00 
bNumConfigurations:    0x01 

      ===>Configuration Descriptor<=== 
bLength:       0x09 
bDescriptorType:     0x02 
wTotalLength:     0x0064 -> Validated 
bNumInterfaces:     0x03 
bConfigurationValue:    0x01 
iConfiguration:     0x00 
bmAttributes:      0x80 -> Bus Powered 
MaxPower:       0xFA = 500 mA 

      ===>IAD Descriptor<=== 
bLength:       0x08 
bDescriptorType:     0x0B 
bFirstInterface:     0x00 
bInterfaceCount:     0x02 
bFunctionClass:     0x02 -> This is Communications (CDC Control) USB Device Interface Class 
bFunctionSubClass:     0x01 
bFunctionProtocol:     0x01 
iFunction:       0x00 

      ===>Interface Descriptor<=== 
bLength:       0x09 
bDescriptorType:     0x04 
bInterfaceNumber:     0x00 
bAlternateSetting:     0x00 
bNumEndpoints:      0x01 
bInterfaceClass:     0x02 -> This is Communications (CDC Control) USB Device Interface Class 
bInterfaceSubClass:    0x01 
bInterfaceProtocol:    0x00 
CAUTION: This may be an invalid bInterfaceProtocol 
iInterface:      0x00 
    -> This is a Communications (CDC Control) USB Device Interface Class 

      ===>Descriptor Hex Dump<=== 
bLength:       0x05 
bDescriptorType:     0x24 
05 24 00 10 01 
    -> This is a Communications (CDC Control) USB Device Interface Class 

      ===>Descriptor Hex Dump<=== 
bLength:       0x05 
bDescriptorType:     0x24 
05 24 01 01 01 
    -> This is a Communications (CDC Control) USB Device Interface Class 

      ===>Descriptor Hex Dump<=== 
bLength:       0x04 
bDescriptorType:     0x24 
04 24 02 06 
    -> This is a Communications (CDC Control) USB Device Interface Class 

      ===>Descriptor Hex Dump<=== 
bLength:       0x05 
bDescriptorType:     0x24 
05 24 06 00 01 

      ===>Endpoint Descriptor<=== 
bLength:       0x07 
bDescriptorType:     0x05 
bEndpointAddress:     0x81 -> Direction: IN - EndpointID: 1 
bmAttributes:      0x03 -> Interrupt Transfer Type 
wMaxPacketSize:     0x0010 = 0x10 bytes 
bInterval:       0x40 

      ===>Interface Descriptor<=== 
bLength:       0x09 
bDescriptorType:     0x04 
bInterfaceNumber:     0x01 
bAlternateSetting:     0x00 
bNumEndpoints:      0x02 
bInterfaceClass:     0x0A -> This is a CDC Data USB Device Interface Class 
bInterfaceSubClass:    0x01 
bInterfaceProtocol:    0x00 
CAUTION: This may be an invalid bInterfaceProtocol 
iInterface:      0x00 

      ===>Endpoint Descriptor<=== 
bLength:       0x07 
bDescriptorType:     0x05 
bEndpointAddress:     0x02 -> Direction: OUT - EndpointID: 2 
bmAttributes:      0x02 -> Bulk Transfer Type 
wMaxPacketSize:     0x0040 = 0x40 bytes 
bInterval:       0x00 

      ===>Endpoint Descriptor<=== 
bLength:       0x07 
bDescriptorType:     0x05 
bEndpointAddress:     0x83 -> Direction: IN - EndpointID: 3 
bmAttributes:      0x02 -> Bulk Transfer Type 
wMaxPacketSize:     0x0040 = 0x40 bytes 
bInterval:       0x00 

      ===>Interface Descriptor<=== 
bLength:       0x09 
bDescriptorType:     0x04 
bInterfaceNumber:     0x02 
bAlternateSetting:     0x00 
bNumEndpoints:      0x01 
bInterfaceClass:     0x03 -> HID Interface Class 
bInterfaceSubClass:    0x01 
bInterfaceProtocol:    0x00 
CAUTION: This may be an invalid bInterfaceProtocol 
iInterface:      0x00 

      ===>HID Descriptor<=== 
bLength:       0x09 
bDescriptorType:     0x21 
bcdHID:       0x0101 
bCountryCode:      0x00 
bNumDescriptors:     0x01 
bDescriptorType:     0x22 
wDescriptorLength:    0x0065 

      ===>Endpoint Descriptor<=== 
bLength:       0x07 
bDescriptorType:     0x05 
bEndpointAddress:     0x84 -> Direction: IN - EndpointID: 4 
bmAttributes:      0x03 -> Interrupt Transfer Type 
wMaxPacketSize:     0x0040 = 0x40 bytes 
bInterval:       0x01 

मैं इस लियोनार्डो एक सामान्य कुंजीपटल के रूप में एक BIOS द्वारा मान्यता प्राप्त हो सकता है?

+0

आप एक समाधान hava है ?. मेरी भी यही समस्या है। – Delta

+0

मैं नहीं करता हूं। मैंने डार्बीस द्वारा प्रदान किए गए समाधान का प्रयास किया, लेकिन पीसी को इसे पहचानने के लिए यह प्रबंधित नहीं हुआ। –

उत्तर

2

Arduino बूट प्रोटोकॉल का समर्थन नहीं करता। मैंने Teensy (जो Arduino संगत है) का उपयोग करना शुरू कर दिया है, और यह बहुत अच्छी तरह से काम करता है।

+1

बूट प्रोटोकॉल को देखने के बाद मुझे यह भी विश्वास है कि यह समस्या है। मुझे यहां दस्तावेज़ीकरण मिला [यूएसबी.ओआरजी] (http://www.usb.org/developers/devclass_docs/HID1_11.pdf) जो बताता है कि इसे कैसे कार्यान्वित किया जा सकता है। –

+0

@wirecat: क्या आप इसे काम करने के लिए छिपा स्रोत कोड संशोधित करने में सक्षम थे? – Force

+0

@ फोर्स मैं नहीं था। मैंने तब से एक अलग समाधान का उपयोग किया है और इसके पास वापस आने का समय नहीं है। –

1

मुझे गलत हो सकता है, लेकिन यदि आप बूट के दौरान अपने देवता को पहचानना चाहते हैं, तो यह bInterfaceSubClass 0x01 (बूट डिवाइस उपclass) होना चाहिए। स्रोत फ़ाइलों में आपने बताया है, हर जगह उप वर्ग 0x00 पर सेट है।

आप USBCore.h से 0x01 को D_INTERFACE मैक्रो के सभी प्रयोगों में उपवर्ग सेट करने का प्रयास कर सकते हैं।

मैं Arduino उपयोगकर्ता नहीं हूँ, मैं केवल एक बार V-USB का उपयोग कर AVR पर HID कुंजीपटल अनुकरण के साथ खेल रहा था। आप दस्तावेज में USB.org पर यूएसबी डिस्क्रिप्टर के बारे में विस्तृत जानकारी प्राप्त करने का प्रयास कर सकते हैं। लेकिन यह पढ़ने के लिए पृष्ठों का एक ढेर है।

यहाँ हिस्सा आयुध डिपो अपने कीबोर्ड की HID वर्णनकर्ता डंप है, इंटरफ़ेस डिस्क्रिप्टर में नोटिस मान:

Bus 005 Device 002: ID 046d:c30e Logitech, Inc. UltraX Keyboard (Y-BL49) 
Device Descriptor: 
    bLength    18 
    bDescriptorType   1 
    bcdUSB    1.10 
    bDeviceClass   0 (Defined at Interface level) 
    bDeviceSubClass   0 
    bDeviceProtocol   0 
    bMaxPacketSize0   8 
    idVendor   0x046d Logitech, Inc. 
    idProduct   0xc30e UltraX Keyboard (Y-BL49) 
    bcdDevice   1.80 
    iManufacturer   1 Logitech 
    iProduct    2 HID compliant keyboard 
    iSerial     0 
    bNumConfigurations  1 
    Configuration Descriptor: 
    bLength     9 
    bDescriptorType   2 
    wTotalLength   59 
    bNumInterfaces   2 
    bConfigurationValue  1 
    iConfiguration   0 
    bmAttributes   0xa0 
     (Bus Powered) 
     Remote Wakeup 
    MaxPower    100mA 
    Interface Descriptor: 
     bLength     9 
     bDescriptorType   4 
     bInterfaceNumber  0 
     bAlternateSetting  0 
     bNumEndpoints   1 
     bInterfaceClass   3 Human Interface Device 
     bInterfaceSubClass  1 Boot Interface Subclass 
     bInterfaceProtocol  1 Keyboard 
     iInterface    0 
     HID Device Descriptor: 
      bLength     9 
      bDescriptorType  33 
      bcdHID    1.10 
      bCountryCode   0 Not supported 
      bNumDescriptors   1 
      bDescriptorType  34 Report 
      wDescriptorLength  62 

डंप linux के तहत रूट के रूप में उपयोग करते हुए "lsusb -v" बनाया गया था।

+1

मैंने आपके अनुशंसित समाधान की कोशिश की लेकिन दुर्भाग्य से लियोनार्डो अभी भी बीआईओएस द्वारा मान्यता प्राप्त नहीं है।मैं लियोनार्डो के लिए वर्तमान वर्णनकर्ताओं को दिखाते हुए अपने प्रश्न में यूएसबी डिवाइस व्यूअर से एक डंप जोड़ूंगा। –