USBHost library. NOTE: This library is only officially supported on the LPC1768 platform. For more information, please see the handbook page.
Dependencies: FATFileSystem mbed-rtos
Dependents: BTstack WallbotWii SD to Flash Data Transfer USBHost-MSD_HelloWorld ... more
Legacy Warning
This is an mbed 2 library. To learn more about mbed OS 5, visit the docs.
Pull requests against this repository are no longer supported. Please raise against mbed OS 5 as documented above.
Diff: USBHostHID/USBHostKeyboard.cpp
- Revision:
- 24:868cbfe611a7
- Parent:
- 8:93da8ea2708b
- Child:
- 37:f1e388e7b752
--- a/USBHostHID/USBHostKeyboard.cpp Fri Mar 07 16:00:46 2014 +0000 +++ b/USBHostHID/USBHostKeyboard.cpp Tue Jun 03 11:30:38 2014 +0100 @@ -18,7 +18,7 @@ #if USBHOST_KEYBOARD -static uint8_t keymap[4][0x39] = { +static uint8_t keymap[4][0x39] = { { 0, 0, 0, 0, 'a', 'b' /*0x05*/, 'c', 'd', 'e', 'f', 'g' /*0x0a*/, 'h', 'i', 'j', 'k', 'l'/*0x0f*/, @@ -100,30 +100,30 @@ bool USBHostKeyboard::connect() { - + if (dev_connected) { return true; } - + for (uint8_t i = 0; i < MAX_DEVICE_CONNECTED; i++) { if ((dev = host->getDevice(i)) != NULL) { if (host->enumerate(dev, this)) break; - + if (keyboard_device_found) { int_in = dev->getEndpoint(keyboard_intf, INTERRUPT_ENDPOINT, IN); - + if (!int_in) break; - + USB_INFO("New Keyboard device: VID:%04x PID:%04x [dev: %p - intf: %d]", dev->getVid(), dev->getPid(), dev, keyboard_intf); dev->setName("Keyboard", keyboard_intf); host->registerDriver(dev, keyboard_intf, this, &USBHostKeyboard::init); - + int_in->attach(this, &USBHostKeyboard::rxHandler); host->interruptRead(dev, int_in, report, int_in->getSize(), false); - + dev_connected = true; return true; }