usb.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Koen Zandberg <koen@bergzand.net>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for
6  * more details.
7  */
20 #ifndef USB_H
21 #define USB_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
30 #ifndef USB_CONFIG_VID
31 #error Please supply your vendor ID by setting USB_CONFIG_VID
32 #endif
33 
40 #ifndef USB_CONFIG_PID
41 #error Please supply your vendor ID by setting USB_CONFIG_PID
42 #endif
43 
47 #ifndef USB_CONFIG_MANUF_STR
48 #define USB_CONFIG_MANUF_STR "RIOT-os.org"
49 #endif
50 
54 #ifndef USB_CONFIG_PRODUCT_STR
55 #define USB_CONFIG_PRODUCT_STR "USB device"
56 #endif
57 
61 #ifndef USB_CONFIG_CONFIGURATION_STR
62 #define USB_CONFIG_CONFIGURATION_STR "USB config"
63 #endif
64 
71 #ifndef USB_CONFIG_PRODUCT_BCDVERSION
72 #define USB_CONFIG_PRODUCT_BCDVERSION 0x0100
73 #endif
74 
78 #ifndef USB_CONFIG_SPEC_BCDVERSION
79 #define USB_CONFIG_SPEC_BCDVERSION 0x0200
80 #endif
81 
85 #ifndef USB_CONFIG_SELF_POWERED
86 #define USB_CONFIG_SELF_POWERED (0)
87 #endif
88 
92 #ifndef USB_CONFIG_MAX_POWER
93 #define USB_CONFIG_MAX_POWER (100)
94 #endif
95 
99 #ifndef USB_CONFIG_DEFAULT_LANGID
100 #define USB_CONFIG_DEFAULT_LANGID 0x0409 /* EN-US */
101 #endif
102 
106 typedef enum {
107  USB_VERSION_1x, /* USB 1.0 or 1.1 device */
108  USB_VERSION_20, /* USB 2.0 device */
109 } usb_version_t;
110 
114 typedef enum {
115  USB_SPEED_LOW, /* Low speed (1.5Mbit/s) */
116  USB_SPEED_FULL, /* Full speed (12Mbit/s) */
117  USB_SPEED_HIGH, /* High speed (480Mbit/s) */
118 } usb_speed_t;
119 
123 typedef enum {
129 } usb_ep_type_t;
130 
134 typedef enum {
137 } usb_ep_dir_t;
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* USB_H */
144 
usb_ep_type_t
USB endpoint types.
Definition: usb.h:123
Bulk type.
Definition: usb.h:127
Host out, device in.
Definition: usb.h:135
Unused endpoint.
Definition: usb.h:124
Interrupt type.
Definition: usb.h:126
Isochronous type.
Definition: usb.h:128
usb_ep_dir_t
USB endpoint directions.
Definition: usb.h:134
Control type.
Definition: usb.h:125
usb_speed_t
USB speed definitions.
Definition: usb.h:114
usb_version_t
USB version definitions.
Definition: usb.h:106
Host in, device out.
Definition: usb.h:136