Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

usb-common.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Copyright (c) 2011,2012 Simon Schubert <[email protected]>.
  2. * Modifications by Jacob Alexander 2014-2015 <[email protected]>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #pragma once
  18. // ----- Enumerations -----
  19. /**
  20. * USB request data structures.
  21. */
  22. enum usb_tok_pid {
  23. USB_PID_TIMEOUT = 0,
  24. USB_PID_OUT = 1,
  25. USB_PID_ACK = 2,
  26. USB_PID_DATA0 = 3,
  27. USB_PID_IN = 9,
  28. USB_PID_NAK = 10,
  29. USB_PID_DATA1 = 11,
  30. USB_PID_SETUP = 13,
  31. USB_PID_STALL = 14,
  32. USB_PID_DATAERR = 15
  33. };
  34. enum usb_ep_pingpong {
  35. USB_EP_PINGPONG_EVEN = 0,
  36. USB_EP_PINGPONG_ODD = 1
  37. };
  38. enum usb_ep_dir {
  39. USB_EP_RX = 0,
  40. USB_EP_TX = 1
  41. };
  42. enum usb_data01 {
  43. USB_DATA01_DATA0 = 0,
  44. USB_DATA01_DATA1 = 1
  45. };
  46. enum {
  47. EP0_BUFSIZE = 64
  48. };