当前位置: 首页>>代码示例>>C#>>正文


C# InterruptPort.DisableInterrupt方法代码示例

本文整理汇总了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();
        }
开发者ID:coolkev,项目名称:Netduino,代码行数:8,代码来源:UltraSonicSensor.cs

示例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);
        }
开发者ID:NicolasFatoux,项目名称:NfxLab.Sensors,代码行数:11,代码来源:TemperatureHumiditySensorPro.cs

示例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.");
              }
        }
开发者ID:swordfish45,项目名称:P1,代码行数:22,代码来源:DhtSensor.cs

示例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;
        }
开发者ID:NameOfTheDragon,项目名称:Netduino.IP,代码行数:23,代码来源:AX88796C.cs

示例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;
        }
开发者ID:NameOfTheDragon,项目名称:Netduino.IP,代码行数:24,代码来源:ENC28J60.cs


注:本文中的Microsoft.SPOT.Hardware.InterruptPort.DisableInterrupt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。