usbh_pl2303.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2024 ~ 2025, sakumisu
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef USBH_PL2303_H
  7. #define USBH_PL2303_H
  8. #include "usb_cdc.h"
  9. #define PL2303_VENDOR_WRITE_REQUEST 0x01
  10. #define PL2303_VENDOR_WRITE_NREQUEST 0x80
  11. #define PL2303_VENDOR_READ_REQUEST 0x01
  12. #define PL2303_VENDOR_READ_NREQUEST 0x81
  13. #define PL2303_FLOWCTRL_MASK 0xf0
  14. #define PL2303_READ_TYPE_HX_STATUS 0x8080
  15. #define PL2303_HXN_RESET_REG 0x07
  16. #define PL2303_HXN_RESET_UPSTREAM_PIPE 0x02
  17. #define PL2303_HXN_RESET_DOWNSTREAM_PIPE 0x01
  18. #define PL2303_HXN_FLOWCTRL_REG 0x0a
  19. #define PL2303_HXN_FLOWCTRL_MASK 0x1c
  20. #define PL2303_HXN_FLOWCTRL_NONE 0x1c
  21. #define PL2303_HXN_FLOWCTRL_RTS_CTS 0x18
  22. #define PL2303_HXN_FLOWCTRL_XON_XOFF 0x0c
  23. #define PL2303_QUIRK_UART_STATE_IDX0 BIT(0)
  24. #define PL2303_QUIRK_LEGACY BIT(1)
  25. #define PL2303_QUIRK_ENDPOINT_HACK BIT(2)
  26. #define PL2303_QUIRK_NO_BREAK_GETLINE BIT(3)
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif /* USBH_PL2303_H */