internal unsafe CyUSBEndPoint(IntPtr h, USB_ENDPOINT_DESCRIPTOR* EndPtDescriptor, USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR* SSEndPtDescriptor) { _hDevice = h; if (EndPtDescriptor != (USB_ENDPOINT_DESCRIPTOR*)0) { int pkts = (EndPtDescriptor->wMaxPacketSize & 0x1800) >> 11; pkts++; _dscLen = EndPtDescriptor->bLength; _dscType = EndPtDescriptor->bDescriptorType; _address = EndPtDescriptor->bEndpointAddress; _attributes = EndPtDescriptor->bmAttributes; _maxPktSize = (EndPtDescriptor->wMaxPacketSize & 0x7ff) * pkts; _interval = EndPtDescriptor->bInterval; _bIn = (Address & 0x80) > 0; } if (SSEndPtDescriptor != (USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR*)0) { _ssdscLen = SSEndPtDescriptor->bLength; _ssdscType = SSEndPtDescriptor->bDescriptorType; _ssmaxburst = SSEndPtDescriptor->bMaxBurst; _maxPktSize *= (_ssmaxburst + 1); // Multiply the Maxpacket size with Max burst _ssbmAttribute = SSEndPtDescriptor->bmAttributes; if ((_attributes & 0x03) == 1) // MULT is valid for Isochronous transfer only _maxPktSize *= ((SSEndPtDescriptor->bmAttributes & 0x03) + 1); // Adding the MULT fields. _ssbytesperinterval = SSEndPtDescriptor->bBytesPerInterval; } }
internal unsafe CyBulkEndPoint(IntPtr h, USB_ENDPOINT_DESCRIPTOR* EndPtDescriptor, USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR* SSEndPtDescriptor) : base(h, EndPtDescriptor, SSEndPtDescriptor) { }
// Constructor internal unsafe CyUSBEndPoint(IntPtr h, USB_ENDPOINT_DESCRIPTOR* EndPtDescriptor) { _hDevice = h; if (EndPtDescriptor != (USB_ENDPOINT_DESCRIPTOR*)0) { int pkts = (EndPtDescriptor->wMaxPacketSize & 0x1800) >> 11; pkts++; _dscLen = EndPtDescriptor->bLength; _dscType = EndPtDescriptor->bDescriptorType; _address = EndPtDescriptor->bEndpointAddress; _attributes = EndPtDescriptor->bmAttributes; _maxPktSize = (EndPtDescriptor->wMaxPacketSize & 0x7ff) * pkts; _interval = EndPtDescriptor->bInterval; _bIn = (Address & 0x80) > 0; } // initialize all SS paramter to zero _ssdscLen = 0; _ssdscType = 0; _ssmaxburst = 0; _ssbmAttribute = 0; _ssbytesperinterval = 0; }
internal unsafe CyBulkEndPoint(IntPtr h, USB_ENDPOINT_DESCRIPTOR* EndPtDescriptor) : base(h, EndPtDescriptor) { }