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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Copyright (c) 2011,2012 Simon Schubert <[email protected]>.
  2. * Modifications by Jacob Alexander 2014 <[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. #ifndef _USB_COMMON_H
  18. #define _USB_COMMON_H
  19. // ----- Enumerations -----
  20. /**
  21. * USB request data structures.
  22. */
  23. enum usb_tok_pid {
  24. USB_PID_TIMEOUT = 0,
  25. USB_PID_OUT = 1,
  26. USB_PID_ACK = 2,
  27. USB_PID_DATA0 = 3,
  28. USB_PID_IN = 9,
  29. USB_PID_NAK = 10,
  30. USB_PID_DATA1 = 11,
  31. USB_PID_SETUP = 13,
  32. USB_PID_STALL = 14,
  33. USB_PID_DATAERR = 15
  34. };
  35. enum usb_ep_pingpong {
  36. USB_EP_PINGPONG_EVEN = 0,
  37. USB_EP_PINGPONG_ODD = 1
  38. };
  39. enum usb_ep_dir {
  40. USB_EP_RX = 0,
  41. USB_EP_TX = 1
  42. };
  43. enum usb_data01 {
  44. USB_DATA01_DATA0 = 0,
  45. USB_DATA01_DATA1 = 1
  46. };
  47. enum {
  48. EP0_BUFSIZE = 64
  49. };
  50. #endif