summaryrefslogtreecommitdiff
path: root/firmware/export/usb_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/usb_core.h')
-rw-r--r--firmware/export/usb_core.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h
index abf090ed9d..9c105fbc7c 100644
--- a/firmware/export/usb_core.h
+++ b/firmware/export/usb_core.h
@@ -36,6 +36,17 @@
36 36
37/* endpoints */ 37/* endpoints */
38#define EP_CONTROL 0 38#define EP_CONTROL 0
39
40#define DIR_OUT 0
41#define DIR_IN 1
42
43/* The USB core is a device, and OUT is RX from that P.O.V */
44#define DIR_RX DIR_OUT
45#define DIR_TX DIR_IN
46
47#define EP_DIR(ep) (((ep) & USB_ENDPOINT_DIR_MASK) ? DIR_IN : DIR_OUT)
48#define EP_NUM(ep) ((ep) & USB_ENDPOINT_NUMBER_MASK)
49
39extern int usb_max_pkt_size; 50extern int usb_max_pkt_size;
40 51
41struct usb_class_driver; 52struct usb_class_driver;
@@ -52,7 +63,7 @@ void usb_core_handle_transfer_completion(
52 struct usb_transfer_completion_event_data* event); 63 struct usb_transfer_completion_event_data* event);
53int usb_core_ack_control(struct usb_ctrlrequest* req); 64int usb_core_ack_control(struct usb_ctrlrequest* req);
54 65
55int usb_core_request_endpoint(int dir,struct usb_class_driver* drv); 66int usb_core_request_endpoint(int type, int dir,struct usb_class_driver* drv);
56void usb_core_release_endpoint(int dir); 67void usb_core_release_endpoint(int dir);
57 68
58#ifdef HAVE_HOTSWAP 69#ifdef HAVE_HOTSWAP