mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
adding tud_isr/tuh_isr with lpc18/43
This commit is contained in:
parent
9fe34c2e62
commit
bbec47b647
@ -16,9 +16,6 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc43xx/lpc_chip_43xx
|
|||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = hw/bsp/ea4357/lpc4357.ld
|
LD_FILE = hw/bsp/ea4357/lpc4357.ld
|
||||||
|
|
||||||
# TODO remove later
|
|
||||||
SRC_C += src/portable/$(VENDOR)/$(CHIP_FAMILY)/hal_$(CHIP_FAMILY).c
|
|
||||||
|
|
||||||
SRC_C += \
|
SRC_C += \
|
||||||
$(MCU_DIR)/../gcc/cr_startup_lpc43xx.c \
|
$(MCU_DIR)/../gcc/cr_startup_lpc43xx.c \
|
||||||
$(MCU_DIR)/src/chip_18xx_43xx.c \
|
$(MCU_DIR)/src/chip_18xx_43xx.c \
|
||||||
|
@ -230,6 +230,31 @@ void board_init(void)
|
|||||||
// TODO Remove R170, R171, solder a pair of 15K to USB1 D+/D- to test with USB1 Host
|
// TODO Remove R170, R171, solder a pair of 15K to USB1 D+/D- to test with USB1 Host
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// USB Interrupt Handler
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
void USB0_IRQHandler(void)
|
||||||
|
{
|
||||||
|
#if TUSB_OPT_HOST_ENABLED
|
||||||
|
tuh_isr(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TUSB_OPT_DEVICE_ENABLED
|
||||||
|
tud_isr(0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void USB1_IRQHandler(void)
|
||||||
|
{
|
||||||
|
#if TUSB_OPT_HOST_ENABLED
|
||||||
|
tuh_isr(1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TUSB_OPT_DEVICE_ENABLED
|
||||||
|
tud_isr(1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Board porting API
|
// Board porting API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@ -16,9 +16,6 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc18xx/lpc_chip_18xx
|
|||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = hw/bsp/mcb1800/lpc1857.ld
|
LD_FILE = hw/bsp/mcb1800/lpc1857.ld
|
||||||
|
|
||||||
# TODO remove later
|
|
||||||
SRC_C += src/portable/$(VENDOR)/$(CHIP_FAMILY)/hal_$(CHIP_FAMILY).c
|
|
||||||
|
|
||||||
SRC_C += \
|
SRC_C += \
|
||||||
$(MCU_DIR)/../gcc/cr_startup_lpc18xx.c \
|
$(MCU_DIR)/../gcc/cr_startup_lpc18xx.c \
|
||||||
$(MCU_DIR)/src/chip_18xx_43xx.c \
|
$(MCU_DIR)/src/chip_18xx_43xx.c \
|
||||||
|
@ -172,6 +172,31 @@ void board_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// USB Interrupt Handler
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
void USB0_IRQHandler(void)
|
||||||
|
{
|
||||||
|
#if TUSB_OPT_HOST_ENABLED
|
||||||
|
tuh_isr(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TUSB_OPT_DEVICE_ENABLED
|
||||||
|
tud_isr(0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void USB1_IRQHandler(void)
|
||||||
|
{
|
||||||
|
#if TUSB_OPT_HOST_ENABLED
|
||||||
|
tuh_isr(1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TUSB_OPT_DEVICE_ENABLED
|
||||||
|
tud_isr(1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Board porting API
|
// Board porting API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@ -16,9 +16,6 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc43xx/lpc_chip_43xx
|
|||||||
# All source paths should be relative to the top level.
|
# All source paths should be relative to the top level.
|
||||||
LD_FILE = hw/bsp/$(BOARD)/ngx4330.ld
|
LD_FILE = hw/bsp/$(BOARD)/ngx4330.ld
|
||||||
|
|
||||||
# TODO remove later
|
|
||||||
SRC_C += src/portable/$(VENDOR)/$(CHIP_FAMILY)/hal_$(CHIP_FAMILY).c
|
|
||||||
|
|
||||||
SRC_C += \
|
SRC_C += \
|
||||||
$(MCU_DIR)/../gcc/cr_startup_lpc43xx.c \
|
$(MCU_DIR)/../gcc/cr_startup_lpc43xx.c \
|
||||||
$(MCU_DIR)/src/chip_18xx_43xx.c \
|
$(MCU_DIR)/src/chip_18xx_43xx.c \
|
||||||
|
@ -219,6 +219,31 @@ void board_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// USB Interrupt Handler
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
void USB0_IRQHandler(void)
|
||||||
|
{
|
||||||
|
#if TUSB_OPT_HOST_ENABLED
|
||||||
|
tuh_isr(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TUSB_OPT_DEVICE_ENABLED
|
||||||
|
tud_isr(0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void USB1_IRQHandler(void)
|
||||||
|
{
|
||||||
|
#if TUSB_OPT_HOST_ENABLED
|
||||||
|
tuh_isr(1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TUSB_OPT_DEVICE_ENABLED
|
||||||
|
tud_isr(1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Board porting API
|
// Board porting API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@ -47,6 +47,9 @@ bool tud_init (void);
|
|||||||
// Task function should be called in main/rtos loop
|
// Task function should be called in main/rtos loop
|
||||||
void tud_task (void);
|
void tud_task (void);
|
||||||
|
|
||||||
|
// Interrupt handler, name alias to DCD
|
||||||
|
#define tud_isr dcd_isr
|
||||||
|
|
||||||
// Check if device is connected and configured
|
// Check if device is connected and configured
|
||||||
bool tud_mounted(void);
|
bool tud_mounted(void);
|
||||||
|
|
||||||
|
@ -68,6 +68,9 @@ typedef struct {
|
|||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
void tuh_task(void);
|
void tuh_task(void);
|
||||||
|
|
||||||
|
// Interrupt handler, name alias to HCD
|
||||||
|
#define tuh_isr hcd_isr
|
||||||
|
|
||||||
tusb_device_state_t tuh_device_get_state (uint8_t dev_addr);
|
tusb_device_state_t tuh_device_get_state (uint8_t dev_addr);
|
||||||
static inline bool tuh_device_is_configured(uint8_t dev_addr)
|
static inline bool tuh_device_is_configured(uint8_t dev_addr)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user