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