Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public OutputPin(short pinNumber, IGpioInterface gpioInterface, PinBase pinBase) : base(pinNumber, gpioInterface, pinBase)
 {
     this.Direction = Direction.Out;
 }
Exemplo n.º 4
0
 public OutputPin NewOutputPin(short pinNumber, PinBase pinBase)
 {
     return(new OutputPin(pinNumber, this.gpioInterface, pinBase));
 }
Exemplo n.º 5
0
 public Gpio(IGpioInterface gpioInterface)
 {
     this.gpioInterface  = gpioInterface;
     this.defaultPinBase = gpioInterface.GetDefaultPinBase();
 }
Exemplo n.º 6
0
 public Gpio(IGpioInterface gpioInterface, PinBase defaultPinBase)
 {
     this.gpioInterface  = gpioInterface;
     this.defaultPinBase = defaultPinBase;
 }
Exemplo n.º 7
0
 public InputPin(short pinNumber, IGpioInterface gpioInterface, PinBase pinBase) : base(pinNumber, gpioInterface, pinBase)
 {
     this.Direction = Direction.In;
     this.gpioInterface.SubscribeToValueChanged(this.RawPinNumber, this.ValueChanged);
 }