usb: add endpoint address calculation macros

Some people find it easier to read without the direction bit included.
This commit is contained in:
Karl Palsson 2015-03-30 18:27:22 +00:00
parent f473d40038
commit 4f5863e372
1 changed files with 4 additions and 0 deletions

View File

@ -213,6 +213,10 @@ struct usb_endpoint_descriptor {
} __attribute__((packed));
#define USB_DT_ENDPOINT_SIZE 7
/* USB bEndpointAddress helper macros */
#define USB_ENDPOINT_ADDR_OUT(x) (x)
#define USB_ENDPOINT_ADDR_IN(x) (0x80 | (x))
/* USB Endpoint Descriptor bmAttributes bit definitions */
#define USB_ENDPOINT_ATTR_CONTROL 0x00
#define USB_ENDPOINT_ATTR_ISOCHRONOUS 0x01