usb_otg.h 790 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2025, sakumisu
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef USB_OTG_H
  7. #define USB_OTG_H
  8. #include <stdint.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /**
  13. * @brief usb otg controller hardware or gpio id simulator init.
  14. *
  15. * @return On success will return 0, and others indicate fail.
  16. */
  17. int usb_otg_init(uint8_t busid);
  18. /**
  19. * @brief usb otg controller hardware or gpio id simulator deinit.
  20. *
  21. * @return On success will return 0, and others indicate fail.
  22. */
  23. int usb_otg_deinit(uint8_t busid);
  24. /**
  25. * @brief get current role mode.
  26. *
  27. * @return return USBOTG_MODE_HOST or USBOTG_MODE_DEVICE.
  28. */
  29. uint8_t usbotg_get_current_mode(uint8_t busid);
  30. /* called by user */
  31. void USBOTG_IRQHandler(uint8_t busid);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif /* USB_OTG_H */