@Override public GpioPin getProvisionedPin(Pin pin){ for(GpioPin gpio_pin : pins){ if(gpio_pin.getPin().equals(pin)){ return gpio_pin; } } return null; }
@Override public GpioPin getProvisionedPin(Pin pin){ for(GpioPin gpio_pin : pins){ if(gpio_pin.getPin().equals(pin)){ return gpio_pin; } } return null; }
public void setProgrammableGainAmplifier(ProgrammableGainAmplifierValue pga, GpioPin...pin){ for(GpioPin p : pin){ this.pga[p.getPin().getAddress()] = pga; } }
public void setEventThreshold(double threshold, GpioPin...pin){ for(GpioPin p : pin){ setEventThreshold(threshold, p.getPin()); } }
public void setShutdownOptions(Boolean unexport, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(unexport); } }
public void setShutdownOptions(Boolean unexport, PinState state, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(unexport, state); } }
public void setShutdownOptions(GpioPinShutdown options, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(options); } }
public void setShutdownOptions(Boolean unexport, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(unexport); } }
public void setShutdownOptions(Boolean unexport, PinState state, PinPullResistance resistance, PinMode mode, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(unexport, state, resistance, mode); } }
@Override public void setPullResistance(PinPullResistance resistance, GpioPin... pin) { if (pin == null || pin.length == 0) { throw new IllegalArgumentException("Missing pin argument."); } for (GpioPin p : pin) { // ensure the requested pin has been provisioned if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } // set pin pull resistance p.setPullResistance(resistance); } }
@Override public void setMode(PinMode mode, GpioPin... pin) { if (pin == null || pin.length == 0) { throw new IllegalArgumentException("Missing pin argument."); } for (GpioPin p : pin) { // ensure the requested pin has been provisioned if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } // set pin mode p.setMode(mode); } }
public void setShutdownOptions(Boolean unexport, PinState state, PinPullResistance resistance, PinMode mode, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(unexport, state, resistance, mode); } }
@Override public PinPullResistance getPullResistance(GpioPin pin) { // ensure the requested pin has been provisioned if (!pins.contains(pin)) { throw new GpioPinNotProvisionedException(pin.getPin()); } // get pin pull resistance return pin.getPullResistance(); }
public void setShutdownOptions(GpioPinShutdown options, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(options); } }
@Override public PinMode getMode(GpioPin pin) { // ensure the requested pin has been provisioned if (!pins.contains(pin)) { throw new GpioPinNotProvisionedException(pin.getPin()); } // return pin edge setting return pin.getMode(); }
public void setShutdownOptions(Boolean unexport, PinState state, PinPullResistance resistance, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(unexport, state, resistance); } }
@Override protected void doStart() throws Exception { pin.addListener(this); log.trace("Start Listening GPIO {}", pin.getPin().getAddress()); }
@Override protected void doStop() throws Exception { pin.removeListener(this); log.trace("Stop Listening GPIO {}", pin.getPin().getAddress()); }
@Override public PinMode getMode(GpioPin pin) { // ensure the requested pin has been provisioned if (!pins.contains(pin)) { throw new GpioPinNotProvisionedException(pin.getPin()); } // return pin edge setting return pin.getMode(); }
public void setShutdownOptions(Boolean unexport, PinState state, PinPullResistance resistance, GpioPin... pin) { for (GpioPin p : pin) { if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } p.setShutdownOptions(unexport, state, resistance); } }