mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-27 11:24:55 +00:00
Added ability to disable pull up resistor on versiports from config.
This commit is contained in:
@@ -10,6 +10,6 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
public string PortDeviceKey { get; set; }
|
||||
public uint PortNumber { get; set; }
|
||||
public bool DisablePullUpResistor { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
/// <summary>
|
||||
/// Represents a generic digital input deviced tied to a versiport
|
||||
/// </summary>
|
||||
public class GenericVersiportInputDevice : Device, IDigitalInput
|
||||
public class GenericVersiportDigitalInputDevice : Device, IDigitalInput
|
||||
{
|
||||
public Versiport InputPort { get; private set; }
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
}
|
||||
}
|
||||
|
||||
public GenericVersiportInputDevice(string key, Versiport inputPort):
|
||||
public GenericVersiportDigitalInputDevice(string key, Versiport inputPort):
|
||||
base(key)
|
||||
{
|
||||
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
||||
@@ -42,9 +42,39 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
}
|
||||
}
|
||||
|
||||
public class GenericVersiportInputDeviceConfigProperties
|
||||
public class GenericVersibportAnalogInputDevice : Device, IDigitalInput
|
||||
{
|
||||
public Versiport InputPort { get; private set; }
|
||||
|
||||
public BoolFeedback InputStateFeedback { get; private set; }
|
||||
|
||||
public uint MinAnalogChange { get; private set; }
|
||||
|
||||
Func<bool> InputStateFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () => InputPort.AnalogIn > MinAnalogChange ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
public GenericVersibportAnalogInputDevice(string key, Versiport inputPort, uint minAnalogChange) :
|
||||
base(key)
|
||||
{
|
||||
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
||||
MinAnalogChange = minAnalogChange;
|
||||
InputPort = inputPort;
|
||||
InputPort.SetVersiportConfiguration(eVersiportConfiguration.AnalogInput);
|
||||
InputPort.VersiportChange += new VersiportEventHandler(InputPort_VersiportChange);
|
||||
}
|
||||
|
||||
void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
|
||||
{
|
||||
Debug.Console(1, this, "Versiport change: {0}", args.Event);
|
||||
InputStateFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user