usb hw init OK

This commit is contained in:
hathach
2019-11-24 23:46:28 +07:00
parent 24b2cea139
commit 58e8265964
4 changed files with 128 additions and 3 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ CFLAGS += \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-nostdlib -nostartfiles \
-DCFG_TUSB_MCU=OPT_MCU_NONE
-DCFG_TUSB_MCU=OPT_MCU_SAMG
#CFLAGS += -Wno-error=undef
@@ -35,8 +35,8 @@ INC += \
$(TOP)/$(ASF_DIR)/CMSIS/Core/Include
# For TinyUSB port source
VENDOR = .
CHIP_FAMILY = template
VENDOR = microchip
CHIP_FAMILY = samg
# For freeRTOS port source
FREERTOS_PORT = ARM_CM4F
+8
View File
@@ -73,6 +73,14 @@ void board_init(void)
// Enble clock
_pmc_enable_periph_clock(ID_UDP);
/* USB Device mode & Transceiver active */
hri_matrix_write_CCFG_USBMR_reg(MATRIX, CCFG_USBMR_USBMODE);
// NVIC_EnableIRQ(UDP_IRQn);
// Attach
hri_udp_write_TXVC_reg(UDP, UDP_TXVC_PUON);
}
//--------------------------------------------------------------------+