@Override public void export(Pin pin, PinMode mode) { // make sure to set the pin mode super.export(pin, mode); setMode(pin, mode); }
@Override public void export(Pin pin, PinMode mode) { // make sure to set the pin mode super.export(pin, mode); setMode(pin, mode); }
@Override public void export(Pin pin, PinMode mode) { // make sure to set the pin mode super.export(pin, mode); setMode(pin, mode); }
@Override public void export(Pin pin, PinMode mode, PinState defaultState) { // export the pin and set it's mode export(pin, mode); // apply default state if one was provided and only if this pin is a digital output if(defaultState != null && mode == PinMode.DIGITAL_OUTPUT) { setState(pin, defaultState); } }
@Override public void export(Pin pin, PinMode mode) { // make sure to set the pin mode super.export(pin, mode); setMode(pin, mode); }
@Override public void export(Pin pin, PinMode mode, PinState defaultState) { // export the pin and set it's mode export(pin, mode); // apply default state if one was provided and only if this pin is a digital output if(defaultState != null && mode == PinMode.DIGITAL_OUTPUT) { setState(pin, defaultState); } }
@Override public void export(Pin pin, PinMode mode) { // make sure to set the pin mode super.export(pin, mode); setMode(pin, mode); }
@Override public void export(Pin pin, PinMode mode, PinState defaultState) { super.export(pin, mode); //System.out.println("-- EXPORTING PIN [" + pin.getAddress() + "] to mode [" + mode.getName() + "]"); // get mode configured direction value int direction = mode.getDirection().getValue(); // if a default state was provided and the direction is OUT, then override the // pin direction to include initial state value if(defaultState != null && mode.getDirection() == PinDirection.OUT){ if(defaultState == PinState.LOW) direction = GpioUtil.DIRECTION_LOW; else if(defaultState == PinState.HIGH) direction = GpioUtil.DIRECTION_HIGH; } // if not already exported, export the pin and set the pin direction if(!GpioUtil.isExported(pin.getAddress())){ GpioUtil.export(pin.getAddress(), direction); } // if the pin is already exported, then check its current configured direction // if the direction does not match, then set the new direction for the pin else if(GpioUtil.getDirection(pin.getAddress()) != mode.getDirection().getValue()){ GpioUtil.setDirection(pin.getAddress(), direction); } // set the pin input/output mode setMode(pin, mode); }
@Override public void export(Pin pin, PinMode mode, PinState defaultState) { super.export(pin, mode); //System.out.println("-- EXPORTING PIN [" + pin.getAddress() + "] to mode [" + mode.getName() + "]"); // get mode configured direction value int direction = mode.getDirection().getValue(); // if a default state was provided and the direction is OUT, then override the // pin direction to include initial state value if(defaultState != null && mode.getDirection() == PinDirection.OUT){ if(defaultState == PinState.LOW) direction = GpioUtil.DIRECTION_LOW; else if(defaultState == PinState.HIGH) direction = GpioUtil.DIRECTION_HIGH; } // if not already exported, export the pin and set the pin direction if(!GpioUtil.isExported(pin.getAddress())){ GpioUtil.export(pin.getAddress(), direction); } // if the pin is already exported, then check its current configured direction // if the direction does not match, then set the new direction for the pin else if(GpioUtil.getDirection(pin.getAddress()) != mode.getDirection().getValue()){ GpioUtil.setDirection(pin.getAddress(), direction); } // set the pin input/output mode setMode(pin, mode); }