mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
keyboard example works with lpc1347 xpresso
This commit is contained in:
parent
dda0808ebb
commit
d5836751d9
@ -86,6 +86,7 @@
|
||||
//------------- CLASS -------------//
|
||||
#define TUSB_CFG_DEVICE_HID_KEYBOARD 1
|
||||
#define TUSB_CFG_DEVICE_HID_MOUSE 0
|
||||
#define TUSB_CFG_DEVICE_HID_GENERIC 0
|
||||
#define TUSB_CFG_DEVICE_MSC 0
|
||||
//#define TUSB_CFG_DEVICE_CDC
|
||||
|
||||
@ -101,7 +102,7 @@
|
||||
|
||||
#ifdef __CODE_RED // make use of code red's support for ram region macros
|
||||
#if (MCU == MCU_LPC11UXX) || (MCU == MCU_LPC13UXX)
|
||||
#define TUSB_RAM_SECTION ".data.$RAM2"
|
||||
#define TUSB_RAM_SECTION ".data.$RAM1"
|
||||
#elif (MCU == MCU_LPC43XX)
|
||||
#define TUSB_RAM_SECTION ".data.$RAM3"
|
||||
#endif
|
||||
|
@ -76,25 +76,25 @@ typedef ATTR_PACKED_STRUCT(struct)
|
||||
#define INTERFACES_OF_CDC 0
|
||||
#endif
|
||||
|
||||
#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
#define INTERFACES_OF_HID_KEYBOARD 1
|
||||
#else
|
||||
#define INTERFACES_OF_HID_KEYBOARD 0
|
||||
#endif
|
||||
|
||||
#ifdef TUSB_CFG_DEVICE_HID_MOUSE
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
#define INTERFACES_OF_HID_MOUSE 1
|
||||
#else
|
||||
#define INTERFACES_OF_HID_MOUSE 0
|
||||
#endif
|
||||
|
||||
#ifdef CFG_USB_HID_GENERIC
|
||||
#if TUSB_CFG_HOST_HID_GENERIC
|
||||
#define INTERFACES_OF_HID_GENERIC 1
|
||||
#else
|
||||
#define INTERFACES_OF_HID_GENERIC 0
|
||||
#endif
|
||||
|
||||
#ifdef CFG_USB_MASS_STORAGE
|
||||
#if CFG_USB_MASS_STORAGE
|
||||
#define INTERFACES_OF_MASS_STORAGE 2
|
||||
#else
|
||||
#define INTERFACES_OF_MASS_STORAGE 0
|
||||
|
@ -172,12 +172,12 @@ tusb_error_t dcd_controller_reset(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)
|
||||
{
|
||||
// ROM_API->hw->ISR(g_hUsb);
|
||||
ROM_API->hw->ISR(g_hUsb);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -54,7 +54,14 @@ tusb_error_t hal_init()
|
||||
LPC_IOCON->PIO0_6 &= ~0x07;
|
||||
LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */
|
||||
|
||||
hal_interrupt_enable(0);
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
void USB_IRQHandler(void)
|
||||
{
|
||||
tusb_isr(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user