usbh_hcs.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*!
  2. \file usbh_hcs.h
  3. \brief header file for usbh_hcs.c
  4. */
  5. /*
  6. Copyright (C) 2017 GigaDevice
  7. 2017-02-10, V1.0.0, firmware for GD32F30x
  8. */
  9. #ifndef USBH_HCS_H
  10. #define USBH_HCS_H
  11. #include "usbh_core.h"
  12. #define HC_MAX 8U
  13. #define HC_OK 0x0000U
  14. #define HC_USED 0x8000U
  15. #define HC_ERROR 0xFFFFU
  16. #define HC_USED_MASK 0x7FFFU
  17. /* function declarations */
  18. /* allocate a new channel for the pipe */
  19. uint8_t usbh_channel_alloc (usb_core_handle_struct *pudev, uint8_t ep_addr);
  20. /* free all usb host channel */
  21. uint8_t usbh_allchannel_dealloc (usb_core_handle_struct *pudev);
  22. /* free the usb host channel */
  23. uint8_t usbh_channel_free (usb_core_handle_struct *pudev, uint8_t index);
  24. /* open a channel */
  25. uint8_t usbh_channel_open (usb_core_handle_struct *pudev,
  26. uint8_t channel_num,
  27. uint8_t dev_addr,
  28. uint8_t dev_speed,
  29. uint8_t ep_type,
  30. uint16_t ep_mps);
  31. /* modify a channel */
  32. uint8_t usbh_channel_modify (usb_core_handle_struct *pudev,
  33. uint8_t channel_num,
  34. uint8_t dev_addr,
  35. uint8_t dev_speed,
  36. uint8_t ep_type,
  37. uint16_t ep_mps);
  38. #endif /* USBH_HCS_H */