keyboard example works with lpc1347 xpresso

This commit is contained in:
hathach 2013-05-29 15:23:07 +07:00
parent dda0808ebb
commit d5836751d9
4 changed files with 15 additions and 7 deletions

View File

@ -86,6 +86,7 @@
//------------- CLASS -------------// //------------- CLASS -------------//
#define TUSB_CFG_DEVICE_HID_KEYBOARD 1 #define TUSB_CFG_DEVICE_HID_KEYBOARD 1
#define TUSB_CFG_DEVICE_HID_MOUSE 0 #define TUSB_CFG_DEVICE_HID_MOUSE 0
#define TUSB_CFG_DEVICE_HID_GENERIC 0
#define TUSB_CFG_DEVICE_MSC 0 #define TUSB_CFG_DEVICE_MSC 0
//#define TUSB_CFG_DEVICE_CDC //#define TUSB_CFG_DEVICE_CDC
@ -101,7 +102,7 @@
#ifdef __CODE_RED // make use of code red's support for ram region macros #ifdef __CODE_RED // make use of code red's support for ram region macros
#if (MCU == MCU_LPC11UXX) || (MCU == MCU_LPC13UXX) #if (MCU == MCU_LPC11UXX) || (MCU == MCU_LPC13UXX)
#define TUSB_RAM_SECTION ".data.$RAM2" #define TUSB_RAM_SECTION ".data.$RAM1"
#elif (MCU == MCU_LPC43XX) #elif (MCU == MCU_LPC43XX)
#define TUSB_RAM_SECTION ".data.$RAM3" #define TUSB_RAM_SECTION ".data.$RAM3"
#endif #endif

View File

@ -76,25 +76,25 @@ typedef ATTR_PACKED_STRUCT(struct)
#define INTERFACES_OF_CDC 0 #define INTERFACES_OF_CDC 0
#endif #endif
#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD #if TUSB_CFG_DEVICE_HID_KEYBOARD
#define INTERFACES_OF_HID_KEYBOARD 1 #define INTERFACES_OF_HID_KEYBOARD 1
#else #else
#define INTERFACES_OF_HID_KEYBOARD 0 #define INTERFACES_OF_HID_KEYBOARD 0
#endif #endif
#ifdef TUSB_CFG_DEVICE_HID_MOUSE #if TUSB_CFG_DEVICE_HID_MOUSE
#define INTERFACES_OF_HID_MOUSE 1 #define INTERFACES_OF_HID_MOUSE 1
#else #else
#define INTERFACES_OF_HID_MOUSE 0 #define INTERFACES_OF_HID_MOUSE 0
#endif #endif
#ifdef CFG_USB_HID_GENERIC #if TUSB_CFG_HOST_HID_GENERIC
#define INTERFACES_OF_HID_GENERIC 1 #define INTERFACES_OF_HID_GENERIC 1
#else #else
#define INTERFACES_OF_HID_GENERIC 0 #define INTERFACES_OF_HID_GENERIC 0
#endif #endif
#ifdef CFG_USB_MASS_STORAGE #if CFG_USB_MASS_STORAGE
#define INTERFACES_OF_MASS_STORAGE 2 #define INTERFACES_OF_MASS_STORAGE 2
#else #else
#define INTERFACES_OF_MASS_STORAGE 0 #define INTERFACES_OF_MASS_STORAGE 0

View File

@ -172,12 +172,12 @@ tusb_error_t dcd_controller_reset(uint8_t coreid)
void dcd_controller_connect(uint8_t coreid) void dcd_controller_connect(uint8_t coreid)
{ {
// ROM_API->hw->Connect(g_hUsb, 1); ROM_API->hw->Connect(g_hUsb, 1);
} }
void dcd_isr(uint8_t coreid) void dcd_isr(uint8_t coreid)
{ {
// ROM_API->hw->ISR(g_hUsb); ROM_API->hw->ISR(g_hUsb);
} }
#endif #endif

View File

@ -54,7 +54,14 @@ tusb_error_t hal_init()
LPC_IOCON->PIO0_6 &= ~0x07; LPC_IOCON->PIO0_6 &= ~0x07;
LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */ LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */
hal_interrupt_enable(0);
return TUSB_ERROR_NONE; return TUSB_ERROR_NONE;
} }
void USB_IRQHandler(void)
{
tusb_isr(0);
}
#endif #endif