コード例 #1
0
        public NativeAnalogInput(Socket socket, Socket.Pin pin, Module module, Hardware.Cpu.AnalogChannel channel)
        {
            if (channel == Hardware.Cpu.AnalogChannel.ANALOG_NONE)
            {
                Socket.InvalidSocketException.ThrowIfOutOfRange(pin, Socket.Pin.Three, Socket.Pin.Five, "AnalogInput", module);

                // this is a mainboard error that should not happen (we already check for it in SocketInterfaces.RegisterSocket) but just in case...
                throw Socket.InvalidSocketException.FunctionalityException(socket, "AnalogInput");
            }

            _channel = channel;
            _socket  = socket;
        }
コード例 #2
0
        public NativeAnalogInput(Socket socket, Socket.Pin pin, Module module, Hardware.Cpu.AnalogChannel channel)
        {
            if (channel == Hardware.Cpu.AnalogChannel.ANALOG_NONE)
            {
                Socket.InvalidSocketException.ThrowIfOutOfRange(pin, Socket.Pin.Three, Socket.Pin.Five, "AnalogInput", module);

                // this is a mainboard error that should not happen (we already check for it in SocketInterfaces.RegisterSocket) but just in case...
                throw Socket.InvalidSocketException.FunctionalityException(socket, "AnalogInput");
            }

            _channel = channel;
            _socket = socket;            
        }