private void OnInterrupt(GTI.InterruptInput input, bool value)
        {
            Thread.Sleep(2);
            var source = RegisterRead(Register.INT, BitMask.INT);

            switch (source)
            {
                case 0x1: // Noise
                    OnNoiseEvent(this);
                    break;
                case 0x4: // Disturbance
                    OnDisturbanceEvent(this);
                    break;
                case 0x8: // Lightning
                    Thread.Sleep(2);
                    OnLightningEvent(this, new LightningEventArgs(ReadDistance(), ReadEnergy()));
                    break;
                default:
                    DebugPrint("Unknown interrupt source = " + source);
                    break;
            }
        }
Ejemplo n.º 2
0
 private void input_Interrupt(GTI.InterruptInput input, bool value)
 {
     this.OnButtonEvent(this, value ? ButtonState.Released : ButtonState.Pressed);
 }
Ejemplo n.º 3
0
        private void OnInterrupt(GTI.InterruptInput sender, bool value)
        {
            this.Read(Register.INT_STATUS);

            this.ready = true;
        }
Ejemplo n.º 4
0
 void _irqPin_Interrupt(GTI.InterruptInput sender, bool value)
 {
     if (DataReadyFarEvent != null)
         DataReadyFarEvent(this, GetTempF());
     if (DataReadyCelEvent != null)
         DataReadyCelEvent(this, GetTempC());
 }