feat(ch32f20x): add support of ch32f20x
This commit is contained in:
@@ -383,6 +383,10 @@
|
||||
#elif TU_CHECK_MCU(OPT_MCU_CH32V307)
|
||||
#define TUP_DCD_ENDPOINT_MAX 16
|
||||
#define TUP_RHPORT_HIGHSPEED 1
|
||||
|
||||
#elif TU_CHECK_MCU(OPT_MCU_CH32F20X)
|
||||
#define TUP_DCD_ENDPOINT_MAX 16
|
||||
#define TUP_RHPORT_HIGHSPEED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -1,7 +1,11 @@
|
||||
#ifndef _USB_CH32_USBHS_REG_H
|
||||
#define _USB_CH32_USBHS_REG_H
|
||||
|
||||
#if (CFG_TUSB_MCU == OPT_MCU_CH32V307)
|
||||
#include <ch32v30x.h>
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_CH32F20X)
|
||||
#include <ch32f20x.h>
|
||||
#endif
|
||||
|
||||
/******************* GLOBAL ******************/
|
||||
|
@@ -26,11 +26,11 @@
|
||||
|
||||
#include "tusb_option.h"
|
||||
|
||||
#if CFG_TUD_ENABLED && (CFG_TUSB_MCU == OPT_MCU_CH32V307)
|
||||
#if CFG_TUD_ENABLED && ((CFG_TUSB_MCU == OPT_MCU_CH32V307) || (CFG_TUSB_MCU == OPT_MCU_CH32F20X))
|
||||
#include "device/dcd.h"
|
||||
|
||||
#include "ch32_usbhs_reg.h"
|
||||
#include "core_riscv.h"
|
||||
|
||||
|
||||
// Max number of bi-directional endpoints including EP0
|
||||
#define EP_MAX 16
|
||||
@@ -73,7 +73,7 @@ void dcd_init(uint8_t rhport) {
|
||||
#if TUD_OPT_HIGH_SPEED
|
||||
USBHSD->CONTROL = USBHS_DMA_EN | USBHS_INT_BUSY_EN | USBHS_HIGH_SPEED;
|
||||
#else
|
||||
#error OPT_MODE_FULL_SPEED not currently supported on CH32V307
|
||||
#error OPT_MODE_FULL_SPEED not currently supported on CH32
|
||||
USBHSD->CONTROL = USBHS_DMA_EN | USBHS_INT_BUSY_EN | USBHS_FULL_SPEED;
|
||||
#endif
|
||||
|
@@ -169,6 +169,7 @@
|
||||
|
||||
// WCH
|
||||
#define OPT_MCU_CH32V307 2200 ///< WCH CH32V307
|
||||
#define OPT_MCU_CH32F20X 2210 ///< WCH CH32F20x
|
||||
|
||||
|
||||
// NXP LPC MCX
|
||||
|
Reference in New Issue
Block a user