1-Wire API for .NET Version 4.00
Public Member Functions

PotentiometerContainer Interface Reference

1-Wire® Potentiometer interface class for basic potentiometer operations. More...

Inherits com::dalsemi::onewire::container::OneWireSensor.

Inherited by OneWireContainer2C.

List of all members.

Public Member Functions

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

Detailed Description

1-Wire® Potentiometer 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.

The PotentiometerContainer methods can be organized into the following categories:

Usage

Display some features of PotentiometerContainer instance 'pc':

 
      byte[] state = pc.readDevice();
      if (!(pc.isChargePumpOn()))
          pc.setChargePump(true, state);
      pc.writeDevice(state);
      pc.setWiperPosition(127);
      pc.increment();
      pc.decrement();
  
See also:
com.dalsemi.onewire.container.OneWireContainer2C
OneWireSensor
ClockContainer
TemperatureContainer
SwitchContainer
Version:
0.00, 31 August 2000
Author:
KLA

Member Function Documentation

int decrement ( boolean  reselect) throws OneWireIOException, OneWireException

Decrements the wiper position.

Parameters:
reselectdecrement() 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()).
Exceptions:
com.dalsemi.onewire.adapter.OneWireIOExceptionData was not written correctly
com.dalsemi.onewire.OneWireExceptionCould not find device

Implemented in OneWireContainer2C.

int decrement ( ) throws OneWireIOException, OneWireException

Decrements the wiper position after selecting the part.

Returns:
new position of wiper (0 to numberOfWiperPositions())
Exceptions:
com.dalsemi.onewire.adapter.OneWireIOExceptionData was not written correctly
com.dalsemi.onewire.OneWireExceptionCould not find device

Implemented in OneWireContainer2C.

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:
statestate buffer of the Potentiometer 1-Wire Device (returned by readDevice())
Returns:
current wiper number

Implemented in OneWireContainer2C.

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()
Exceptions:
com.dalsemi.onewire.adapter.OneWireIOExceptionData was not read correctly
com.dalsemi.onewire.OneWireExceptionCould not find device

Implemented in OneWireContainer2C.

int increment ( boolean  reselect) throws OneWireIOException, OneWireException

Increments the wiper position by one.

Parameters:
reselectincrement() 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())
Exceptions:
com.dalsemi.onewire.adapter.OneWireIOExceptionData was not written correctly
com.dalsemi.onewire.OneWireExceptionCould not find device

Implemented in OneWireContainer2C.

int increment ( ) throws OneWireIOException, OneWireException

Increments the wiper position after selecting the part.

Returns:
new position of wiper (0 to numberOfWiperPositions())
Exceptions:
com.dalsemi.onewire.adapter.OneWireIOExceptionData was not written correctly
com.dalsemi.onewire.OneWireExceptionCould not find device

Implemented in OneWireContainer2C.

boolean isChargePumpOn ( byte[]  state)

Determines if the Potentiometer's charge pump is enabled.

Parameters:
statestate buffer of the Potentiometer 1-Wire Device (returned by readDevice())
Returns:
true if enabled, false if not

Implemented in OneWireContainer2C.

boolean isLinear ( byte[]  state)

Querys to see if this Potentiometer 1-Wire Device has linear potentiometer element(s) or logarithmic potentiometer element(s).

Parameters:
statestate 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)

Implemented in OneWireContainer2C.

int numberOfPotentiometers ( byte[]  state)

Querys to see how many potentiometers this Potentiometer 1-Wire Device has.

Parameters:
statestate buffer of the Potentiometer 1-Wire Device (returned by readDevice())
Returns:
number of potentiometers on this device

Implemented in OneWireContainer2C.

int numberOfWiperSettings ( byte[]  state)

Querys to find the number of wiper settings that any wiper on this Potentiometer 1-Wire Device can have.

Parameters:
statestate buffer of the Potentiometer 1-Wire Device (returned by readDevice())
Returns:
number of wiper positions available

Implemented in OneWireContainer2C.

int potentiometerResistance ( byte[]  state)

Querys to find the resistance value of the potentiometer.

Parameters:
statestate buffer of the Potentiometer 1-Wire Device (returned by readDevice())
Returns:
resistance value in k-Ohms

Implemented in OneWireContainer2C.

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_ontrue to enable the charge pump, false to disable charge pump
statestate buffer of the Potentiometer 1-Wire Device (returned by readDevice())
Returns:
true if the operation was successful, false if there was an error

Implemented in OneWireContainer2C.

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_numberwiper number to select for communication
statestate buffer of the Potentiometer 1-Wire Device (returned by readDevice())

Implemented in OneWireContainer2C.

boolean setWiperPosition ( int  position) throws OneWireIOException, OneWireException

Sets the wiper position of the potentiometer.

Parameters:
positionposition to set the wiper to
Returns:
true if the operation was successful, false otherwise
Exceptions:
com.dalsemi.onewire.adapter.OneWireIOExceptionData was not written correctly
com.dalsemi.onewire.OneWireExceptionCould not find device

Implemented in OneWireContainer2C.

boolean wiperSettingsAreVolatile ( byte[]  state)

Querys to see if this Potentiometer 1-Wire Device's wiper settings are volatile or non-volatile.

Parameters:
statestate 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.

Implemented in OneWireContainer2C.


The documentation for this interface was generated from the following file: