Kiibohd Controller
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

usb_desc.h 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef _usb_desc_h_
  2. #define _usb_desc_h_
  3. // This header is NOT meant to be included when compiling
  4. // user sketches in Arduino. The low-level functions
  5. // provided by usb_dev.c are meant to be called only by
  6. // code which provides higher-level interfaces to the user.
  7. #include <stdint.h>
  8. #include <stddef.h>
  9. #include "usb_com.h"
  10. #define ENDPOINT_UNUSED 0x00
  11. #define ENDPOINT_TRANSIMIT_ONLY 0x15
  12. #define ENDPOINT_RECEIVE_ONLY 0x19
  13. #define ENDPOINT_TRANSMIT_AND_RECEIVE 0x1D
  14. // Some operating systems, especially Windows, may cache USB device
  15. // info. Changes to the device name may not update on the same
  16. // computer unless the vendor or product ID numbers change, or the
  17. // "bcdDevice" revision code is increased.
  18. #define DEVICE_CLASS 0xEF
  19. #define DEVICE_SUBCLASS 0x02
  20. #define DEVICE_PROTOCOL 0x01
  21. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  22. #define MANUFACTURER_NAME_LEN 11
  23. #define PRODUCT_NAME {'S','e','r','i','a','l','/','K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','J','o','y','s','t','i','c','k'}
  24. #define PRODUCT_NAME_LEN 30
  25. #define EP0_SIZE 64
  26. #define NUM_ENDPOINTS 15
  27. #define NUM_INTERFACE 5
  28. #define CDC_IAD_DESCRIPTOR 1
  29. #define CDC_STATUS_INTERFACE 0
  30. #define CDC_DATA_INTERFACE 1 // Serial
  31. #define CDC_ACM_ENDPOINT 2
  32. #define CDC_RX_ENDPOINT 3
  33. #define CDC_TX_ENDPOINT 4
  34. #define CDC_ACM_SIZE 16
  35. #define CDC_RX_SIZE 64
  36. #define CDC_TX_SIZE 64
  37. #define KEYBOARD_INTERFACE 2 // Keyboard
  38. #define KEYBOARD_ENDPOINT 1
  39. #define KEYBOARD_SIZE 8
  40. #define KEYBOARD_INTERVAL 1
  41. #define MOUSE_INTERFACE 3 // Mouse
  42. #define MOUSE_ENDPOINT 5
  43. #define MOUSE_SIZE 8
  44. #define MOUSE_INTERVAL 2
  45. #define JOYSTICK_INTERFACE 4 // Joystick
  46. #define JOYSTICK_ENDPOINT 6
  47. #define JOYSTICK_SIZE 16
  48. #define JOYSTICK_INTERVAL 1
  49. #define KEYBOARD_DESC_OFFSET (9+8 + 9+5+5+4+5+7+9+7+7 + 9)
  50. #define MOUSE_DESC_OFFSET (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7 + 9)
  51. #define JOYSTICK_DESC_OFFSET (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7 + 9+9+7 + 9)
  52. #define CONFIG_DESC_SIZE (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7 + 9+9+7 + 9+9+7)
  53. #define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY
  54. #define ENDPOINT2_CONFIG ENDPOINT_TRANSIMIT_ONLY
  55. #define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
  56. #define ENDPOINT4_CONFIG ENDPOINT_TRANSIMIT_ONLY
  57. #define ENDPOINT5_CONFIG ENDPOINT_TRANSIMIT_ONLY
  58. #define ENDPOINT6_CONFIG ENDPOINT_TRANSIMIT_ONLY
  59. // NUM_ENDPOINTS = number of non-zero endpoints (0 to 15)
  60. extern const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS];
  61. typedef struct {
  62. uint16_t wValue;
  63. uint16_t wIndex;
  64. const uint8_t *addr;
  65. uint16_t length;
  66. } usb_descriptor_list_t;
  67. extern const usb_descriptor_list_t usb_descriptor_list[];
  68. #endif