diff options
| author | Ha Thach <[email protected]> | 2024-04-08 12:30:25 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-08 12:30:25 +0700 |
| commit | af1346c74878aaec8549483ae6371614f550c863 (patch) | |
| tree | 7cb60fe7130e66839019bc43bf7c7385f926c155 /src | |
| parent | ffab7bf9dde0c0e960feeb5c1264823ca5a0ced7 (diff) | |
| parent | d6d8acad90c8a1578dcbd886154fbb3f2bd1a363 (diff) | |
Merge pull request #2466 from wavenumber-eng/MCX
TinyUSB stack ported to MCXA and MXCN freedom boards.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/tusb_mcu.h | 7 | ||||
| -rw-r--r-- | src/portable/chipidea/ci_fs/ci_fs_mcx.h | 25 | ||||
| -rw-r--r-- | src/portable/chipidea/ci_fs/dcd_ci_fs.c | 2 | ||||
| -rw-r--r-- | src/tusb_option.h | 1 |
4 files changed, 26 insertions, 9 deletions
diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h index 308ee713c..688b9a352 100644 --- a/src/common/tusb_mcu.h +++ b/src/common/tusb_mcu.h @@ -100,6 +100,13 @@ #define TUP_DCD_ENDPOINT_MAX 8 #define TUP_RHPORT_HIGHSPEED 1 +#elif TU_CHECK_MCU(OPT_MCU_MCXA15) + // USB0 is chipidea FS + #define TUP_USBIP_CHIPIDEA_FS + #define TUP_USBIP_CHIPIDEA_FS_MCX + + #define TUP_DCD_ENDPOINT_MAX 16 + #elif TU_CHECK_MCU(OPT_MCU_MIMXRT1XXX) #define TUP_USBIP_CHIPIDEA_HS #define TUP_USBIP_EHCI diff --git a/src/portable/chipidea/ci_fs/ci_fs_mcx.h b/src/portable/chipidea/ci_fs/ci_fs_mcx.h index 3bfcd398e..4b93a03a7 100644 --- a/src/portable/chipidea/ci_fs/ci_fs_mcx.h +++ b/src/portable/chipidea/ci_fs/ci_fs_mcx.h @@ -29,19 +29,28 @@ #include "fsl_device_registers.h" -#define CI_FS_REG(_port) ((ci_fs_regs_t*) USBFS0_BASE) -#define CI_REG CI_FS_REG(0) +#if CFG_TUSB_MCU == OPT_MCU_MCXN9 + #define CI_FS_REG(_port) ((ci_fs_regs_t*) USBFS0_BASE) + #define CIFS_IRQN USB0_FS_IRQn -void dcd_int_enable(uint8_t rhport) -{ +#elif CFG_TUSB_MCU == OPT_MCU_MCXA15 + #define CI_FS_REG(_port) ((ci_fs_regs_t*) USB0_BASE) + #define CIFS_IRQN USB0_IRQn + +#else + #error "MCU is not supported" +#endif + +#define CI_REG CI_FS_REG(0) + +void dcd_int_enable(uint8_t rhport) { (void) rhport; - NVIC_EnableIRQ(USB0_FS_IRQn); + NVIC_EnableIRQ(CIFS_IRQN); } -void dcd_int_disable(uint8_t rhport) -{ +void dcd_int_disable(uint8_t rhport) { (void) rhport; - NVIC_DisableIRQ(USB0_FS_IRQn); + NVIC_DisableIRQ(CIFS_IRQN); } #endif diff --git a/src/portable/chipidea/ci_fs/dcd_ci_fs.c b/src/portable/chipidea/ci_fs/dcd_ci_fs.c index a68ecf8c9..02f813ab5 100644 --- a/src/portable/chipidea/ci_fs/dcd_ci_fs.c +++ b/src/portable/chipidea/ci_fs/dcd_ci_fs.c @@ -295,7 +295,7 @@ void dcd_init(uint8_t rhport) CI_REG->INT_EN = USB_INTEN_USBRSTEN_MASK; dcd_connect(rhport); - // NVIC_ClearPendingIRQ(USB0_IRQn); + // NVIC_ClearPendingIRQ(CIFS_IRQN); } void dcd_set_address(uint8_t rhport, uint8_t dev_addr) diff --git a/src/tusb_option.h b/src/tusb_option.h index 812074c44..2921d3ae0 100644 --- a/src/tusb_option.h +++ b/src/tusb_option.h @@ -180,6 +180,7 @@ // NXP LPC MCX #define OPT_MCU_MCXN9 2300 ///< NXP MCX N9 Series +#define OPT_MCU_MCXA15 2301 ///< NXP MCX A15 Series // Check if configured MCU is one of listed // Apply _TU_CHECK_MCU with || as separator to list of input |
