]> git.donarmstrong.com Git - kiibohd-controller.git/blob - Bootloader/usb-common.h
0857017f7fc439cbb351fad7cd3f444a3b09d318
[kiibohd-controller.git] / Bootloader / usb-common.h
1 /* Copyright (c) 2011,2012 Simon Schubert <2@0x2c.org>.
2  * Modifications by Jacob Alexander 2014 <haata@kiibohd.com>
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
18 #ifndef _USB_COMMON_H
19 #define _USB_COMMON_H
20
21 // ----- Enumerations -----
22
23 /**
24  * USB request data structures.
25  */
26
27 enum usb_tok_pid {
28         USB_PID_TIMEOUT = 0,
29         USB_PID_OUT = 1,
30         USB_PID_ACK = 2,
31         USB_PID_DATA0 = 3,
32         USB_PID_IN = 9,
33         USB_PID_NAK = 10,
34         USB_PID_DATA1 = 11,
35         USB_PID_SETUP = 13,
36         USB_PID_STALL = 14,
37         USB_PID_DATAERR = 15
38 };
39
40 enum usb_ep_pingpong {
41         USB_EP_PINGPONG_EVEN = 0,
42         USB_EP_PINGPONG_ODD = 1
43 };
44
45 enum usb_ep_dir {
46         USB_EP_RX = 0,
47         USB_EP_TX = 1
48 };
49
50 enum usb_data01 {
51         USB_DATA01_DATA0 = 0,
52         USB_DATA01_DATA1 = 1
53 };
54
55 enum {
56         EP0_BUFSIZE = 64
57 };
58
59 #endif
60