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