]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - common/usb_cdc.h
usb communication (device side) refactoring
[proxmark3-svn] / common / usb_cdc.h
diff --git a/common/usb_cdc.h b/common/usb_cdc.h
new file mode 100644 (file)
index 0000000..3139922
--- /dev/null
@@ -0,0 +1,50 @@
+/*\r
+ * at91sam7s USB CDC device implementation\r
+ *\r
+ * Copyright (c) 2012, Roel Verdult\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the copyright holders nor the\r
+ * names of its contributors may be used to endorse or promote products\r
+ * derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\r
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ * based on the "Basic USB Example" from ATMEL (doc6123.pdf)\r
+ *\r
+ * @file usb_cdc.c\r
+ * @brief\r
+ */\r
+\r
+#ifndef USB_CDC_H__\r
+#define USB_CDC_H__\r
+\r
+#include <stddef.h>\r
+#include <stdint.h>\r
+#include <stdbool.h>\r
+#include "usb_cmd.h"\r
+\r
+extern void usb_disable();\r
+extern void usb_enable();\r
+extern bool usb_poll();\r
+extern bool usb_poll_validate_length();\r
+extern bool cmd_receive(UsbCommand* cmd);\r
+extern bool cmd_send(uint32_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, size_t len);\r
+\r
+#endif // USB_CDC_H__\r
Impressum, Datenschutz