diff options
| -rw-r--r-- | common/debug.h | 2 | ||||
| -rw-r--r-- | common/print.c | 22 | ||||
| -rw-r--r-- | common/print.h | 145 | ||||
| -rw-r--r-- | keyboard/mbed_onekey/HIDKeyboard.cpp | 256 | ||||
| -rw-r--r-- | keyboard/mbed_onekey/HIDKeyboard.h | 36 | ||||
| -rw-r--r-- | keyboard/mbed_onekey/Makefile | 29 | ||||
| -rw-r--r-- | keyboard/mbed_onekey/common.mk | 19 | ||||
| -rw-r--r-- | keyboard/mbed_onekey/gcc.mk | 79 | ||||
| -rw-r--r-- | keyboard/mbed_onekey/main.cpp | 55 | ||||
| -rw-r--r-- | keyboard/mbed_onekey/mbed.mk | 92 |
10 files changed, 641 insertions, 94 deletions
diff --git a/common/debug.h b/common/debug.h index 8aaa5ed91..399b2d0a7 100644 --- a/common/debug.h +++ b/common/debug.h | |||
| @@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 26 | 26 | ||
| 27 | #define dprint(s) do { if (debug_enable) print(s); } while (0) | 27 | #define dprint(s) do { if (debug_enable) print(s); } while (0) |
| 28 | #define dprintln() do { if (debug_enable) print_crlf(); } while (0) | 28 | #define dprintln() do { if (debug_enable) print_crlf(); } while (0) |
| 29 | #define dprintf(fmt, ...) do { if (debug_enable) __xprintf(PSTR(fmt), ##__VA_ARGS__); } while (0) | 29 | #define dprintf(fmt, ...) do { if (debug_enable) xprintf(fmt, ##__VA_ARGS__); } while (0) |
| 30 | #define dmsg(s) dprintf("%s at %s: %S\n", __FILE__, __LINE__, PSTR(s)) | 30 | #define dmsg(s) dprintf("%s at %s: %S\n", __FILE__, __LINE__, PSTR(s)) |
| 31 | 31 | ||
| 32 | /* DO NOT USE these anymore */ | 32 | /* DO NOT USE these anymore */ |
diff --git a/common/print.c b/common/print.c index 783bb4e9b..c13a29f31 100644 --- a/common/print.c +++ b/common/print.c | |||
| @@ -37,26 +37,4 @@ void print_set_sendchar(int8_t (*sendchar_func)(uint8_t)) | |||
| 37 | xdev_out(sendchar_func); | 37 | xdev_out(sendchar_func); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void print_S(const char *s) | ||
| 41 | { | ||
| 42 | uint8_t c; | ||
| 43 | while (1) { | ||
| 44 | c = *s++; | ||
| 45 | if (!c) break; | ||
| 46 | if (c == '\n') sendchar('\r'); | ||
| 47 | sendchar(c); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | void print_lf(void) | ||
| 52 | { | ||
| 53 | sendchar('\n'); | ||
| 54 | } | ||
| 55 | |||
| 56 | void print_crlf(void) | ||
| 57 | { | ||
| 58 | sendchar('\r'); | ||
| 59 | sendchar('\n'); | ||
| 60 | } | ||
| 61 | |||
| 62 | #endif | 40 | #endif |
diff --git a/common/print.h b/common/print.h index 930e84be9..6a6771f71 100644 --- a/common/print.h +++ b/common/print.h | |||
| @@ -27,98 +27,79 @@ | |||
| 27 | 27 | ||
| 28 | #include <stdint.h> | 28 | #include <stdint.h> |
| 29 | #include <stdbool.h> | 29 | #include <stdbool.h> |
| 30 | #include <avr/pgmspace.h> | ||
| 31 | #include "xprintf.h" | ||
| 32 | #include "util.h" | 30 | #include "util.h" |
| 33 | 31 | ||
| 34 | 32 | ||
| 35 | // this macro allows you to write print("some text") and | ||
| 36 | // the string is automatically placed into flash memory :) | ||
| 37 | // TODO: avoid collision with arduino/Print.h | ||
| 38 | #ifndef __cplusplus | ||
| 39 | #define print(s) print_P(PSTR(s)) | ||
| 40 | #endif | ||
| 41 | #define println(s) print_P(PSTR(s "\n")) | ||
| 42 | 33 | ||
| 43 | /* for old name */ | ||
| 44 | #define pdec(data) print_dec(data) | ||
| 45 | #define pdec16(data) print_dec(data) | ||
| 46 | #define phex(data) print_hex8(data) | ||
| 47 | #define phex16(data) print_hex16(data) | ||
| 48 | #define pbin(data) print_bin8(data) | ||
| 49 | #define pbin16(data) print_bin16(data) | ||
| 50 | #define pbin_reverse(data) print_bin_reverse8(data) | ||
| 51 | #define pbin_reverse16(data) print_bin_reverse16(data) | ||
| 52 | 34 | ||
| 53 | /* print value utility */ | 35 | #ifndef NO_PRINT |
| 54 | #define print_val_dec(v) xprintf(#v ": %u\n", v) | ||
| 55 | #define print_val_decs(v) xprintf(#v ": %d\n", v) | ||
| 56 | #define print_val_hex8(v) xprintf(#v ": %X\n", v) | ||
| 57 | #define print_val_hex16(v) xprintf(#v ": %02X\n", v) | ||
| 58 | #define print_val_hex32(v) xprintf(#v ": %04lX\n", v) | ||
| 59 | #define print_val_bin8(v) xprintf(#v ": %08b\n", v) | ||
| 60 | #define print_val_bin16(v) xprintf(#v ": %016b\n", v) | ||
| 61 | #define print_val_bin32(v) xprintf(#v ": %032lb\n", v) | ||
| 62 | #define print_val_bin_reverse8(v) xprintf(#v ": %08b\n", bitrev(v)) | ||
| 63 | #define print_val_bin_reverse16(v) xprintf(#v ": %016b\n", bitrev16(v)) | ||
| 64 | #define print_val_bin_reverse32(v) xprintf(#v ": %032lb\n", bitrev32(v)) | ||
| 65 | 36 | ||
| 66 | 37 | ||
| 38 | #ifdef __AVR__ | ||
| 39 | |||
| 40 | #include "xprintf.h" | ||
| 67 | 41 | ||
| 68 | #ifndef NO_PRINT | 42 | |
| 43 | // TODO: avoid collision with arduino/Print.h | ||
| 44 | #ifndef __cplusplus | ||
| 45 | #define print(s) xputs(PSTR(s)) | ||
| 46 | #endif | ||
| 47 | #define println(s) xputs(PSTR(s "\n")) | ||
| 69 | 48 | ||
| 70 | #ifdef __cplusplus | 49 | #ifdef __cplusplus |
| 71 | extern "C" { | 50 | extern "C" { |
| 72 | #endif | 51 | #endif |
| 73 | |||
| 74 | /* function pointer of sendchar to be used by print utility */ | 52 | /* function pointer of sendchar to be used by print utility */ |
| 75 | void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); | 53 | void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); |
| 76 | 54 | ||
| 77 | /* print string stored in data memory(SRAM) | 55 | #elif __arm__ |
| 78 | * print_S("hello world"); | ||
| 79 | * This consumes precious SRAM memory space for string. | ||
| 80 | */ | ||
| 81 | void print_S(const char *s); | ||
| 82 | 56 | ||
| 83 | void print_lf(void); | 57 | #include "mbed.h" |
| 84 | void print_crlf(void); | 58 | Serial ser(UART_TX, UART_RX); |
| 59 | #define xprintf ser.printf | ||
| 60 | #define print(s) xprintf(s) | ||
| 61 | #define println(s) xprintf(s "\n") | ||
| 62 | /* TODO: to select output destinations: UART/USBSerial */ | ||
| 63 | #define print_set_sendchar(func) | ||
| 85 | 64 | ||
| 65 | #endif /* __AVR__ */ | ||
| 86 | 66 | ||
| 87 | /* print string stored in program memory(FLASH) | ||
| 88 | * print_P(PSTR("hello world"); | ||
| 89 | * This consumes relatively abundant FLASH memory area not SRAM. | ||
| 90 | */ | ||
| 91 | #define print_P(s) xputs(s) | ||
| 92 | 67 | ||
| 93 | /* decimal */ | 68 | /* decimal */ |
| 94 | #define print_dec(i) xprintf("%u", i) | 69 | #define print_dec(i) xprintf("%u", i) |
| 95 | #define print_decs(i) xprintf("%d", i) | 70 | #define print_decs(i) xprintf("%d", i) |
| 96 | |||
| 97 | /* hex */ | 71 | /* hex */ |
| 98 | #define print_hex4(i) xprintf("%X", i) | 72 | #define print_hex4(i) xprintf("%X", i) |
| 99 | #define print_hex8(i) xprintf("%02X", i) | 73 | #define print_hex8(i) xprintf("%02X", i) |
| 100 | #define print_hex16(i) xprintf("%04X", i) | 74 | #define print_hex16(i) xprintf("%04X", i) |
| 101 | #define print_hex32(i) xprintf("%08lX", i) | 75 | #define print_hex32(i) xprintf("%08lX", i) |
| 102 | |||
| 103 | /* binary */ | 76 | /* binary */ |
| 104 | #define print_bin4(i) xprintf("%04b", i) | 77 | #define print_bin4(i) xprintf("%04b", i) |
| 105 | #define print_bin8(i) xprintf("%08b", i) | 78 | #define print_bin8(i) xprintf("%08b", i) |
| 106 | #define print_bin16(i) xprintf("%016b", i) | 79 | #define print_bin16(i) xprintf("%016b", i) |
| 107 | #define print_bin32(i) xprintf("%032lb", i) | 80 | #define print_bin32(i) xprintf("%032lb", i) |
| 108 | 81 | #define print_bin_reverse8(i) xprintf("%08b", bitrev(i)) | |
| 109 | #define print_bin_reverse8(i) xprintf("%08b", bitrev(i)) | 82 | #define print_bin_reverse16(i) xprintf("%016b", bitrev16(i)) |
| 110 | #define print_bin_reverse16(i) xprintf("%016b", bitrev16(i)) | 83 | #define print_bin_reverse32(i) xprintf("%032lb", bitrev32(i)) |
| 111 | #define print_bin_reverse32(i) xprintf("%032lb", bitrev32(i)) | 84 | /* print value utility */ |
| 112 | 85 | #define print_val_dec(v) xprintf(#v ": %u\n", v) | |
| 113 | #ifdef __cplusplus | 86 | #define print_val_decs(v) xprintf(#v ": %d\n", v) |
| 114 | } | 87 | #define print_val_hex8(v) xprintf(#v ": %X\n", v) |
| 115 | #endif | 88 | #define print_val_hex16(v) xprintf(#v ": %02X\n", v) |
| 116 | 89 | #define print_val_hex32(v) xprintf(#v ": %04lX\n", v) | |
| 117 | #else | 90 | #define print_val_bin8(v) xprintf(#v ": %08b\n", v) |
| 118 | 91 | #define print_val_bin16(v) xprintf(#v ": %016b\n", v) | |
| 92 | #define print_val_bin32(v) xprintf(#v ": %032lb\n", v) | ||
| 93 | #define print_val_bin_reverse8(v) xprintf(#v ": %08b\n", bitrev(v)) | ||
| 94 | #define print_val_bin_reverse16(v) xprintf(#v ": %016b\n", bitrev16(v)) | ||
| 95 | #define print_val_bin_reverse32(v) xprintf(#v ": %032lb\n", bitrev32(v)) | ||
| 96 | |||
| 97 | #else /* NO_PRINT */ | ||
| 98 | |||
| 99 | #define xprintf | ||
| 100 | #define print | ||
| 101 | #define println | ||
| 119 | #define print_set_sendchar(func) | 102 | #define print_set_sendchar(func) |
| 120 | #define print_S(s) | ||
| 121 | #define print_P(s) | ||
| 122 | #define print_dec(data) | 103 | #define print_dec(data) |
| 123 | #define print_decs(data) | 104 | #define print_decs(data) |
| 124 | #define print_hex4(data) | 105 | #define print_hex4(data) |
| @@ -132,8 +113,30 @@ void print_crlf(void); | |||
| 132 | #define print_bin_reverse8(data) | 113 | #define print_bin_reverse8(data) |
| 133 | #define print_bin_reverse16(data) | 114 | #define print_bin_reverse16(data) |
| 134 | #define print_bin_reverse32(data) | 115 | #define print_bin_reverse32(data) |
| 135 | 116 | #define print_val_dec(v) | |
| 136 | #endif | 117 | #define print_val_decs(v) |
| 118 | #define print_val_hex8(v) | ||
| 119 | #define print_val_hex16(v) | ||
| 120 | #define print_val_hex32(v) | ||
| 121 | #define print_val_bin8(v) | ||
| 122 | #define print_val_bin16(v) | ||
| 123 | #define print_val_bin32(v) | ||
| 124 | #define print_val_bin_reverse8(v) | ||
| 125 | #define print_val_bin_reverse16(v) | ||
| 126 | #define print_val_bin_reverse32(v) | ||
| 127 | |||
| 128 | #endif /* NO_PRINT */ | ||
| 129 | |||
| 130 | |||
| 131 | /* Backward compatiblitly for old name */ | ||
| 132 | #define pdec(data) print_dec(data) | ||
| 133 | #define pdec16(data) print_dec(data) | ||
| 134 | #define phex(data) print_hex8(data) | ||
| 135 | #define phex16(data) print_hex16(data) | ||
| 136 | #define pbin(data) print_bin8(data) | ||
| 137 | #define pbin16(data) print_bin16(data) | ||
| 138 | #define pbin_reverse(data) print_bin_reverse8(data) | ||
| 139 | #define pbin_reverse16(data) print_bin_reverse16(data) | ||
| 137 | 140 | ||
| 138 | 141 | ||
| 139 | #endif | 142 | #endif |
diff --git a/keyboard/mbed_onekey/HIDKeyboard.cpp b/keyboard/mbed_onekey/HIDKeyboard.cpp new file mode 100644 index 000000000..f40c2d2f2 --- /dev/null +++ b/keyboard/mbed_onekey/HIDKeyboard.cpp | |||
| @@ -0,0 +1,256 @@ | |||
| 1 | #include <stdint.h> | ||
| 2 | #include "USBHID.h" | ||
| 3 | #include "USBHID_Types.h" | ||
| 4 | #include "USBDescriptor.h" | ||
| 5 | #include "HIDKeyboard.h" | ||
| 6 | |||
| 7 | #define DEFAULT_CONFIGURATION (1) | ||
| 8 | |||
| 9 | |||
| 10 | HIDKeyboard::HIDKeyboard(uint16_t vendor_id, uint16_t product_id, uint16_t product_release): USBDevice(vendor_id, product_id, product_release) | ||
| 11 | { | ||
| 12 | USBDevice::connect(); | ||
| 13 | } | ||
| 14 | |||
| 15 | bool HIDKeyboard::sendReport(report_keyboard_t report) { | ||
| 16 | USBDevice::write(EP1IN, report.raw, sizeof(report), MAX_PACKET_SIZE_EP1); | ||
| 17 | return true; | ||
| 18 | } | ||
| 19 | |||
| 20 | bool HIDKeyboard::USBCallback_setConfiguration(uint8_t configuration) { | ||
| 21 | if (configuration != DEFAULT_CONFIGURATION) { | ||
| 22 | return false; | ||
| 23 | } | ||
| 24 | |||
| 25 | // Configure endpoints > 0 | ||
| 26 | addEndpoint(EPINT_IN, MAX_PACKET_SIZE_EPINT); | ||
| 27 | //addEndpoint(EPINT_OUT, MAX_PACKET_SIZE_EPINT); | ||
| 28 | |||
| 29 | // We activate the endpoint to be able to recceive data | ||
| 30 | //readStart(EPINT_OUT, MAX_PACKET_SIZE_EPINT); | ||
| 31 | return true; | ||
| 32 | } | ||
| 33 | |||
| 34 | |||
| 35 | uint8_t * HIDKeyboard::stringImanufacturerDesc() { | ||
| 36 | static uint8_t stringImanufacturerDescriptor[] = { | ||
| 37 | 0x18, /*bLength*/ | ||
| 38 | STRING_DESCRIPTOR, /*bDescriptorType 0x03*/ | ||
| 39 | 't',0,'m',0,'k',0,'-',0,'k',0,'b',0,'d',0,'.',0,'c',0,'o',0,'m',0 /*bString iManufacturer*/ | ||
| 40 | }; | ||
| 41 | return stringImanufacturerDescriptor; | ||
| 42 | } | ||
| 43 | |||
| 44 | uint8_t * HIDKeyboard::stringIproductDesc() { | ||
| 45 | static uint8_t stringIproductDescriptor[] = { | ||
| 46 | 0x0a, /*bLength*/ | ||
| 47 | STRING_DESCRIPTOR, /*bDescriptorType 0x03*/ | ||
| 48 | 'm',0,'b',0,'e',0,'d',0 /*bString iProduct*/ | ||
| 49 | }; | ||
| 50 | return stringIproductDescriptor; | ||
| 51 | } | ||
| 52 | |||
| 53 | uint8_t * HIDKeyboard::stringIserialDesc() { | ||
| 54 | static uint8_t stringIserialDescriptor[] = { | ||
| 55 | 0x04, /*bLength*/ | ||
| 56 | STRING_DESCRIPTOR, /*bDescriptorType 0x03*/ | ||
| 57 | '0',0 /*bString iSerial*/ | ||
| 58 | }; | ||
| 59 | return stringIserialDescriptor; | ||
| 60 | } | ||
| 61 | |||
| 62 | uint8_t * HIDKeyboard::reportDesc() { | ||
| 63 | static uint8_t reportDescriptor[] = { | ||
| 64 | USAGE_PAGE(1), 0x01, // Generic Desktop | ||
| 65 | USAGE(1), 0x06, // Keyboard | ||
| 66 | COLLECTION(1), 0x01, // Application | ||
| 67 | |||
| 68 | USAGE_PAGE(1), 0x07, // Key Codes | ||
| 69 | USAGE_MINIMUM(1), 0xE0, | ||
| 70 | USAGE_MAXIMUM(1), 0xE7, | ||
| 71 | LOGICAL_MINIMUM(1), 0x00, | ||
| 72 | LOGICAL_MAXIMUM(1), 0x01, | ||
| 73 | REPORT_SIZE(1), 0x01, | ||
| 74 | REPORT_COUNT(1), 0x08, | ||
| 75 | INPUT(1), 0x02, // Data, Variable, Absolute | ||
| 76 | |||
| 77 | REPORT_COUNT(1), 0x01, | ||
| 78 | REPORT_SIZE(1), 0x08, | ||
| 79 | INPUT(1), 0x01, // Constant | ||
| 80 | |||
| 81 | REPORT_COUNT(1), 0x05, | ||
| 82 | REPORT_SIZE(1), 0x01, | ||
| 83 | USAGE_PAGE(1), 0x08, // LEDs | ||
| 84 | USAGE_MINIMUM(1), 0x01, | ||
| 85 | USAGE_MAXIMUM(1), 0x05, | ||
| 86 | OUTPUT(1), 0x02, // Data, Variable, Absolute | ||
| 87 | |||
| 88 | REPORT_COUNT(1), 0x01, | ||
| 89 | REPORT_SIZE(1), 0x03, | ||
| 90 | OUTPUT(1), 0x01, // Constant | ||
| 91 | |||
| 92 | |||
| 93 | REPORT_COUNT(1), 0x06, | ||
| 94 | REPORT_SIZE(1), 0x08, | ||
| 95 | LOGICAL_MINIMUM(1), 0x00, | ||
| 96 | LOGICAL_MAXIMUM(1), 0xFF, | ||
| 97 | USAGE_PAGE(1), 0x07, // Key Codes | ||
| 98 | USAGE_MINIMUM(1), 0x00, | ||
| 99 | USAGE_MAXIMUM(1), 0xFF, | ||
| 100 | INPUT(1), 0x00, // Data, Array | ||
| 101 | END_COLLECTION(0), | ||
| 102 | }; | ||
| 103 | reportLength = sizeof(reportDescriptor); | ||
| 104 | return reportDescriptor; | ||
| 105 | } | ||
| 106 | |||
| 107 | uint16_t HIDKeyboard::reportDescLength() { | ||
| 108 | reportDesc(); | ||
| 109 | return reportLength; | ||
| 110 | } | ||
| 111 | |||
| 112 | #define TOTAL_DESCRIPTOR_LENGTH ((1 * CONFIGURATION_DESCRIPTOR_LENGTH) \ | ||
| 113 | + (1 * INTERFACE_DESCRIPTOR_LENGTH) \ | ||
| 114 | + (1 * HID_DESCRIPTOR_LENGTH) \ | ||
| 115 | + (1 * ENDPOINT_DESCRIPTOR_LENGTH)) | ||
| 116 | uint8_t * HIDKeyboard::configurationDesc() { | ||
| 117 | static uint8_t configurationDescriptor[] = { | ||
| 118 | CONFIGURATION_DESCRIPTOR_LENGTH,// bLength | ||
| 119 | CONFIGURATION_DESCRIPTOR, // bDescriptorType | ||
| 120 | LSB(TOTAL_DESCRIPTOR_LENGTH), // wTotalLength (LSB) | ||
| 121 | MSB(TOTAL_DESCRIPTOR_LENGTH), // wTotalLength (MSB) | ||
| 122 | 0x01, // bNumInterfaces | ||
| 123 | DEFAULT_CONFIGURATION, // bConfigurationValue | ||
| 124 | 0x00, // iConfiguration | ||
| 125 | C_RESERVED | C_REMOTE_WAKEUP, // bmAttributes | ||
| 126 | C_POWER(100), // bMaxPowerHello World from Mbed | ||
| 127 | |||
| 128 | INTERFACE_DESCRIPTOR_LENGTH, // bLength | ||
| 129 | INTERFACE_DESCRIPTOR, // bDescriptorType | ||
| 130 | 0x00, // bInterfaceNumber | ||
| 131 | 0x00, // bAlternateSetting | ||
| 132 | 0x01, // bNumEndpoints | ||
| 133 | HID_CLASS, // bInterfaceClass | ||
| 134 | 1, // bInterfaceSubClass (boot) | ||
| 135 | 1, // bInterfaceProtocol (keyboard) | ||
| 136 | 0x00, // iInterface | ||
| 137 | |||
| 138 | HID_DESCRIPTOR_LENGTH, // bLength | ||
| 139 | HID_DESCRIPTOR, // bDescriptorType | ||
| 140 | LSB(HID_VERSION_1_11), // bcdHID (LSB) | ||
| 141 | MSB(HID_VERSION_1_11), // bcdHID (MSB) | ||
| 142 | 0x00, // bCountryCode | ||
| 143 | 0x01, // bNumDescriptors | ||
| 144 | REPORT_DESCRIPTOR, // bDescriptorType | ||
| 145 | (uint8_t)(LSB(reportDescLength())), // wDescriptorLength (LSB) | ||
| 146 | (uint8_t)(MSB(reportDescLength())), // wDescriptorLength (MSB) | ||
| 147 | |||
| 148 | ENDPOINT_DESCRIPTOR_LENGTH, // bLength | ||
| 149 | ENDPOINT_DESCRIPTOR, // bDescriptorType | ||
| 150 | PHY_TO_DESC(EP1IN), // bEndpointAddress | ||
| 151 | E_INTERRUPT, // bmAttributes | ||
| 152 | LSB(MAX_PACKET_SIZE_EPINT), // wMaxPacketSize (LSB) | ||
| 153 | MSB(MAX_PACKET_SIZE_EPINT), // wMaxPacketSize (MSB) | ||
| 154 | 1, // bInterval (milliseconds) | ||
| 155 | }; | ||
| 156 | return configurationDescriptor; | ||
| 157 | } | ||
| 158 | |||
| 159 | #if 0 | ||
| 160 | uint8_t * HIDKeyboard::deviceDesc() { | ||
| 161 | static uint8_t deviceDescriptor[] = { | ||
| 162 | DEVICE_DESCRIPTOR_LENGTH, /* bLength */ | ||
| 163 | DEVICE_DESCRIPTOR, /* bDescriptorType */ | ||
| 164 | LSB(USB_VERSION_2_0), /* bcdUSB (LSB) */ | ||
| 165 | MSB(USB_VERSION_2_0), /* bcdUSB (MSB) */ | ||
| 166 | 0x00, /* bDeviceClass */ | ||
| 167 | 0x00, /* bDeviceSubClass */ | ||
| 168 | 0x00, /* bDeviceprotocol */ | ||
| 169 | MAX_PACKET_SIZE_EP0, /* bMaxPacketSize0 */ | ||
| 170 | (uint8_t)(LSB(0xfeed)), /* idVendor (LSB) */ | ||
| 171 | (uint8_t)(MSB(0xfeed)), /* idVendor (MSB) */ | ||
| 172 | (uint8_t)(LSB(0x1bed)), /* idProduct (LSB) */ | ||
| 173 | (uint8_t)(MSB(0x1bed)), /* idProduct (MSB) */ | ||
| 174 | (uint8_t)(LSB(0x0002)), /* bcdDevice (LSB) */ | ||
| 175 | (uint8_t)(MSB(0x0002)), /* bcdDevice (MSB) */ | ||
| 176 | 0, /* iManufacturer */ | ||
| 177 | 0, /* iProduct */ | ||
| 178 | 0, /* iSerialNumber */ | ||
| 179 | 0x01 /* bNumConfigurations */ | ||
| 180 | }; | ||
| 181 | return deviceDescriptor; | ||
| 182 | } | ||
| 183 | #endif | ||
| 184 | |||
| 185 | bool HIDKeyboard::USBCallback_request() { | ||
| 186 | bool success = false; | ||
| 187 | CONTROL_TRANSFER * transfer = getTransferPtr(); | ||
| 188 | uint8_t *hidDescriptor; | ||
| 189 | |||
| 190 | // Process additional standard requests | ||
| 191 | |||
| 192 | if ((transfer->setup.bmRequestType.Type == STANDARD_TYPE)) | ||
| 193 | { | ||
| 194 | switch (transfer->setup.bRequest) | ||
| 195 | { | ||
| 196 | case GET_DESCRIPTOR: | ||
| 197 | switch (DESCRIPTOR_TYPE(transfer->setup.wValue)) | ||
| 198 | { | ||
| 199 | case REPORT_DESCRIPTOR: | ||
| 200 | if ((reportDesc() != NULL) \ | ||
| 201 | && (reportDescLength() != 0)) | ||
| 202 | { | ||
| 203 | transfer->remaining = reportDescLength(); | ||
| 204 | transfer->ptr = reportDesc(); | ||
| 205 | transfer->direction = DEVICE_TO_HOST; | ||
| 206 | success = true; | ||
| 207 | } | ||
| 208 | break; | ||
| 209 | case HID_DESCRIPTOR: | ||
| 210 | // Find the HID descriptor, after the configuration descriptor | ||
| 211 | hidDescriptor = findDescriptor(HID_DESCRIPTOR); | ||
| 212 | if (hidDescriptor != NULL) | ||
| 213 | { | ||
| 214 | transfer->remaining = HID_DESCRIPTOR_LENGTH; | ||
| 215 | transfer->ptr = hidDescriptor; | ||
| 216 | transfer->direction = DEVICE_TO_HOST; | ||
| 217 | success = true; | ||
| 218 | } | ||
| 219 | break; | ||
| 220 | |||
| 221 | default: | ||
| 222 | break; | ||
| 223 | } | ||
| 224 | break; | ||
| 225 | default: | ||
| 226 | break; | ||
| 227 | } | ||
| 228 | } | ||
| 229 | |||
| 230 | // Process class-specific requests | ||
| 231 | /* | ||
| 232 | if (transfer->setup.bmRequestType.Type == CLASS_TYPE) | ||
| 233 | { | ||
| 234 | switch (transfer->setup.bRequest) | ||
| 235 | { | ||
| 236 | case SET_REPORT: | ||
| 237 | // First byte will be used for report ID | ||
| 238 | //outputReport.data[0] = transfer->setup.wValue & 0xff; | ||
| 239 | //outputReport.length = transfer->setup.wLength + 1; | ||
| 240 | outputReport.length = transfer->setup.wLength; | ||
| 241 | |||
| 242 | //transfer->remaining = sizeof(outputReport.data) - 1; | ||
| 243 | //transfer->ptr = &outputReport.data[1]; | ||
| 244 | transfer->remaining = sizeof(outputReport.data); | ||
| 245 | transfer->ptr = &outputReport.data[0]; | ||
| 246 | transfer->direction = HOST_TO_DEVICE; | ||
| 247 | transfer->notify = true; | ||
| 248 | success = true; | ||
| 249 | default: | ||
| 250 | break; | ||
| 251 | } | ||
| 252 | } | ||
| 253 | */ | ||
| 254 | |||
| 255 | return success; | ||
| 256 | } | ||
diff --git a/keyboard/mbed_onekey/HIDKeyboard.h b/keyboard/mbed_onekey/HIDKeyboard.h new file mode 100644 index 000000000..b00c97b9b --- /dev/null +++ b/keyboard/mbed_onekey/HIDKeyboard.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | #ifndef HIDKEYBOARD_H | ||
| 2 | |||
| 3 | #include "stdint.h" | ||
| 4 | #include "stdbool.h" | ||
| 5 | #include "USBHID.h" | ||
| 6 | |||
| 7 | |||
| 8 | typedef union { | ||
| 9 | uint8_t raw[8]; | ||
| 10 | struct { | ||
| 11 | uint8_t mods; | ||
| 12 | uint8_t reserved; | ||
| 13 | uint8_t keys[6]; | ||
| 14 | }; | ||
| 15 | } __attribute__ ((packed)) report_keyboard_t; | ||
| 16 | |||
| 17 | |||
| 18 | class HIDKeyboard : public USBDevice { | ||
| 19 | public: | ||
| 20 | HIDKeyboard(uint16_t vendor_id = 0xFEED, uint16_t product_id = 0xabed, uint16_t product_release = 0x0001); | ||
| 21 | |||
| 22 | bool sendReport(report_keyboard_t report); | ||
| 23 | protected: | ||
| 24 | uint16_t reportLength; | ||
| 25 | virtual bool USBCallback_setConfiguration(uint8_t configuration); | ||
| 26 | virtual uint8_t * stringImanufacturerDesc(); | ||
| 27 | virtual uint8_t * stringIproductDesc(); | ||
| 28 | virtual uint8_t * stringIserialDesc(); | ||
| 29 | virtual uint16_t reportDescLength(); | ||
| 30 | virtual uint8_t * reportDesc(); | ||
| 31 | virtual uint8_t * configurationDesc(); | ||
| 32 | //virtual uint8_t * deviceDesc(); | ||
| 33 | virtual bool USBCallback_request(); | ||
| 34 | }; | ||
| 35 | |||
| 36 | #endif | ||
diff --git a/keyboard/mbed_onekey/Makefile b/keyboard/mbed_onekey/Makefile new file mode 100644 index 000000000..e194052c1 --- /dev/null +++ b/keyboard/mbed_onekey/Makefile | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # This file was automagically generated by mbed.org. For more information, | ||
| 2 | # see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded | ||
| 3 | |||
| 4 | PROJECT = USBKeyboard_HelloWorld | ||
| 5 | |||
| 6 | TMK_DIR = ../.. | ||
| 7 | MBED_DIR = ./mbed-sdk | ||
| 8 | |||
| 9 | #VPATH += $(MBED_DIR):$(TMK_DIR) | ||
| 10 | vpath %.s .:$(MBED_DIR):$(TMK_DIR) | ||
| 11 | vpath %.c .:$(MBED_DIR):$(TMK_DIR) | ||
| 12 | vpath %.cpp .:$(MBED_DIR):$(TMK_DIR) | ||
| 13 | |||
| 14 | OBJDIR = ./build | ||
| 15 | |||
| 16 | OBJECTS = \ | ||
| 17 | $(OBJDIR)/./HIDKeyboard.o \ | ||
| 18 | $(OBJDIR)/./main.o | ||
| 19 | |||
| 20 | SYS_OBJECTS = | ||
| 21 | |||
| 22 | INCLUDE_PATHS = -I. | ||
| 23 | |||
| 24 | LIBRARY_PATHS = | ||
| 25 | LIBRARIES = | ||
| 26 | |||
| 27 | include mbed.mk | ||
| 28 | include common.mk | ||
| 29 | include gcc.mk | ||
diff --git a/keyboard/mbed_onekey/common.mk b/keyboard/mbed_onekey/common.mk new file mode 100644 index 000000000..f21fce886 --- /dev/null +++ b/keyboard/mbed_onekey/common.mk | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | COMMON_DIR = common | ||
| 2 | OBJECTS += \ | ||
| 3 | # $(COMMON_DIR)/host.o \ | ||
| 4 | # $(COMMON_DIR)/keyboard.o \ | ||
| 5 | # $(COMMON_DIR)/action.o \ | ||
| 6 | # $(COMMON_DIR)/action_tapping.o \ | ||
| 7 | # $(COMMON_DIR)/action_macro.o \ | ||
| 8 | # $(COMMON_DIR)/action_layer.o \ | ||
| 9 | # $(COMMON_DIR)/action_util.o \ | ||
| 10 | # $(COMMON_DIR)/keymap.o \ | ||
| 11 | # $(COMMON_DIR)/timer.o \ | ||
| 12 | $(COMMON_DIR)/print.o \ | ||
| 13 | # $(COMMON_DIR)/bootloader.o \ | ||
| 14 | # $(COMMON_DIR)/suspend.o \ | ||
| 15 | $(COMMON_DIR)/xprintf.o \ | ||
| 16 | $(COMMON_DIR)/util.o | ||
| 17 | |||
| 18 | INCLUDE_PATHS += \ | ||
| 19 | -I$(TMK_DIR)/$(COMMON_DIR) | ||
diff --git a/keyboard/mbed_onekey/gcc.mk b/keyboard/mbed_onekey/gcc.mk new file mode 100644 index 000000000..e31527bbc --- /dev/null +++ b/keyboard/mbed_onekey/gcc.mk | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | ############################################################################### | ||
| 2 | GCC_BIN = | ||
| 3 | AS = $(GCC_BIN)arm-none-eabi-as | ||
| 4 | CC = $(GCC_BIN)arm-none-eabi-gcc | ||
| 5 | CPP = $(GCC_BIN)arm-none-eabi-g++ | ||
| 6 | LD = $(GCC_BIN)arm-none-eabi-gcc | ||
| 7 | OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy | ||
| 8 | OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump | ||
| 9 | SIZE = $(GCC_BIN)arm-none-eabi-size | ||
| 10 | CHKSUM = ~/Dropbox/MBED/tool/lpc-vector-checksum | ||
| 11 | |||
| 12 | CPU = -mcpu=cortex-m0 -mthumb | ||
| 13 | CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections | ||
| 14 | CC_FLAGS += -MMD -MP | ||
| 15 | CC_SYMBOLS = -DTARGET_LPC11U35_401 -DTARGET_M0 -DTARGET_NXP -DTARGET_LPC11UXX -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M0 -DARM_MATH_CM0 -DMBED_BUILD_TIMESTAMP=1399108688.49 -D__MBED__=1 | ||
| 16 | |||
| 17 | LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs | ||
| 18 | LD_FLAGS += -Wl,-Map=$(OBJDIR)/$(PROJECT).map,--cref | ||
| 19 | LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys | ||
| 20 | |||
| 21 | ifeq ($(DEBUG), 1) | ||
| 22 | CC_FLAGS += -DDEBUG -O0 | ||
| 23 | else | ||
| 24 | CC_FLAGS += -DNDEBUG -Os | ||
| 25 | endif | ||
| 26 | |||
| 27 | all: $(OBJDIR)/$(PROJECT).bin $(OBJDIR)/$(PROJECT).hex size | ||
| 28 | |||
| 29 | clean: | ||
| 30 | rm -f $(OBJDIR)/$(PROJECT).bin $(OBJDIR)/$(PROJECT).elf $(OBJDIR)/$(PROJECT).hex $(OBJDIR)/$(PROJECT).map $(OBJDIR)/$(PROJECT).lst $(OBJECTS) $(DEPS) | ||
| 31 | rm -fr $(OBJDIR) | ||
| 32 | |||
| 33 | $(OBJDIR)/%.o: %.s | ||
| 34 | mkdir -p $(@D) | ||
| 35 | $(AS) $(CPU) -o $@ $< | ||
| 36 | |||
| 37 | $(OBJDIR)/%.o: %.c | ||
| 38 | mkdir -p $(@D) | ||
| 39 | $(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $< | ||
| 40 | |||
| 41 | $(OBJDIR)/%.o: %.cpp | ||
| 42 | mkdir -p $(@D) | ||
| 43 | $(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 $(INCLUDE_PATHS) -o $@ $< | ||
| 44 | |||
| 45 | |||
| 46 | $(OBJDIR)/$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) | ||
| 47 | $(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS) | ||
| 48 | @echo "" | ||
| 49 | @echo "*****" | ||
| 50 | @echo "***** You must modify vector checksum value in *.bin and *.hex files." | ||
| 51 | @echo "*****" | ||
| 52 | @echo "" | ||
| 53 | |||
| 54 | $(OBJDIR)/$(PROJECT).bin: $(OBJDIR)/$(PROJECT).elf | ||
| 55 | @$(OBJCOPY) -O binary $< $@ | ||
| 56 | @echo "Writing vector checksum value into $@ ..." | ||
| 57 | @$(CHKSUM) $@ | ||
| 58 | @echo | ||
| 59 | |||
| 60 | $(OBJDIR)/$(PROJECT).hex: $(OBJDIR)/$(PROJECT).elf | ||
| 61 | @$(OBJCOPY) -O ihex $< $@ | ||
| 62 | |||
| 63 | $(OBJDIR)/$(PROJECT).lst: $(OBJDIR)/$(PROJECT).elf | ||
| 64 | @$(OBJDUMP) -Sdh $< > $@ | ||
| 65 | |||
| 66 | lst: $(OBJDIR)/$(PROJECT).lst | ||
| 67 | |||
| 68 | size: | ||
| 69 | $(SIZE) $(OBJDIR)/$(PROJECT).elf | ||
| 70 | |||
| 71 | prog: $(OBJDIR)/$(PROJECT).bin | ||
| 72 | @echo "Program..." | ||
| 73 | ifneq ($(shell mount | grep 'CRP DISABLD'),) | ||
| 74 | umount /dev/nxpisp >/dev/null 2>&1 | ||
| 75 | endif | ||
| 76 | dd if=$< of=/dev/nxpisp seek=4 | ||
| 77 | |||
| 78 | DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) | ||
| 79 | -include $(DEPS) | ||
diff --git a/keyboard/mbed_onekey/main.cpp b/keyboard/mbed_onekey/main.cpp new file mode 100644 index 000000000..581534e02 --- /dev/null +++ b/keyboard/mbed_onekey/main.cpp | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | #include "mbed.h" | ||
| 2 | #include "HIDKeyboard.h" | ||
| 3 | #include "debug.h" | ||
| 4 | |||
| 5 | /* | ||
| 6 | //#define DEBUG | ||
| 7 | #ifdef DEBUG | ||
| 8 | Serial ser(UART_TX, UART_RX); | ||
| 9 | #define dprintf(fmt, ...) ser.printf(fmt, ## __VA_ARGS__) | ||
| 10 | #else | ||
| 11 | #define dprintf(fmt, ...) | ||
| 12 | #endif | ||
| 13 | */ | ||
| 14 | |||
| 15 | |||
| 16 | // button and LEDs | ||
| 17 | DigitalIn isp(P0_1); | ||
| 18 | DigitalOut led_red(P0_20); | ||
| 19 | DigitalOut led_green(P0_21); | ||
| 20 | |||
| 21 | //USBKeyboard | ||
| 22 | HIDKeyboard keyboard; | ||
| 23 | |||
| 24 | |||
| 25 | int main(void) { | ||
| 26 | //isp.mode(PullUp); | ||
| 27 | //led_red = 0; | ||
| 28 | //led_green = 0; | ||
| 29 | debug_enable = true; | ||
| 30 | dprintf("HIDKeyboard:\n"); | ||
| 31 | print("aaa"); | ||
| 32 | |||
| 33 | report_keyboard_t report = { 2, 0, 4, }; //a | ||
| 34 | report_keyboard_t report_off = { 0 }; | ||
| 35 | while (1) { | ||
| 36 | //keyboard.mediaControl(KEY_VOLUME_DOWN); | ||
| 37 | //keyboard.printf("Hello World from Mbed\r\n"); | ||
| 38 | //keyboard.keyCode('s', KEY_CTRL); | ||
| 39 | //keyboard.keyCode(KEY_CAPS_LOCK); | ||
| 40 | |||
| 41 | //led_green = !led_green; | ||
| 42 | //leds = keyboard.lockStatus(); | ||
| 43 | //ser.putc(ser.getc()); | ||
| 44 | |||
| 45 | if (isp == 0) { | ||
| 46 | led_red = 0; // on | ||
| 47 | keyboard.sendReport(report); | ||
| 48 | } else { | ||
| 49 | led_red = 1; // off | ||
| 50 | keyboard.sendReport(report_off); | ||
| 51 | } | ||
| 52 | led_green = !led_green; | ||
| 53 | //wait(0.5); | ||
| 54 | } | ||
| 55 | } | ||
diff --git a/keyboard/mbed_onekey/mbed.mk b/keyboard/mbed_onekey/mbed.mk new file mode 100644 index 000000000..962a05e6e --- /dev/null +++ b/keyboard/mbed_onekey/mbed.mk | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | OBJECTS += \ | ||
| 2 | $(OBJDIR)/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/startup_LPC11xx.o \ | ||
| 3 | $(OBJDIR)/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/cmsis_nvic.o \ | ||
| 4 | $(OBJDIR)/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/system_LPC11Uxx.o \ | ||
| 5 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/port_api.o \ | ||
| 6 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/spi_api.o \ | ||
| 7 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/analogin_api.o \ | ||
| 8 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/gpio_api.o \ | ||
| 9 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/gpio_irq_api.o \ | ||
| 10 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/serial_api.o \ | ||
| 11 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/i2c_api.o \ | ||
| 12 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/pwmout_api.o \ | ||
| 13 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/sleep.o \ | ||
| 14 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/pinmap.o \ | ||
| 15 | $(OBJDIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/us_ticker.o \ | ||
| 16 | $(OBJDIR)/libraries/mbed/common/board.o \ | ||
| 17 | $(OBJDIR)/libraries/mbed/common/mbed_interface.o \ | ||
| 18 | $(OBJDIR)/libraries/mbed/common/exit.o \ | ||
| 19 | $(OBJDIR)/libraries/mbed/common/rtc_time.o \ | ||
| 20 | $(OBJDIR)/libraries/mbed/common/us_ticker_api.o \ | ||
| 21 | $(OBJDIR)/libraries/mbed/common/pinmap_common.o \ | ||
| 22 | $(OBJDIR)/libraries/mbed/common/error.o \ | ||
| 23 | $(OBJDIR)/libraries/mbed/common/gpio.o \ | ||
| 24 | $(OBJDIR)/libraries/mbed/common/semihost_api.o \ | ||
| 25 | $(OBJDIR)/libraries/mbed/common/wait_api.o \ | ||
| 26 | $(OBJDIR)/libraries/mbed/common/RawSerial.o \ | ||
| 27 | $(OBJDIR)/libraries/mbed/common/Ticker.o \ | ||
| 28 | $(OBJDIR)/libraries/mbed/common/FilePath.o \ | ||
| 29 | $(OBJDIR)/libraries/mbed/common/I2C.o \ | ||
| 30 | $(OBJDIR)/libraries/mbed/common/FileBase.o \ | ||
| 31 | $(OBJDIR)/libraries/mbed/common/retarget.o \ | ||
| 32 | $(OBJDIR)/libraries/mbed/common/Serial.o \ | ||
| 33 | $(OBJDIR)/libraries/mbed/common/Stream.o \ | ||
| 34 | $(OBJDIR)/libraries/mbed/common/FileSystemLike.o \ | ||
| 35 | $(OBJDIR)/libraries/mbed/common/CallChain.o \ | ||
| 36 | $(OBJDIR)/libraries/mbed/common/InterruptManager.o \ | ||
| 37 | $(OBJDIR)/libraries/mbed/common/SerialBase.o \ | ||
| 38 | $(OBJDIR)/libraries/mbed/common/BusInOut.o \ | ||
| 39 | $(OBJDIR)/libraries/mbed/common/SPISlave.o \ | ||
| 40 | $(OBJDIR)/libraries/mbed/common/I2CSlave.o \ | ||
| 41 | $(OBJDIR)/libraries/mbed/common/FunctionPointer.o \ | ||
| 42 | $(OBJDIR)/libraries/mbed/common/Timer.o \ | ||
| 43 | $(OBJDIR)/libraries/mbed/common/SPI.o \ | ||
| 44 | $(OBJDIR)/libraries/mbed/common/Timeout.o \ | ||
| 45 | $(OBJDIR)/libraries/mbed/common/Ethernet.o \ | ||
| 46 | $(OBJDIR)/libraries/mbed/common/TimerEvent.o \ | ||
| 47 | $(OBJDIR)/libraries/mbed/common/CAN.o \ | ||
| 48 | $(OBJDIR)/libraries/mbed/common/BusOut.o \ | ||
| 49 | $(OBJDIR)/libraries/mbed/common/FileLike.o \ | ||
| 50 | $(OBJDIR)/libraries/mbed/common/BusIn.o \ | ||
| 51 | $(OBJDIR)/libraries/mbed/common/InterruptIn.o \ | ||
| 52 | $(OBJDIR)/libraries/mbed/common/LocalFileSystem.o \ | ||
| 53 | $(OBJDIR)/libraries/USBDevice/USBHID/USBMouse.o \ | ||
| 54 | $(OBJDIR)/libraries/USBDevice/USBHID/USBHID.o \ | ||
| 55 | $(OBJDIR)/libraries/USBDevice/USBHID/USBMouseKeyboard.o \ | ||
| 56 | $(OBJDIR)/libraries/USBDevice/USBHID/USBKeyboard.o \ | ||
| 57 | $(OBJDIR)/libraries/USBDevice/USBDevice/USBHAL_KL25Z.o \ | ||
| 58 | $(OBJDIR)/libraries/USBDevice/USBDevice/USBDevice.o \ | ||
| 59 | $(OBJDIR)/libraries/USBDevice/USBDevice/USBHAL_LPC17.o \ | ||
| 60 | $(OBJDIR)/libraries/USBDevice/USBDevice/USBHAL_LPC40.o \ | ||
| 61 | $(OBJDIR)/libraries/USBDevice/USBDevice/USBHAL_LPC11U.o \ | ||
| 62 | $(OBJDIR)/libraries/USBDevice/USBDevice/USBHAL_STM32F4.o \ | ||
| 63 | $(OBJDIR)/libraries/USBDevice/USBAudio/USBAudio.o \ | ||
| 64 | $(OBJDIR)/libraries/USBDevice/USBSerial/USBSerial.o \ | ||
| 65 | $(OBJDIR)/libraries/USBDevice/USBSerial/USBCDC.o \ | ||
| 66 | $(OBJDIR)/libraries/USBDevice/USBMSD/USBMSD.o \ | ||
| 67 | $(OBJDIR)/libraries/USBDevice/USBMIDI/USBMIDI.o | ||
| 68 | |||
| 69 | INCLUDE_PATHS += \ | ||
| 70 | -I$(MBED_DIR)/libraries/mbed/targets \ | ||
| 71 | -I$(MBED_DIR)/libraries/mbed/targets/hal \ | ||
| 72 | -I$(MBED_DIR)/libraries/mbed/targets/hal/TARGET_NXP \ | ||
| 73 | -I$(MBED_DIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX \ | ||
| 74 | -I$(MBED_DIR)/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/TARGET_LPC11U35_401 \ | ||
| 75 | -I$(MBED_DIR)/libraries/mbed/targets/cmsis \ | ||
| 76 | -I$(MBED_DIR)/libraries/mbed/targets/cmsis/TARGET_NXP \ | ||
| 77 | -I$(MBED_DIR)/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX \ | ||
| 78 | -I$(MBED_DIR)/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM \ | ||
| 79 | -I$(MBED_DIR)/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11U35_401 \ | ||
| 80 | -I$(MBED_DIR)/libraries/mbed \ | ||
| 81 | -I$(MBED_DIR)/libraries/mbed/hal \ | ||
| 82 | -I$(MBED_DIR)/libraries/mbed/api \ | ||
| 83 | -I$(MBED_DIR)/libraries/mbed/common \ | ||
| 84 | -I$(MBED_DIR)/libraries/USBDevice \ | ||
| 85 | -I$(MBED_DIR)/libraries/USBDevice/USBHID \ | ||
| 86 | -I$(MBED_DIR)/libraries/USBDevice/USBDevice \ | ||
| 87 | -I$(MBED_DIR)/libraries/USBDevice/USBAudio \ | ||
| 88 | -I$(MBED_DIR)/libraries/USBDevice/USBSerial \ | ||
| 89 | -I$(MBED_DIR)/libraries/USBDevice/USBMSD \ | ||
| 90 | -I$(MBED_DIR)/libraries/USBDevice/USBMIDI | ||
| 91 | |||
| 92 | LINKER_SCRIPT = $(MBED_DIR)/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11U35_401/LPC11U35.ld | ||
