Esempio n. 1
0
    private void fillEndpointsDescriptors(EndpointUSBDescriptor[] endpointDesc)
    {
        endpointDesc[0].EndpointNumber = 1;
        endpointDesc[0].InEnpoint = true;
        endpointDesc[0].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Interrupt;
        endpointDesc[0].MaxPacketSize = 0x0004;
        endpointDesc[0].SynchronizationType = EndpointUSBDescriptor.SynchronizationTypeEnum.NoSynchronization;
        endpointDesc[0].UsageType = EndpointUSBDescriptor.UsageTypeEnum.Data;
        endpointDesc[0].Interval = 0x0a;
 
    }
Esempio n. 2
0
 public USBKeyboard(Machine machine)
 {
     this.machine       = machine;
     queue              = new Queue <byte>();
     endpointDescriptor = new EndpointUSBDescriptor[3];
     for (int i = 0; i < NumberOfEndpoints; i++)
     {
         endpointDescriptor[i] = new EndpointUSBDescriptor();
     }
     fillEndpointsDescriptors(endpointDescriptor);
     interfaceDescriptor[0].EndpointDescriptor   = endpointDescriptor;
     configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;
 }
Esempio n. 3
0
 public USBKeyboard(Machine machine)
 {
     this.machine = machine;
     queue = new Queue<byte>();
     endpointDescriptor = new EndpointUSBDescriptor[3];
     for(int i=0; i<NumberOfEndpoints; i++)
     {
         endpointDescriptor[i] = new EndpointUSBDescriptor();
     }
     fillEndpointsDescriptors(endpointDescriptor);
     interfaceDescriptor[0].EndpointDescriptor = endpointDescriptor;
     configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;
 }
Esempio n. 4
0
 void Init()
 {
     endpointDescriptor = new EndpointUSBDescriptor[NumberOfEndpoints];
     for (int i = 0; i < NumberOfEndpoints; i++)
     {
         endpointDescriptor[i] = new EndpointUSBDescriptor();
     }
     FillEndpointsDescriptors(endpointDescriptor);
     interfaceDescriptor[0].EndpointDescriptor   = endpointDescriptor;
     configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;
     inquiry.FillVendor("Generic ");
     inquiry.FillIdentification("STORAGE DEVICE  ");
     inquiry.FillRevision("0207");
     oData = new List <byte>();
 }
Esempio n. 5
0
        public void Reset()
        {
            x = y = 0;
            otherConfigurationDescriptor = new ConfigurationUSBDescriptor();
            deviceQualifierDescriptor    = new DeviceQualifierUSBDescriptor();
            endpointDescriptor           = new EndpointUSBDescriptor[3];
            for (int i = 0; i < NumberOfEndpoints; i++)
            {
                endpointDescriptor[i] = new EndpointUSBDescriptor();
            }
            fillEndpointsDescriptors(endpointDescriptor);
            interfaceDescriptor[0].EndpointDescriptor   = endpointDescriptor;
            configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;

            mstate      = 0;
            changeState = false;
            buffer      = new byte[6];
        }
Esempio n. 6
0
        public SMSC9500(Machine machine)
        {
            this.machine = machine;
            MAC          = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC();
            Link         = new NetworkLink(this);
            for (int i = 0; i < NumberOfEndpoints; i++)
            {
                dataToggleBit[i] = false;
            }
            endpointDescriptor = new EndpointUSBDescriptor[NumberOfEndpoints];
            for (int i = 0; i < NumberOfEndpoints; i++)
            {
                endpointDescriptor[i] = new EndpointUSBDescriptor();
            }
            fillEndpointsDescriptors(endpointDescriptor);
            interfaceDescriptor[0].EndpointDescriptor   = endpointDescriptor;
            configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;

            rxPacketQueue = new Queue <EthernetFrame>();
        }
