public static PinPortConfiguration DefaultPinPortConfiguration()
        {
            PinPortConfiguration configuration = new PinPortConfiguration
            {
                Digital = PinPortConfiguration.DEFAULT_DIGITAL,
                Output = PinPortConfiguration.DEFAULT_OUTPUT,

                ChangeTypeD = PinPortConfiguration.Trigger.None,
                DefaultValueD = false,

                DefaultValueA = 0x00,
                Increment = 0x00,
                Threshold = 0x00,
            };

            return configuration;
        }
Beispiel #2
0
        public static PinPortConfiguration DefaultPinPortConfiguration()
        {
            PinPortConfiguration configuration = new PinPortConfiguration
            {
                Digital = PinPortConfiguration.DEFAULT_DIGITAL,
                Output  = PinPortConfiguration.DEFAULT_OUTPUT,

                ChangeTypeD   = PinPortConfiguration.Trigger.None,
                DefaultValueD = false,

                DefaultValueA = 0x00,
                Increment     = 0x00,
                Threshold     = 0x00,
            };

            return(configuration);
        }
Beispiel #3
0
        public static PinPortConfiguration GetPinPortConfiguration(HomeDevice homeDevice)
        {
            PinPortConfiguration configuration = DefaultPinPortConfiguration();

            if (homeDevice is Button)
            {
                configuration.Output      = false;
                configuration.Digital     = true;
                configuration.ChangeTypeD = PinPortConfiguration.Trigger.FallingEdge;
            }
            else if (homeDevice is SwitchButton)
            {
                configuration.Output      = false;
                configuration.Digital     = true;
                configuration.ChangeTypeD = PinPortConfiguration.Trigger.Both;
            }
            else if (homeDevice is Light || homeDevice is WallPlug)
            {
                configuration.Output        = true;
                configuration.Digital       = true;
                configuration.DefaultValueD = false;
            }
            else if (homeDevice is Dimmable)
            {
                configuration.Output        = true;
                configuration.Digital       = false;
                configuration.DefaultValueA = 0x00;
            }
            else if (homeDevice is PresenceSensor)
            {
                configuration.Output      = false;
                configuration.Digital     = true;
                configuration.ChangeTypeD = PinPortConfiguration.Trigger.RisingEdge;
            }
            else if (homeDevice is DoorLock)
            {
                configuration.Output  = true;
                configuration.Digital = true;
            }

            return(configuration);
        }