示例#1
0
 public ArduinoDetails(IRadio radio, ILoggerFactoryAdapter loggerFactory, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer)
 {
     _radio             = radio;
     _logger            = loggerFactory.GetLogger(GetType());
     _configuration     = configuration;
     _commandProcessor  = commandProcessor;
     _registerContainer = registerContainer;
 }
 public TransmitPipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, GpioPin cePin)
 {
     _configuration = configuration;
     _commandProcessor = commandProcessor;
     _registerContainer = registerContainer;
     _logger = loggerFactoryAdapter.GetLogger(GetType());
     _cePin = cePin;
 }
 public TransmitPipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, GpioPin cePin)
 {
     _configuration     = configuration;
     _commandProcessor  = commandProcessor;
     _registerContainer = registerContainer;
     _logger            = loggerFactoryAdapter.GetLogger(GetType());
     _cePin             = cePin;
 }
 public ArduinoDetails(IRadio radio, ILoggerFactoryAdapter loggerFactory, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer)
 {
     _radio = radio;
     _logger = loggerFactory.GetLogger(GetType());
     _configuration = configuration;
     _commandProcessor = commandProcessor;
     _registerContainer = registerContainer;
 }
示例#5
0
 public ReceivePipeCollection(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer)
 {
     _registerContainer = registerContainer;
     _commandProcessor  = commandProcessor;
     Add(0, new ReceivePipe(loggerFactoryAdapter, configuration, commandProcessor, registerContainer, this, 0));
     Add(1, new ReceivePipe(loggerFactoryAdapter, configuration, commandProcessor, registerContainer, this, 1));
     Add(2, new ReceivePipe(loggerFactoryAdapter, configuration, commandProcessor, registerContainer, this, 2));
     Add(3, new ReceivePipe(loggerFactoryAdapter, configuration, commandProcessor, registerContainer, this, 3));
     Add(4, new ReceivePipe(loggerFactoryAdapter, configuration, commandProcessor, registerContainer, this, 4));
     Add(5, new ReceivePipe(loggerFactoryAdapter, configuration, commandProcessor, registerContainer, this, 5));
 }
 public ReceivePipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, IReceivePipeCollection parent, int pipeId)
 {
     if (PipeId > 5)
         throw new ArgumentOutOfRangeException(nameof(pipeId), "Invalid PipeId number for this Pipe");
     _logger = loggerFactoryAdapter.GetLogger(string.Format("{0}{1}", GetType().Name, pipeId));
     _configuration = configuration;
     _commandProcessor = commandProcessor;
     _registerContainer = registerContainer;
     _parent = parent;
     PipeId = pipeId;
 }
示例#7
0
 public ReceivePipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, IReceivePipeCollection parent, int pipeId)
 {
     if (PipeId > 5)
     {
         throw new ArgumentOutOfRangeException(nameof(pipeId), "Invalid PipeId number for this Pipe");
     }
     _logger            = loggerFactoryAdapter.GetLogger(string.Format("{0}{1}", GetType().Name, pipeId));
     _configuration     = configuration;
     _commandProcessor  = commandProcessor;
     _registerContainer = registerContainer;
     _parent            = parent;
     PipeId             = pipeId;
 }
示例#8
0
        public Configuration(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, IRegisterContainer registerContainer)
        {
            _logger            = loggerFactoryAdapter.GetLogger(GetType());
            _commandProcessor  = commandProcessor;
            _registerContainer = registerContainer;
            _payloadWidth      = Constants.MaxPayloadWidth;

            // Attempt to set DataRate to 250Kbps to determine if this is a plus model
            DataRates oldDataRate = DataRate;

            DataRate     = DataRates.DataRate250Kbps;
            _isPlusModel = DataRate == DataRates.DataRate250Kbps;
            DataRate     = oldDataRate;
        }
        public Configuration(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, IRegisterContainer registerContainer)
        {
            _logger = loggerFactoryAdapter.GetLogger(GetType());
            _commandProcessor = commandProcessor;
            _registerContainer = registerContainer;
            _payloadWidth = Constants.MaxPayloadWidth;

            // Attempt to set DataRate to 250Kbps to determine if this is a plus model
            DataRates oldDataRate = DataRate;
            DataRate = DataRates.DataRate250Kbps;
            _isPlusModel = DataRate == DataRates.DataRate250Kbps;
            DataRate = oldDataRate;

        }
示例#10
0
        /// <summary>
        /// Sets all of the registers on an emulated processor.
        /// </summary>
        /// <param name="vm">VirtualMachine instance which owns the processor.</param>
        /// <param name="cpuState">New state of the processor.</param>
        public static void SetState(this VirtualMachine vm, IRegisterContainer cpuState)
        {
            var p = vm.Processor;

            p.EAX = (int)cpuState.EAX;
            p.EBX = (int)cpuState.EBX;
            p.ECX = (int)cpuState.ECX;
            p.EDX = (int)cpuState.EDX;
            p.ESI = cpuState.ESI;
            p.EDI = cpuState.EDI;
            p.ESP = cpuState.ESP;
            p.EBP = cpuState.EBP;
            vm.WriteSegmentRegister(SegmentIndex.DS, cpuState.DS);
            vm.WriteSegmentRegister(SegmentIndex.ES, cpuState.ES);
            vm.WriteSegmentRegister(SegmentIndex.FS, cpuState.FS);
            vm.WriteSegmentRegister(SegmentIndex.GS, cpuState.GS);
            vm.WriteSegmentRegister(SegmentIndex.SS, cpuState.SS);
            p.CR0         = cpuState.CR0;
            p.Flags.Value = cpuState.Flags;
        }
示例#11
0
 /// <summary>
 /// Initializes a new instance of the RegisterStringProvider class.
 /// </summary>
 /// <param name="source">Register value source.</param>
 public RegisterStringProvider(IRegisterContainer source)
 {
     this.source = source;
 }