summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-10-03 00:15:24 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-10-03 00:15:24 +0000
commitda5eede1f9dea96f9bf747830292e75dd7e1f552 (patch)
treef75b594cb467a3d4360fd38f3a76cbc1b561c66c /nuttx/include
parentfca69dde3358cf8c7cfcd9dce583ae430057a535 (diff)
downloadpx4-nuttx-da5eede1f9dea96f9bf747830292e75dd7e1f552.tar.gz
px4-nuttx-da5eede1f9dea96f9bf747830292e75dd7e1f552.tar.bz2
px4-nuttx-da5eede1f9dea96f9bf747830292e75dd7e1f552.zip
Integrating LPC214X USB
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@972 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/usb.h37
-rw-r--r--nuttx/include/nuttx/usbdev_trace.h2
2 files changed, 19 insertions, 20 deletions
diff --git a/nuttx/include/nuttx/usb.h b/nuttx/include/nuttx/usb.h
index aad4da8e5..a70cd3e0c 100644
--- a/nuttx/include/nuttx/usb.h
+++ b/nuttx/include/nuttx/usb.h
@@ -52,7 +52,7 @@
#define MSBYTE(u16) ((u16) >> 8) /* Get MS byte from uint16 */
#define LSBYTE(u16) ((u16) & 0xff) /* Get LS byte from uint16 */
-#define GETUINT16(p) (((uint16)p[1] << 8)|(uint16)p[1])
+#define GETUINT16(p) (((uint16)p[1]<<8)|(uint16)p[0])
/* USB directions (in endpoint addresses) */
@@ -63,7 +63,22 @@
#define USB_EPOUT(addr) ((addr)|USB_DIR_OUT)
#define USB_EPIN(addr) ((addr)|USB_DIR_IN)
-/* Standard requests */
+/* Control Setup Packet. Byte 0=Request */
+
+#define USB_REQ_DIR_IN (0x80) /* Bit 7=1: IN */
+
+#define USB_REQ_TYPE_MASK (0x60) /* Bits 5:6: Request type */
+#define USB_REQ_TYPE_STANDARD (0x00)
+#define USB_REQ_TYPE_CLASS (0x20)
+#define USB_REQ_TYPE_VENDOR (0x40)
+
+#define USB_REQ_RECIPIENT_MASK (0x1f) /* Bits 0:4: Recipient */
+#define USB_REQ_RECIPIENT_DEVICE (0x00)
+#define USB_REQ_RECIPIENT_INTERFACE (0x01)
+#define USB_REQ_RECIPIENT_ENDPOINT (0x02)
+#define USB_REQ_RECIPIENT_OTHER (0x03)
+
+/* Control Setup Packet. Byte 1=Standard Request Codes */
#define USB_REQ_GETSTATUS (0x00)
#define USB_REQ_CLEARFEATURE (0x01)
@@ -89,23 +104,9 @@
#define USB_REQ_LOOPBACKDATAREAD (0x16)
#define USB_REQ_SETINTERFACEDS (0x17)
-/* Request type encoding */
-
-#define USB_REQ_TYPE_MASK (0x60)
-#define USB_REQ_TYPE_STANDARD (0x00)
-#define USB_REQ_TYPE_CLASS (0x20)
-#define USB_REQ_TYPE_VENDOR (0x40)
-
-#define USB_REQ_RECIPIENT_MASK (0x1f)
-#define USB_REQ_RECIPIENT_DEVICE (0x00)
-#define USB_REQ_RECIPIENT_INTERFACE (0x01)
-#define USB_REQ_RECIPIENT_ENDPOINT (0x02)
-#define USB_REQ_RECIPIENT_OTHER (0x03)
-#define USB_REQ_TYPE_MASK (0x60)
-#define USB_REQ_DIR_IN (0x80)
-
/* USB feature values */
+#define USB_FEATURE_ENDPOINTHALT 0
#define USB_FEATURE_SELFPOWERED 0
#define USB_FEATURE_REMOTEWAKEUP 1
#define USB_FEATURE_TESTMODE 2
@@ -116,8 +117,6 @@
#define USB_FEATURE_AALTHNPSUPPORT 5
#define USB_FEATURE_DEBUGMODE 6
-#define USB_ENDPOINT_HALT 0
-
/* Generic descriptor header offsets */
#define USB_DESC_DESCLENOFFSET 0
diff --git a/nuttx/include/nuttx/usbdev_trace.h b/nuttx/include/nuttx/usbdev_trace.h
index 8a15b5c1b..d018c67eb 100644
--- a/nuttx/include/nuttx/usbdev_trace.h
+++ b/nuttx/include/nuttx/usbdev_trace.h
@@ -122,7 +122,7 @@
* controller driver
*/
-#define TRACE_DEVERROR(id) TRACE_EVENT(TRACE_CLSERROR_ID, id)
+#define TRACE_DEVERROR(id) TRACE_EVENT(TRACE_DEVERROR_ID, id)
/* USB class driver error events. The 'id' is specific to the class driver,
* but common to all driver controller instances.