Interface PotentiometerContainer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int decrement()
      Decrements the wiper position after selecting the part.
      int decrement​(boolean reselect)
      Decrements the wiper position.
      int getCurrentWiperNumber​(byte[] state)
      Gets the currently selected wiper number.
      int getWiperPosition()
      Gets the current wiper position of the Potentiometer.
      int increment()
      Increments the wiper position after selecting the part.
      int increment​(boolean reselect)
      Increments the wiper position by one.
      boolean isChargePumpOn​(byte[] state)
      Determines if the Potentiometer's charge pump is enabled.
      boolean isLinear​(byte[] state)
      Queries to see if this Potentiometer 1-Wire Device has linear potentiometer element(s) or logarithmic potentiometer element(s).
      int numberOfPotentiometers​(byte[] state)
      Queries to see how many potentiometers this Potentiometer 1-Wire Device has.
      int numberOfWiperSettings​(byte[] state)
      Queries to find the number of wiper settings that any wiper on this Potentiometer 1-Wire Device can have.
      int potentiometerResistance​(byte[] state)
      Queries to find the resistance value of the potentiometer.
      void setChargePump​(boolean charge_pump_on, byte[] state)
      Sets the state of the Potentiometer's charge pump.
      void setCurrentWiperNumber​(int wiper_number, byte[] state)
      Sets the currently selected wiper number.
      boolean setWiperPosition​(int position)
      Sets the wiper position of the potentiometer.
      boolean wiperSettingsAreVolatile​(byte[] state)
      Queries to see if this Potentiometer 1-Wire Device's wiper settings are volatile or non-volatile.
    • Method Detail

      • isLinear

        boolean isLinear​(byte[] state)
        Queries to see if this Potentiometer 1-Wire Device has linear potentiometer element(s) or logarithmic potentiometer element(s).
        Parameters:
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
        Returns:
        true if this device has linear potentiometer element(s), false if this device has logarithmic potentiometer element(s)
      • wiperSettingsAreVolatile

        boolean wiperSettingsAreVolatile​(byte[] state)
        Queries to see if this Potentiometer 1-Wire Device's wiper settings are volatile or non-volatile.
        Parameters:
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
        Returns:
        true if the wiper settings are volatile, false if the wiper settings are non-volatile.
      • numberOfPotentiometers

        int numberOfPotentiometers​(byte[] state)
        Queries to see how many potentiometers this Potentiometer 1-Wire Device has.
        Parameters:
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
        Returns:
        number of potentiometers on this device
      • numberOfWiperSettings

        int numberOfWiperSettings​(byte[] state)
        Queries to find the number of wiper settings that any wiper on this Potentiometer 1-Wire Device can have.
        Parameters:
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
        Returns:
        number of wiper positions available
      • potentiometerResistance

        int potentiometerResistance​(byte[] state)
        Queries to find the resistance value of the potentiometer.
        Parameters:
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
        Returns:
        resistance value in k-Ohms
      • getCurrentWiperNumber

        int getCurrentWiperNumber​(byte[] state)
        Gets the currently selected wiper number. All wiper actions affect this wiper. The number of wipers is the same as numberOfPotentiometers().
        Parameters:
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
        Returns:
        current wiper number
      • setCurrentWiperNumber

        void setCurrentWiperNumber​(int wiper_number,
                                   byte[] state)
        Sets the currently selected wiper number. All wiper actions will then affect this wiper. The number of wipers is the same as numberOfPotentiometers().
        Parameters:
        wiper_number - wiper number to select for communication
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
      • isChargePumpOn

        boolean isChargePumpOn​(byte[] state)
        Determines if the Potentiometer's charge pump is enabled.
        Parameters:
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
        Returns:
        true if enabled, false if not
      • setChargePump

        void setChargePump​(boolean charge_pump_on,
                           byte[] state)
        Sets the state of the Potentiometer's charge pump. This decreases the wiper's resistance, but increases the power consumption by the part. Vdd must be connected to use the charge pump.
        Parameters:
        charge_pump_on - true to enable the charge pump, false to disable charge pump
        state - state buffer of the Potentiometer 1-Wire Device (returned by readDevice())
      • getWiperPosition

        int getWiperPosition()
                      throws OneWireIOException,
                             OneWireException
        Gets the current wiper position of the Potentiometer. The wiper position is between 0 and numberOfWiperPositions(), and describes the voltage output.
        Returns:
        wiper position between 0 and numberOfWiperPositions()
        Throws:
        OneWireIOException - Data was not read correctly
        OneWireException - Could not find device
      • setWiperPosition

        boolean setWiperPosition​(int position)
                          throws OneWireIOException,
                                 OneWireException
        Sets the wiper position of the potentiometer.
        Parameters:
        position - position to set the wiper to
        Returns:
        true if the operation was successful, false otherwise
        Throws:
        OneWireIOException - Data was not written correctly
        OneWireException - Could not find device
      • increment

        int increment​(boolean reselect)
               throws OneWireIOException,
                      OneWireException
        Increments the wiper position by one.
        Parameters:
        reselect - increment() can be called without resetting the part if the last call was an increment() or decrement(). true if device is to be selected (must be called with true after any other 1-wire method)
        Returns:
        new position of wiper (0 to numberOfWiperPositions())
        Throws:
        OneWireIOException - Data was not written correctly
        OneWireException - Could not find device
      • decrement

        int decrement​(boolean reselect)
               throws OneWireIOException,
                      OneWireException
        Decrements the wiper position.
        Parameters:
        reselect - decrement() can be called without resetting the part if the last call was an increment() or decrement(). true if device is to be selected (must be called with true after any other 1-wire method)
        Returns:
        new position of wiper (0 to numberOfWiperPositions()).
        Throws:
        OneWireIOException - Data was not written correctly
        OneWireException - Could not find device