aboutsummaryrefslogtreecommitdiffstats
path: root/core/usb/descriptors.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/usb/descriptors.h')
-rw-r--r--core/usb/descriptors.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/usb/descriptors.h b/core/usb/descriptors.h
index 1beabcc..d1918e3 100644
--- a/core/usb/descriptors.h
+++ b/core/usb/descriptors.h
@@ -4,11 +4,26 @@
#include "usb_lib.h"
+#include "config.h"
#if defined(__cplusplus)
extern "C" {
#endif
+#define USB_DESCRIPTOR_TYPE_DEVICE 0x01
+#define USB_DESCRIPTOR_TYPE_CONFIGURATION 0x02
+#define USB_DESCRIPTOR_TYPE_STRING 0x03
+#define USB_DESCRIPTOR_TYPE_INTERFACE 0x04
+#define USB_DESCRIPTOR_TYPE_ENDPOINT 0x05
+
+#define USB_CONFIG_ATTR_BUSPOWERED 0b10000000
+#define USB_CONFIG_ATTR_SELFPOWERED 0b11000000
+
+#define EP_TYPE_INTERRUPT 0x03
+#define EP_TYPE_BULK 0x02
+
+#define USB_DESCRIPTOR_STRING_LEN(x) (2 + (x << 1))
+
#define CDC_FUCNTIONAL_DESCRIPTOR(DataSize) \
struct \
{ \
@@ -18,8 +33,6 @@
uint8 Data[DataSize]; \
}
-#define USB_DESCRIPTOR_STRING_LEN(x) (2 + (x << 1))
-
typedef struct {
uint8 bLength;
uint8 bDescriptorType;