1 /* 2 * Copyright (c) 2006-2024, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2024/04/23 sakumisu first version 9 */ 10 #include <rtthread.h> 11 #include <board.h> 12 13 /* low level init here, this has implemented in cherryusb */ 14 15 /* low level deinit here, this has implemented in cherryusb */ 16 17 #ifdef RT_CHERRYUSB_DEVICE_TEMPLATE_MSC cherryusb_devinit(void)18int cherryusb_devinit(void) 19 { 20 extern void msc_ram_init(uint8_t busid, uintptr_t reg_base); 21 22 board_init_usb_pins(); 23 24 msc_ram_init(0, HPM_USB0_BASE); 25 return 0; 26 } 27 INIT_COMPONENT_EXPORT(cherryusb_devinit); 28 #endif 29 30 #ifdef RT_CHERRYUSB_HOST 31 #include "usbh_core.h" 32 cherryusb_hostinit(void)33int cherryusb_hostinit(void) 34 { 35 board_init_usb_pins(); 36 37 usbh_initialize(0, HPM_USB0_BASE); 38 return 0; 39 } 40 INIT_COMPONENT_EXPORT(cherryusb_hostinit); 41 #endif