com.dalsemi.onewire.container
Interface PotentiometerContainer

All Superinterfaces:
OneWireSensor
All Known Implementing Classes:
OneWireContainer2C

public interface PotentiometerContainer
extends OneWireSensor

1-Wire Switch interface class for basic potentiometer operations. This class should be implemented for each potentiometer type 1-Wire device. Currently there is only the DS2890, but it appears that plans have been made for more complex parts with more wipers, different possible number of wiper positions, etc.

Version:
0.00, 31 August 2000

Method Summary
 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()
          Get 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.
 boolean isChargePumpOn(byte[] state)
          Determines if the Potentiometer's charge pump is enabled.
 boolean isLinear(byte[] state)
          Query to see if this Potentiometer One Wire Device has linear potentiometer element(s) or logarithmic potentiometer element(s).
 int numberOfPotentiometers(byte[] state)
          Query to see how many potentiometers this Potentiometer One Wire Device has.
 int numberOfWiperSettings(byte[] state)
          Query to find the number of wiper settings that any wiper on this Potentiometer One Wire Device can have.
 int potentiometerResistance(byte[] state)
          Query to find the resistance value of the potentiometer.
 void setChargePump(boolean charge_pump_on, byte[] state)
          Set the Potentiometer's charge pump.
 void setCurrentWiperNumber(int wiper_number, byte[] state)
          Sets the currently selected wiper number.
 boolean setWiperPosition(int position)
          Set the wiper position for the potentiometer.
 boolean wiperSettingsAreVolatile(byte[] state)
          Query to see if this Potentiometer One Wire Device's wiper settings are volatile or non-volatile.
 
Methods inherited from interface com.dalsemi.onewire.container.OneWireSensor
readDevice, writeDevice
 

Method Detail

isLinear

public boolean isLinear(byte[] state)
Query to see if this Potentiometer One Wire Device has linear potentiometer element(s) or logarithmic potentiometer element(s).
Parameters:
state - State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).
Returns:
True if this device has linear potentiometer element(s). False if this device has logarithmic potentiometer element(s).

wiperSettingsAreVolatile

public boolean wiperSettingsAreVolatile(byte[] state)
Query to see if this Potentiometer One Wire Device's wiper settings are volatile or non-volatile.
Parameters:
state - State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).
Returns:
True if the wiper settings are volatile. False if the wiper settings are non-volatile.

numberOfPotentiometers

public int numberOfPotentiometers(byte[] state)
Query to see how many potentiometers this Potentiometer One Wire Device has.
Parameters:
state - State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).
Returns:
The number of potentiometers on this device.

numberOfWiperSettings

public int numberOfWiperSettings(byte[] state)
Query to find the number of wiper settings that any wiper on this Potentiometer One Wire Device can have.
Parameters:
state - State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).
Returns:
Number of wiper positions available.

potentiometerResistance

public int potentiometerResistance(byte[] state)
Query to find the resistance value of the potentiometer.
Parameters:
state - State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).
Returns:
The resistance value in k-Ohms.

getCurrentWiperNumber

public 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 One Wire Device (reaturned by readDevice()).
Returns:
The current wiper number.

setCurrentWiperNumber

public void setCurrentWiperNumber(int wiper_number,
                                  byte[] state)
Sets the currently selected wiper number. All wiper actions 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 One Wire Device (reaturned by readDevice()).

isChargePumpOn

public boolean isChargePumpOn(byte[] state)
Determines if the Potentiometer's charge pump is enabled.
Parameters:
state - State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).
Returns:
True if it is enabled, false if not.
Throws:
OneWireIOException -  
OneWireException -  

setChargePump

public void setChargePump(boolean charge_pump_on,
                          byte[] state)
Set 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 if you want to enable the charge pump.
state - State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).
Returns:
True if the operation was successful, false if there was an error.
Throws:
OneWireIOException -  
OneWireException -  

getWiperPosition

public int getWiperPosition()
                     throws OneWireIOException,
                            OneWireException
Get the current wiper position of the Potentiometer. The wiper position is between 0 and numberOfWiperPositions(), and describes the voltage output.
Returns:
The wiper position between 0 and numberOfWiperPositions().
Throws:
OneWireIOException -  
OneWireException -  

setWiperPosition

public boolean setWiperPosition(int position)
                         throws OneWireIOException,
                                OneWireException
Set the wiper position for the potentiometer.
Parameters:
position - The position to set the wiper.
Returns:
True if the operation was successful, false otherwise.
Throws:
OneWireIOException -  
OneWireException -  

increment

public int increment(boolean reselect)
              throws OneWireIOException,
                     OneWireException
Increments the wiper position.
Parameters:
reselect - Increment/Decrement can be called without resetting the part if the last call was an Increment/Decrement. True if you want to select the part (you must call with true after any other one-wire method)
Returns:
The new position of the wiper (0-numberOfWiperPositions()).
Throws:
OneWireIOException -  
OneWireException -  

decrement

public int decrement(boolean reselect)
              throws OneWireIOException,
                     OneWireException
Decrements the wiper position.
Parameters:
reselect - Increment/Decrement can be called without resetting the part if the last call was an Increment/Decrement. True if you want to select the part (you must call with true after any other one-wire method)
Returns:
The new position of the wiper (0-numberOfWiperPositions()).
Throws:
OneWireIOException -  
OneWireException -  

increment

public int increment()
              throws OneWireIOException,
                     OneWireException
Increments the wiper position after selecting the part.
Returns:
The new position of the wiper (0-numberOfWiperPositions()).
Throws:
OneWireIOException -  
OneWireException -  

decrement

public int decrement()
              throws OneWireIOException,
                     OneWireException
Decrements the wiper position after selecting the part.
Returns:
The new position of the wiper (0-numberOfWiperPositions()).
Throws:
OneWireIOException -  
OneWireException -