-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Expand file tree
/
Copy pathcherryusb_port.c
More file actions
41 lines (33 loc) · 856 Bytes
/
cherryusb_port.c
File metadata and controls
41 lines (33 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* 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>
#include <board.h>
/* low level init here, this has implemented in cherryusb */
/* low level deinit here, this has implemented in cherryusb */
#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, NULL);
return 0;
}
INIT_COMPONENT_EXPORT(cherryusb_hostinit);
#endif