summaryrefslogtreecommitdiffstats
path: root/firmware/export/usb_core.h
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2007-11-22 20:51:00 +0000
committerBjörn Stenberg <bjorn@haxx.se>2007-11-22 20:51:00 +0000
commitb4e5123e5d78935a3ab961d54ee5902eed37aa32 (patch)
treee0818a8c26e4a435188e70820c3aab387b01d842 /firmware/export/usb_core.h
parent2e2cbfe4acc22c1c69e38b638280da974630ca7f (diff)
downloadrockbox-b4e5123e5d78935a3ab961d54ee5902eed37aa32.tar.gz
rockbox-b4e5123e5d78935a3ab961d54ee5902eed37aa32.zip
New USB stack
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15758 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/usb_core.h')
-rw-r--r--firmware/export/usb_core.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h
new file mode 100644
index 0000000000..be3e4789d9
--- /dev/null
+++ b/firmware/export/usb_core.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: $
+ *
+ * Copyright (C) 2007 by Björn Stenberg
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef USB_CORE_H
+#define USB_CORE_H
+
+#include "usb_ch9.h"
+
+#if defined(CPU_PP)
+#define USB_IRAM_ORIGIN ((unsigned char *)0x4000c000)
+#define USB_IRAM_SIZE ((size_t)0xc000)
+#endif
+
+/* endpoints */
+enum {
+ EP_CONTROL = 0,
+ EP_RX,
+ EP_TX,
+ NUM_ENDPOINTS
+};
+
+/* queue events */
+#define USB_TRANSFER_COMPLETE 1
+
+struct queue_msg {
+ int endpoint;
+ int length;
+ void* data;
+};
+
+extern int usb_max_pkt_size;
+
+void usb_core_init(void);
+void usb_core_exit(void);
+void usb_core_control_request(struct usb_ctrlrequest* req);
+void usb_core_transfer_complete(int endpoint, bool in);
+void usb_core_bus_reset(void);
+
+#endif
+