Esempio n. 7
0
        public SMSC9500(Machine machine)
        {
            this.machine = machine;
            MAC = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC();
            Link = new NetworkLink(this);
            for(int i=0; i<NumberOfEndpoints; i++)
            {
                dataToggleBit[i] = false;
            }
            endpointDescriptor = new EndpointUSBDescriptor[NumberOfEndpoints];
            for(int i=0; i<NumberOfEndpoints; i++)
            {
                endpointDescriptor[i] = new EndpointUSBDescriptor();
            }
            fillEndpointsDescriptors(endpointDescriptor);
            interfaceDescriptor[0].EndpointDescriptor = endpointDescriptor;
            configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;

            rxPacketQueue = new Queue<EthernetFrame>();
        }
Esempio n. 8
0
        public UsbHub(Machine machine)
        {
            this.machine       = machine;
            registeredDevices  = new Dictionary <byte, IUSBPeripheral>();
            endpointDescriptor = new EndpointUSBDescriptor[NumberOfEndpoints];
            NumberOfPorts      = 3;
            ports = new uint [NumberOfPorts];
            hubDescriptor.NbrPorts = NumberOfPorts;
            for (int i = 0; i < NumberOfEndpoints; i++)
            {
                endpointDescriptor[i] = new EndpointUSBDescriptor();
            }
            fillEndpointsDescriptors(endpointDescriptor);
            interfaceDescriptor[0].EndpointDescriptor   = endpointDescriptor;
            configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;

            for (int i = 0; i < NumberOfPorts; i++)
            {
                ports[i] = (uint)PortStatus.PortPower;
            }
        }
Esempio n. 9
0
        private void setEndpointsDescriptors()
        {
            endpointDescriptor = new EndpointUSBDescriptor[endpointsAmount];
            for (byte i = 0; i < endpointsAmount; i++)
            {
                endpointDescriptor[i] = new EndpointUSBDescriptor();
            }
            for (byte i = 0; i < endpointsAmount; i++)
            {
                endpointDescriptor[i].EndpointNumber      = i;
                endpointDescriptor[i].MaxPacketSize       = 512;
                endpointDescriptor[i].SynchronizationType = EndpointUSBDescriptor.SynchronizationTypeEnum.Asynchronous;
                endpointDescriptor[i].UsageType           = EndpointUSBDescriptor.UsageTypeEnum.Data;
            }
            endpointDescriptor[2].MaxPacketSize = 16;

            endpointDescriptor[0].InEnpoint = true;
            endpointDescriptor[1].InEnpoint = false;
            endpointDescriptor[2].InEnpoint = true;

            endpointDescriptor[0].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Bulk;
            endpointDescriptor[1].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Bulk;
            endpointDescriptor[2].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Interrupt;
        }
Esempio n. 10
0
 private void fillEndpointsDescriptors(EndpointUSBDescriptor[] endpointDesc)
 {
     endpointDesc[0].EndpointNumber = 1;
     endpointDesc[0].InEnpoint = true;
     endpointDesc[0].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Bulk;
     endpointDesc[0].MaxPacketSize = 512;
     endpointDesc[0].SynchronizationType = EndpointUSBDescriptor.SynchronizationTypeEnum.NoSynchronization;
     endpointDesc[0].UsageType = EndpointUSBDescriptor.UsageTypeEnum.Data;
     endpointDesc[0].Interval = 0;
     
     endpointDesc[1].EndpointNumber = 2;
     endpointDesc[1].InEnpoint = false;
     endpointDesc[1].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Bulk;
     endpointDesc[1].MaxPacketSize = 512;
     endpointDesc[1].SynchronizationType = EndpointUSBDescriptor.SynchronizationTypeEnum.NoSynchronization;
     endpointDesc[1].UsageType = EndpointUSBDescriptor.UsageTypeEnum.Data;
     endpointDesc[1].Interval = 0;
     
     endpointDesc[2].EndpointNumber = 3;
     endpointDesc[2].InEnpoint = true;
     endpointDesc[2].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Interrupt;
     endpointDesc[2].MaxPacketSize = 16;
     endpointDesc[2].SynchronizationType = EndpointUSBDescriptor.SynchronizationTypeEnum.NoSynchronization;
     endpointDesc[2].UsageType = EndpointUSBDescriptor.UsageTypeEnum.Data;
     endpointDesc[2].Interval = 2;
     
 }
