2024-06-02 11:20:13 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2024, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2024/04/23 sakumisu first version
|
|
|
|
*/
|
|
|
|
#include <rtthread.h>
|
2024-09-01 11:02:53 +08:00
|
|
|
#include <board.h>
|
2024-06-02 11:20:13 +08:00
|
|
|
|
|
|
|
/* low level init here, this has implemented in cherryusb */
|
|
|
|
|
|
|
|
/* low level deinit here, this has implemented in cherryusb */
|
2024-09-01 11:02:53 +08:00
|
|
|
|
|
|
|
#ifdef RT_CHERRYUSB_DEVICE_TEMPLATE_MSC
|
|
|
|
int cherryusb_devinit(void)
|
|
|
|
{
|
|
|
|
extern void msc_ram_init(uint8_t busid, uintptr_t reg_base);
|
|
|
|
|
|
|
|
board_init_usb_pins();
|
|
|
|
|
|
|
|
msc_ram_init(0, HPM_USB0_BASE);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
INIT_COMPONENT_EXPORT(cherryusb_devinit);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_CHERRYUSB_HOST
|
|
|
|
#include "usbh_core.h"
|
|
|
|
|
|
|
|
int cherryusb_hostinit(void)
|
|
|
|
{
|
|
|
|
board_init_usb_pins();
|
|
|
|
|
|
|
|
usbh_initialize(0, HPM_USB0_BASE);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
INIT_COMPONENT_EXPORT(cherryusb_hostinit);
|
|
|
|
#endif
|