usb_glue_gd.c 722 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2024, sakumisu
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include "usb_config.h"
  7. #include "stdint.h"
  8. #include "usb_dwc2_reg.h"
  9. /* you can find this config in function:usb_core_init, file:drv_usb_core.c, for example:
  10. *
  11. * usb_regs->gr->GCCFG |= GCCFG_PWRON | GCCFG_VBUSACEN | GCCFG_VBUSBCEN;
  12. *
  13. */
  14. uint32_t usbd_get_dwc2_gccfg_conf(uint32_t reg_base)
  15. {
  16. #ifdef CONFIG_USB_HS
  17. return 0;
  18. #else
  19. return ((1 << 16) | (1 << 18) | (1 << 19) | (1 << 21));
  20. #endif
  21. }
  22. uint32_t usbh_get_dwc2_gccfg_conf(uint32_t reg_base)
  23. {
  24. #ifdef CONFIG_USB_HS
  25. return 0;
  26. #else
  27. return ((1 << 16) | (1 << 18) | (1 << 19) | (1 << 21));
  28. #endif
  29. }
  30. void usbd_dwc2_delay_ms(uint8_t ms)
  31. {
  32. /* implement later */
  33. }