summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2009-05-16 15:30:09 +0000
committerFrank Gevaerts <frank@gevaerts.be>2009-05-16 15:30:09 +0000
commit69a4117c1d15d91836de91abe5f8f93b868ec808 (patch)
treea3d47f51a0998506ef7b0f5332ddecae3e2106d2 /firmware/export
parente435e4d976757f8436484a5b4d158ab7545fcdb6 (diff)
downloadrockbox-69a4117c1d15d91836de91abe5f8f93b868ec808.tar.gz
rockbox-69a4117c1d15d91836de91abe5f8f93b868ec808.zip
Add working USB HID driver, by Tomer Shalev (part of his GSoC work).
This needs support for usb interrupt transfers, so there are some changes in various USB drivers as well (only usb-drv-arc supports it at this point, others won't have working HID yet). HID is disabled for now, as the apps/ part is not included yet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20962 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/usb.h2
-rw-r--r--firmware/export/usb_core.h13
-rw-r--r--firmware/export/usb_drv.h2
3 files changed, 14 insertions, 3 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index e1bacfffc7..42893c3468 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -105,7 +105,7 @@ struct usb_transfer_completion_event_data
105 int length; 105 int length;
106 void* data; 106 void* data;
107}; 107};
108#endif 108#endif /* HAVE_USBSTACK */
109 109
110void usb_init(void); 110void usb_init(void);
111void usb_enable(bool on); 111void usb_enable(bool on);
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
diff --git a/firmware/export/usb_drv.h b/firmware/export/usb_drv.h
index 0c99630b11..fad9c79c10 100644
--- a/firmware/export/usb_drv.h
+++ b/firmware/export/usb_drv.h
@@ -44,7 +44,7 @@ int usb_drv_port_speed(void);
44void usb_drv_cancel_all_transfers(void); 44void usb_drv_cancel_all_transfers(void);
45void usb_drv_set_test_mode(int mode); 45void usb_drv_set_test_mode(int mode);
46bool usb_drv_connected(void); 46bool usb_drv_connected(void);
47int usb_drv_request_endpoint(int dir); 47int usb_drv_request_endpoint(int type, int dir);
48void usb_drv_release_endpoint(int ep); 48void usb_drv_release_endpoint(int ep);
49 49
50#endif /* _USB_DRV_H */ 50#endif /* _USB_DRV_H */