Esempio n. 11
0
        public void Reset()
        {
            x = y = 0;
            otherConfigurationDescriptor = new ConfigurationUSBDescriptor();
            deviceQualifierDescriptor = new DeviceQualifierUSBDescriptor();
            endpointDescriptor = new EndpointUSBDescriptor[3];
            for(int i = 0; i < NumberOfEndpoints; i++)
            {
                endpointDescriptor[i] = new EndpointUSBDescriptor();
            }
            fillEndpointsDescriptors(endpointDescriptor);
            interfaceDescriptor[0].EndpointDescriptor = endpointDescriptor;
            configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;

            mstate = 0;
            changeState = false;
            buffer = new byte[6];
        }
Esempio n. 12
0
 void Init()
 {
     endpointDescriptor = new EndpointUSBDescriptor[NumberOfEndpoints];
     for(int i = 0; i < NumberOfEndpoints; i++)
     {
         endpointDescriptor[i] = new EndpointUSBDescriptor();
     }
     FillEndpointsDescriptors(endpointDescriptor);
     interfaceDescriptor[0].EndpointDescriptor = endpointDescriptor;
     configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;
     inquiry.FillVendor("Generic ");
     inquiry.FillIdentification("STORAGE DEVICE  ");
     inquiry.FillRevision("0207");
     oData = new List<byte>();
 }
 private void setEndpointsDescriptors()
 {
     endpointDescriptor = new EndpointUSBDescriptor[endpointsAmount];
     for(byte i=0; i<endpointsAmount; i++)
     {
         endpointDescriptor[i] = new EndpointUSBDescriptor();
     }
     for(byte i=0; i<endpointsAmount; i++)
     {
         endpointDescriptor[i].EndpointNumber = i;
         endpointDescriptor[i].MaxPacketSize = 512;
         endpointDescriptor[i].SynchronizationType = EndpointUSBDescriptor.SynchronizationTypeEnum.Asynchronous;
         endpointDescriptor[i].UsageType = EndpointUSBDescriptor.UsageTypeEnum.Data;
     }
     endpointDescriptor[2].MaxPacketSize = 16;
     
     endpointDescriptor[0].InEnpoint = true;
     endpointDescriptor[1].InEnpoint = false;
     endpointDescriptor[2].InEnpoint = true;
     
     endpointDescriptor[0].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Bulk;
     endpointDescriptor[1].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Bulk;
     endpointDescriptor[2].TransferType = EndpointUSBDescriptor.TransferTypeEnum.Interrupt;
         
 }
Esempio n. 14
0
        public UsbHub(Machine machine)
        {
            this.machine = machine;
            registeredDevices = new Dictionary<byte, IUSBPeripheral>();
            endpointDescriptor = new EndpointUSBDescriptor[NumberOfEndpoints];
            NumberOfPorts = 3;
            ports = new uint [NumberOfPorts];
            hubDescriptor.NbrPorts = NumberOfPorts;
            for(int i=0; i<NumberOfEndpoints; i++)
            {
                endpointDescriptor[i] = new EndpointUSBDescriptor();
            }
            fillEndpointsDescriptors(endpointDescriptor);
            interfaceDescriptor[0].EndpointDescriptor = endpointDescriptor;
            configurationDescriptor.InterfaceDescriptor = interfaceDescriptor;

            for(int i=0; i<NumberOfPorts; i++)
            {
                ports[i] = (uint)PortStatus.PortPower;
            }
        }