struct usb_endpoint_descriptor

来源:互联网 发布:js隐藏元素 hidden 编辑:程序博客网 时间:2024/06/05 20:09
struct usb_endpoint_descriptor {__u8  bLength;            //该结构体的字节数__u8  bDescriptorType;    __u8  bEndpointAddress;   // 端点地址和数据传输方向__u8  bmAttributes;       //端点类型__le16 wMaxPacketSize;    // 发送和接受的协议包的大小__u8  bInterval;/* NOTE:  these two are _only_ in audio endpoints. *//* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */__u8  bRefresh;__u8  bSynchAddress;} __attribute__ ((packed));


bmAttributes:

#define USB_ENDPOINT_XFERTYPE_MASK0x03/* in bmAttributes */#define USB_ENDPOINT_XFER_CONTROL0       //control endpoint#define USB_ENDPOINT_XFER_ISOC1       //isochronous endpoint#define USB_ENDPOINT_XFER_BULK2       //bulk endpoint#define USB_ENDPOINT_XFER_INT3       //interrupt endpoint

bEndpointAddress:

bit 3...0 : 端点号

bit 6...4: Reserved,reset to zero

bit 7   :  Direction,Ignored  for control endpoints . 0 = IN endpoint ,1 = OUT endpoint

#define USB_DIR_OUT0/* to device */#define USB_DIR_IN0x80/* to host */


0 0
原创粉丝点击