public OnOffDigitalSensorMgr(GHI.Processor.DeviceType deviceType, int socketNumber, int pDstOffset, string pDstStart, string pDstEnd, string pSensorLabel = "undef", string pSensorLocation = "undef", string pMeasuredQuantity = "undef", string pDestinationTable = "undef", string pChannel = "000") { if ((deviceType != GHI.Processor.DeviceType.EMX) && (deviceType != GHI.Processor.DeviceType.G120E)) { throw new NotSupportedException("Mainboard is not supported"); } dstOffset = pDstOffset; dstStart = pDstStart; dstEnd = pDstEnd; SensorLabel = pSensorLabel; SensorLocation = pSensorLocation; MeasuredQuantity = pMeasuredQuantity; DestinationTable = pDestinationTable; Channel = pChannel; input = new InterruptPort(deviceType == GHI.Processor.DeviceType.EMX ? GHI.Pins.FEZSpider.Socket4.Pin4 : GHI.Pins.FEZSpiderII.Socket4.Pin3, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth); input.ClearInterrupt(); input.DisableInterrupt(); _stopped = true; ReadBurnerThread = new Thread(runReadBurnerThread); ReadBurnerThread.Start(); }
public OnOffAnalogSensorMgr(GHI.Processor.DeviceType deviceType, int socketNumber, int pThreshold, int pDstOffset, string pDstStart, string pDstEnd, string pSensorLabel = "undef", string pSensorLocation = "undef", string pMeasuredQuantity = "undef", string pDestinationTable = "undef", string pChannel = "000") { if ((deviceType != GHI.Processor.DeviceType.EMX) && (deviceType != GHI.Processor.DeviceType.G120E)) { throw new NotSupportedException("Mainboard is not supported"); } dstOffset = pDstOffset; dstStart = pDstStart; dstEnd = pDstEnd; SensorLabel = pSensorLabel; SensorLocation = pSensorLocation; MeasuredQuantity = pMeasuredQuantity; DestinationTable = pDestinationTable; Channel = pChannel; input = new AnalogInput(deviceType == GHI.Processor.DeviceType.EMX ? GHI.Pins.FEZSpider.Socket9.AnalogInput4 : GHI.Pins.FEZSpiderII.Socket9.AnalogInput4); _stopped = true; ReadSensorThread = new Thread(runReadSensorThread); ReadSensorThread.Start(); threshold = pThreshold; }