mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
More USB macros; fix warnings
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2178 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+7
-3
@@ -58,12 +58,16 @@
|
||||
|
||||
/* USB directions (in endpoint addresses) */
|
||||
|
||||
#define USB_DIR_MASK (0x80)
|
||||
#define USB_EPNO_MASK (0x7f)
|
||||
#define USB_DIR_OUT (0x00) /* host-to-device */
|
||||
#define USB_DIR_IN (0x80) /* device-to-host */
|
||||
|
||||
#define USB_EPNO(addr) ((addr)&0x7f)
|
||||
#define USB_EPOUT(addr) ((addr)|USB_DIR_OUT)
|
||||
#define USB_EPIN(addr) ((addr)|USB_DIR_IN)
|
||||
#define USB_EPNO(addr) ((addr) & USB_EPNO_MASK)
|
||||
#define USB_EPOUT(addr) ((addr) | USB_DIR_OUT)
|
||||
#define USB_EPIN(addr) ((addr) | USB_DIR_IN)
|
||||
#define USB_ISEPIN(addr) (((addr) & USB_DIR_MASK) == USB_DIR_IN)
|
||||
#define USB_ISEPOUT(addr) (((addr) & USB_DIR_MASK) == USB_DIR_OUT)
|
||||
|
||||
/* Control Setup Packet. Byte 0=Request */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user