Beispiel #1
0
 public Pin(short pinNumber, IGpioInterface gpioInterface, PinBase pinBase)
 {
     this.PinNumber     = pinNumber;
     this.RawPinNumber  = (short)(pinBase + pinNumber);
     this.gpioInterface = gpioInterface;
     this.gpioInterface.Init(this.RawPinNumber);
 }
Beispiel #2
0
        public Pin NewPin(short pinNumber, PinBase pinBase, Direction direction = Direction.Out, short value = 0)
        {
            var newPin = new Pin(pinNumber, this.gpioInterface, pinBase);

            newPin.Direction = direction;
            newPin.Value     = value;

            return(newPin);
        }
Beispiel #3
0
 public OutputPin(short pinNumber, IGpioInterface gpioInterface, PinBase pinBase) : base(pinNumber, gpioInterface, pinBase)
 {
     this.Direction = Direction.Out;
 }
Beispiel #4
0
 public OutputPin NewOutputPin(short pinNumber, PinBase pinBase)
 {
     return(new OutputPin(pinNumber, this.gpioInterface, pinBase));
 }
Beispiel #5
0
 public Gpio(IGpioInterface gpioInterface)
 {
     this.gpioInterface  = gpioInterface;
     this.defaultPinBase = gpioInterface.GetDefaultPinBase();
 }
Beispiel #6
0
 public Gpio(IGpioInterface gpioInterface, PinBase defaultPinBase)
 {
     this.gpioInterface  = gpioInterface;
     this.defaultPinBase = defaultPinBase;
 }
 public InputPin(short pinNumber, IGpioInterface gpioInterface, PinBase pinBase) : base(pinNumber, gpioInterface, pinBase)
 {
     this.Direction = Direction.In;
     this.gpioInterface.SubscribeToValueChanged(this.RawPinNumber, this.ValueChanged);
 }