add support for EFM32GG

merge GG12 GG12 to simply OPT_MCU_EFM32GG
This commit is contained in:
hathach
2021-10-30 20:42:55 +07:00
parent 660e8b8c88
commit 9cd5a87c64
14 changed files with 204 additions and 126 deletions
+1 -1
View File
@@ -125,7 +125,7 @@
#elif CFG_TUSB_MCU == OPT_MCU_RP2040
#include "pico.h"
#elif CFG_TUSB_MCU == OPT_MCU_EFM32GG || CFG_TUSB_MCU == OPT_MCU_EFM32GG11 || CFG_TUSB_MCU == OPT_MCU_EFM32GG12
#elif CFG_TUSB_MCU == OPT_MCU_EFM32GG
#include "em_device.h"
#elif CFG_TUSB_MCU == OPT_MCU_RX63X || CFG_TUSB_MCU == OPT_MCU_RX65X
+2 -2
View File
@@ -8,7 +8,7 @@ CFLAGS += \
-D__STARTUP_CLEAR_BSS \
-D__START=main \
-DEFM32GG12B810F1024GM64 \
-DCFG_TUSB_MCU=OPT_MCU_EFM32GG12
-DCFG_TUSB_MCU=OPT_MCU_EFM32GG
# mcu driver cause following warnings
#CFLAGS += -Wno-error=unused-parameter
@@ -24,7 +24,7 @@ LD_FILE = $(SILABS_CMSIS)/Source/GCC/$(SILABS_FAMILY).ld
SRC_C += \
$(SILABS_CMSIS)/Source/system_$(SILABS_FAMILY).c \
src/portable/silabs/efm32/dcd_efm32.c
src/portable/synopsys/dwc2/dcd_dwc2.c
SRC_S += \
$(SILABS_CMSIS)/Source/GCC/startup_$(SILABS_FAMILY).S
+7
View File
@@ -36,6 +36,11 @@ void OTG_FS_IRQHandler(void)
tud_int_handler(0);
}
void OTG_HS_IRQHandler(void)
{
tud_int_handler(1);
}
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM
//--------------------------------------------------------------------+
@@ -134,6 +139,8 @@ void board_init(void)
// Enable USB OTG clock
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
// __HAL_RCC_USB_OTG_HS_CLK_ENABLE();
board_vbus_sense_init();
}
@@ -2,6 +2,7 @@ CFLAGS += -DSTM32H743xx -DHSE_VALUE=25000000
# Default is Highspeed port
PORT ?= 1
SPEED ?= high
SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32h743xx.s
LD_FILE = $(BOARD_PATH)/stm32h743xx_flash.ld
+9 -3
View File
@@ -19,16 +19,22 @@ CFLAGS += \
-DBOARD_DEVICE_RHPORT_NUM=$(PORT)
ifeq ($(PORT), 1)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
$(info "PORT1 High Speed")
ifeq ($(SPEED), high)
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
$(info "Using OTG_HS in HighSpeed mode")
else
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_FULL_SPEED
$(info "Using OTG_HS in FullSpeed mode")
endif
else
$(info "PORT0 Full Speed")
$(info "Using OTG_FS")
endif
# suppress warning caused by vendor mcu driver
CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
# All source paths should be relative to the top level.
SRC_C += \
src/portable/synopsys/dwc2/dcd_dwc2.c \
$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \