usb_otg.h 728 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #define USBOTG_MODE_HOST 0
  13. #define USBOTG_MODE_DEVICE 1
  14. #define USBOTG_MODE_OTG 2
  15. /**
  16. * @brief usb otg controller hardware or gpio id simulator init.
  17. *
  18. * @return On success will return 0, and others indicate fail.
  19. */
  20. int usb_otg_init(uint8_t busid);
  21. /**
  22. * @brief usb otg controller hardware or gpio id simulator deinit.
  23. *
  24. * @return On success will return 0, and others indicate fail.
  25. */
  26. int usb_otg_deinit(uint8_t busid);
  27. /* called by user */
  28. void USBOTG_IRQHandler(uint8_t busid);
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif /* USB_OTG_H */