Reading data from a USB Gamepad with USB-Host mode.
Fork of Nucleo_Ex04_USBPAD by
USBHost/USBHALHost.h@2:7c1379b29ce6, 2016-04-28 (annotated)
- Committer:
- jose_23991
- Date:
- Thu Apr 28 21:17:29 2016 +0000
- Revision:
- 2:7c1379b29ce6
- Parent:
- 0:b5f79b4f741d
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
beaglescout007 | 0:b5f79b4f741d | 1 | #include "mbed.h" |
beaglescout007 | 0:b5f79b4f741d | 2 | |
beaglescout007 | 0:b5f79b4f741d | 3 | struct SETUP_PACKET { |
beaglescout007 | 0:b5f79b4f741d | 4 | uint8_t bmRequestType; |
beaglescout007 | 0:b5f79b4f741d | 5 | uint8_t bRequest; |
beaglescout007 | 0:b5f79b4f741d | 6 | uint16_t wValue; |
beaglescout007 | 0:b5f79b4f741d | 7 | uint16_t wIndex; |
beaglescout007 | 0:b5f79b4f741d | 8 | uint16_t wLength; |
beaglescout007 | 0:b5f79b4f741d | 9 | SETUP_PACKET(uint8_t RequestType, uint8_t Request, uint16_t Value, uint16_t Index, uint16_t Length) { |
beaglescout007 | 0:b5f79b4f741d | 10 | bmRequestType = RequestType; |
beaglescout007 | 0:b5f79b4f741d | 11 | bRequest = Request; |
beaglescout007 | 0:b5f79b4f741d | 12 | wValue = Value; |
beaglescout007 | 0:b5f79b4f741d | 13 | wIndex = Index; |
beaglescout007 | 0:b5f79b4f741d | 14 | wLength = Length; |
beaglescout007 | 0:b5f79b4f741d | 15 | } |
beaglescout007 | 0:b5f79b4f741d | 16 | }; |
beaglescout007 | 0:b5f79b4f741d | 17 | |
beaglescout007 | 0:b5f79b4f741d | 18 | #if defined(TARGET_NUCLEO_F401RE)||defined(TARGET_NUCLEO_F411RE)||defined(TARGET_NUCLEO_F446RE) |
beaglescout007 | 0:b5f79b4f741d | 19 | #include "USBHALHost_F401RE.h" |
beaglescout007 | 0:b5f79b4f741d | 20 | #elif defined(TARGET_KL46Z)||defined(TARGET_KL25Z)||defined(TARGET_K64F) |
beaglescout007 | 0:b5f79b4f741d | 21 | #include "USBHALHost_KL46Z.h" |
beaglescout007 | 0:b5f79b4f741d | 22 | #elif defined(TARGET_LPC4088)||defined(TARGET_LPC1768) |
beaglescout007 | 0:b5f79b4f741d | 23 | #include "USBHALHost_LPC4088.h" |
beaglescout007 | 0:b5f79b4f741d | 24 | #else |
beaglescout007 | 0:b5f79b4f741d | 25 | #error "target error" |
beaglescout007 | 0:b5f79b4f741d | 26 | #endif |
beaglescout007 | 0:b5f79b4f741d | 27 | |
beaglescout007 | 0:b5f79b4f741d | 28 | #ifndef CTASSERT |
beaglescout007 | 0:b5f79b4f741d | 29 | template <bool>struct CtAssert; |
beaglescout007 | 0:b5f79b4f741d | 30 | template <>struct CtAssert<true> {}; |
beaglescout007 | 0:b5f79b4f741d | 31 | #define CTASSERT(A) CtAssert<A>(); |
beaglescout007 | 0:b5f79b4f741d | 32 | #endif // CTASSERT |
beaglescout007 | 0:b5f79b4f741d | 33 | |
beaglescout007 | 0:b5f79b4f741d | 34 | |
beaglescout007 | 0:b5f79b4f741d | 35 |