本文整理汇总了C#中Microsoft.SPOT.Hardware.InterruptPort.DisableInterrupt方法的典型用法代码示例。如果您正苦于以下问题:C# InterruptPort.DisableInterrupt方法的具体用法?C# InterruptPort.DisableInterrupt怎么用?C# InterruptPort.DisableInterrupt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.SPOT.Hardware.InterruptPort
的用法示例。
在下文中一共展示了InterruptPort.DisableInterrupt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UltraSonicSensor
public UltraSonicSensor(Cpu.Pin echoPin, Cpu.Pin triggerPin)
{
_echoPin = new InterruptPort(echoPin, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
_triggerPin = new OutputPort(triggerPin, false);
_echoPin.OnInterrupt += port_OnInterrupt;
_echoPin.DisableInterrupt();
}
示例2: TemperatureHumiditySensorPro
public TemperatureHumiditySensorPro(BaseShield.DigitalPorts port)
: base(port)
{
outputPort = new TristatePort(Pin1, true, false, Port.ResistorMode.PullUp);
inputPort = new InterruptPort(Pin2, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
inputPort.DisableInterrupt();
inputPort.OnInterrupt += new NativeEventHandler(inputPort_OnInterrupt);
dataReceivedEvent = new AutoResetEvent(false);
}
示例3: DhtSensor
private float temp; // Temperature
#endregion Fields
#region Constructors
// Instantiated via derived class
protected DhtSensor(Cpu.Pin pin1, Cpu.Pin pin2, PullUpResistor pullUp)
{
var resistorMode = (Port.ResistorMode)pullUp;
portIn = new InterruptPort(pin2, false, resistorMode, Port.InterruptMode.InterruptEdgeLow);
portIn.OnInterrupt += new NativeEventHandler(portIn_OnInterrupt);
portIn.DisableInterrupt(); // Enabled automatically in the previous call
portOut = new TristatePort(pin1, true, false, resistorMode);
if(!CheckPins())
{
throw new InvalidOperationException("DHT sensor pins are not connected together.");
}
}
示例4: AX88796C
public AX88796C(SPI.SPI_module spiBusID, Cpu.Pin csPinID, Cpu.Pin intPinID, Cpu.Pin resetPinID, Cpu.Pin wakeupPinID)
{
// create our chip select pin and SPI bus objects
_chipSelectPin = new OutputPort(csPinID, true);
_spi = new SPI(new SPI.Configuration(Cpu.Pin.GPIO_NONE, false, 0, 0, false, true, 40000, spiBusID));
// wire up our interrupt, for future use
_interruptPin = new InterruptPort(intPinID, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
_interruptPin.DisableInterrupt();
_interruptPin.OnInterrupt += _interruptPin_OnInterrupt;
// save our reset pin ID (which we will use to control the reset pin a bit later on)
_resetPinID = resetPinID;
// save our wakeup pin ID (which we can use to create an InterruptPort right before we go to sleep)
_wakeupPinID = wakeupPinID;
// create our _sendPacketTxPagesFreeEvent
_sendPacketTxPagesFreeEvent = new System.Threading.AutoResetEvent(false);
// we are not initialized; we will initialize when we are started.
_isInitialized = false;
}
示例5: ENC28J60
public ENC28J60(SPI.SPI_module spiBusID, Cpu.Pin csPinID, Cpu.Pin intPinID, Cpu.Pin resetPinID, Cpu.Pin wakeupPinID)
{
// create our chip select pin and SPI bus objects
_chipSelectPin = new OutputPort(csPinID, true);
// ERRATA NOTE: per ENC28J60 errata 1, our SPI clock speed must be at least 8,000,000Hz. Because our SPI drivers may be clocked via a "/2^x" division, our clock rate must be 16MHz-20MHz. */
_spi = new SPI(new SPI.Configuration(Cpu.Pin.GPIO_NONE, false, 0, 0, false, true, 20000, spiBusID));
// wire up our interrupt, for future use
_interruptPin = new InterruptPort(intPinID, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
_interruptPin.DisableInterrupt();
_interruptPin.OnInterrupt += _interruptPin_OnInterrupt;
// save our reset pin ID (which we will use to control the reset pin a bit later on)
_resetPinID = resetPinID;
// save our wakeup pin ID (which we can use to create an InterruptPort right before we go to sleep)
_wakeupPinID = wakeupPinID;
// create our _sendPacketTxBufferFreeEvent
_sendPacketTxBufferFreeEvent = new System.Threading.AutoResetEvent(false);
// we are not initialized; we will initialize when we are started.
_isInitialized = false;
}