cherryusb_port.c 802 B

12345678910111213141516171819202122232425262728293031323334353637
  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. /* low level init here, this has implemented in cherryusb */
  13. /* low level deinit here, this has implemented in cherryusb */
  14. #ifdef RT_CHERRYUSB_DEVICE_TEMPLATE_MSC
  15. int cherryusb_devinit(void)
  16. {
  17. extern void msc_ram_init(uint8_t busid, uintptr_t reg_base);
  18. msc_ram_init(0, USBHS1__USBC_BASE);
  19. return 0;
  20. }
  21. INIT_COMPONENT_EXPORT(cherryusb_devinit);
  22. #endif
  23. #ifdef RT_CHERRYUSB_HOST
  24. #include "usbh_core.h"
  25. int cherryusb_hostinit(void)
  26. {
  27. usbh_initialize(0, USBHS1__USBC_BASE);
  28. return 0;
  29. }
  30. INIT_COMPONENT_EXPORT(cherryusb_hostinit);
  31. #endif