public void InputB(object sender, ByteEventArgs e) { #if DEBUG Console.WriteLine("RaspSum received input B " + e.Value); #endif valueB = e.Value; }
private void Input(ByteEventArgs e, byte ChannelNumber) { Runner.AddTask((o) => { if (currentInput == ChannelNumber) { Output(this, e); } }); }
public void Input(object sender, ByteEventArgs e) { Runner.AddTask((o) => { if (currentOutput != null) { currentOutput(this, e); } }); }
public void EnableOutputs(object sender, ByteEventArgs e) { switch (e.Value) { case 0: currentOutput = null; break; case 1: currentOutput = Output0; break; case 2: currentOutput = Output1; break; case 4: currentOutput = Output2; break; case 8: currentOutput = Output3; break; case 16: currentOutput = Output4; break; case 32: currentOutput = Output5; break; case 64: currentOutput = Output6; break; case 128: currentOutput = Output7; break; default: currentOutput = null; break; } }
public void Input(object sender, ByteEventArgs e) { Runner.AddTask((o) => { BCM2835Managed.bcm2835_delayMicroseconds(delay); if (Output != null) { Output(this, e); } }); }
public void Input(object sender, ByteEventArgs e) { Runner.AddTask((o) => { if (e.Value != outputStatus) { outputStatus = e.Value; Output(this, new IntegerEventArgs { Value = outputStatus }); } }); }
public void SelectInput(object sender, ByteEventArgs e) { Runner.AddTask((o) => { currentInput = e.Value; if (outputState != inputStates[e.Value]) { outputState = inputStates[e.Value]; Output(this, new SignalEventArgs { Signal = outputState }); } }); }
public void Input(object sender, ByteEventArgs e) { ulong start = RaspExtern.Timers.bcm2835_st_read(); Runner.AddTask((o) => { RaspExtern.Timers.bcm2835_st_delay(start, delay); if (Output != null) { Output(this, e); } }); }
public void Input(object sender, ByteEventArgs e) { Runner.AddTask((o) => { bool newOut = valueIsHigh ? e.Value == value : e.Value != value; if (newOut != outputStatus) { outputStatus = newOut; Output(this, new SignalEventArgs { Signal = outputStatus }); } }); }
public void Input(object sender, ByteEventArgs e) { Runner.AddTask((o) => { bool newOut = HighValues.Contains(e.Value); if (newOut != outputStatus) { outputStatus = newOut; Output(this, new SignalEventArgs { Signal = outputStatus }); } }); }
public void Input(object sender, ByteEventArgs e) { Runner.AddTask((o) => { for (int buc = offset; buc < offset + length; buc++) { buffer.buffer[buc] = e.Value; } if (Output != null) { Output(this, new BufferEventArgs { Buffer = buffer, Offset = offset, Length = length }); } }); }
public void Input(object sender, ByteEventArgs e) { Runner.AddTask((o) => { bool newOutput = false; switch (condition) { case NumericConditionType.Equal: newOutput = e.Value == compareValue; break; case NumericConditionType.NotEqual: newOutput = e.Value != compareValue; break; case NumericConditionType.Greater: newOutput = e.Value > compareValue; break; case NumericConditionType.Lesser: newOutput = e.Value < compareValue; break; case NumericConditionType.GreaterOrEqual: newOutput = e.Value >= compareValue; break; case NumericConditionType.LesserOrEqual: newOutput = e.Value <= compareValue; break; } if (newOutput != currentOutput) { currentOutput = newOutput; if (Output != null) { Output(this, new SignalEventArgs { Signal = currentOutput }); } } }); }
public void Input3(object sender, ByteEventArgs e) { Input(e, 4); }
public void InputB(object sender, ByteEventArgs e) { valB = e.Value; }
public void SelectInput(object sender, ByteEventArgs e) { currentInput = e.Value; }
public void SelectOutput(object sender, ByteEventArgs e) { Runner.AddTask((es) => { if (e.Value == currentOutputNum) { return; } if (currentOutput != null && outputState[currentOutputNum] != false) { outputState[currentOutputNum] = false; currentOutput(this, new SignalEventArgs { Signal = false }); } switch (e.Value) { case 0: currentOutput = null; break; case 1: currentOutput = Output0; break; case 2: currentOutput = Output1; break; case 4: currentOutput = Output2; break; case 8: currentOutput = Output3; break; case 16: currentOutput = Output4; break; case 32: currentOutput = Output5; break; case 64: currentOutput = Output6; break; case 128: currentOutput = Output7; break; default: currentOutput = null; break; } currentOutputNum = e.Value; if (currentOutput != null && outputState[currentOutputNum] != inputState) { outputState[currentOutputNum] = inputState; currentOutput(this, new SignalEventArgs { Signal = inputState }); } }); }
public void Input7(object sender, ByteEventArgs e) { Input(e, 8); }
public void Input0(object sender, ByteEventArgs e) { Input(e, 1); }
public void Input6(object sender, ByteEventArgs e) { Input(e, 7); }
public void Input5(object sender, ByteEventArgs e) { Input(e, 6); }
public void Input4(object sender, ByteEventArgs e) { Input(e, 5); }
public void Input1(object sender, ByteEventArgs e) { Input(e, 2); }
public void Input2(object sender, ByteEventArgs e) { Input(e, 3); }