Exemplo n.º 1
0
        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;

            }
        }
Exemplo n.º 2
0
 internal unsafe CyBulkEndPoint(IntPtr h, USB_ENDPOINT_DESCRIPTOR* EndPtDescriptor, USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR* SSEndPtDescriptor)
     : base(h, EndPtDescriptor, SSEndPtDescriptor)
 {
 }