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

OneWireContainer2C Class Reference

Inherits com::dalsemi::onewire::container::OneWireContainer, and com::dalsemi::onewire::container::PotentiometerContainer.

List of all members.

Public Member Functions

 OneWireContainer2C ()
 Default constructor.
 OneWireContainer2C (DSPortAdapter sourceAdapter, byte[] newAddress)
 Creates a container with a provided adapter object and the address of the 1-Wire device.
 OneWireContainer2C (DSPortAdapter sourceAdapter, long newAddress)
 Creates a container with a provided adapter object and the address of this 1-Wire device.
 OneWireContainer2C (DSPortAdapter sourceAdapter, String newAddress)
 Creates a container with a provided adapter object and the address of this 1-Wire device.
String getName ()
 Retrieves the Maxim Integrated Products part number of this 1-Wire device as a string.
String getAlternateNames ()
 Retrieves the alternate Maxim Integrated Products part numbers or names.
String getDescription ()
 Retrieves a short description of the function of this 1-Wire Device.
int getMaxSpeed ()
 Gets the maximum speed this 1-Wire device can communicate at.
boolean isLinear (byte[] state)
 Queries to see if this Potentiometer One Wire Device has linear potentiometer element(s) or logarithmic potentiometer element(s).
boolean wiperSettingsAreVolatile (byte[] state)
 Queries to see if this 1-Wire Potentiometer device's wiper settings are volatile or non-volatile.
int numberOfPotentiometers (byte[] state)
 Queries to see how many potentiometers this Potentiometer One Wire Device has.
int numberOfWiperSettings (byte[] state)
 Queries to find the number of wiper settings that any wiper on this Potentiometer One Wire Device can have.
int potentiometerResistance (byte[] state)
 Queries 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 this device's charge pump is enabled.
void setChargePump (boolean charge_pump_on, byte[] state)
 Sets this device's charge pump.
int getWiperPosition () throws OneWireIOException, OneWireException
 Gets the current wiper position of this device.
boolean setWiperPosition (int position) throws OneWireIOException, OneWireException
 Sets the wiper position for the potentiometer.
int increment (boolean reselect) throws OneWireIOException, OneWireException
 Increments the wiper position.
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.
byte[] readDevice () throws OneWireIOException, OneWireException
 Retrieves the 1-Wire device sensor state.
void writeDevice (byte[] state) throws OneWireIOException, OneWireException
 Writes the 1-Wire device sensor state that have been changed by the 'set' methods.

Detailed Description

1-Wire® container that encapsulates the functionality of the 1-Wire family type 2C (hex), Maxim Integrated Products part number: DS2890, 1-Wire Digital Potentiometer.

Features

Data sheet

http://pdfserv.maxim-ic.com/arpdf/DS2890.pdf

Version:
0.00, 28 Aug 2000
Author:
KLA

Constructor & Destructor Documentation

OneWireContainer2C ( DSPortAdapter  sourceAdapter,
byte[]  newAddress 
)

Creates a container with a provided adapter object and the address of the 1-Wire device.

Parameters:
sourceAdapteradapter object required to communicate with this 1-Wire device
newAddressaddress of this 1-Wire device
OneWireContainer2C ( DSPortAdapter  sourceAdapter,
long  newAddress 
)

Creates a container with a provided adapter object and the address of this 1-Wire device.

Parameters:
sourceAdapteradapter object required to communicate with this 1-Wire device
newAddressaddress of this 1-Wire device
OneWireContainer2C ( DSPortAdapter  sourceAdapter,
String  newAddress 
)

Creates a container with a provided adapter object and the address of this 1-Wire device.

Parameters:
sourceAdapteradapter object required to communicate with this 1-Wire device
newAddressaddress of this 1-Wire device

Member Function Documentation

int decrement ( boolean  reselect) throws OneWireIOException, OneWireException

Decrements the wiper position.

Parameters:
reselectincrement/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-255)
Exceptions:
OneWireIOExceptionData was not written correctly
OneWireExceptionCould not find device

Implements PotentiometerContainer.

int decrement ( ) throws OneWireIOException, OneWireException

Decrements the wiper position after selecting the part.

Returns:
the new position of the wiper (0-255)
Exceptions:
OneWireIOExceptionData was not written correctly
OneWireExceptionCounld not find device

Implements PotentiometerContainer.

String getAlternateNames ( )

Retrieves the alternate Maxim Integrated Products part numbers or names.

A family of MicroLan devices may have more than one part number depending on packaging.

Returns:
representation of the alternate names

Reimplemented from OneWireContainer.

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 this 1-Wire Potentiometer device (returned by readDevice())
Returns:
the current wiper number

Implements PotentiometerContainer.

String getDescription ( )

Retrieves a short description of the function of this 1-Wire Device.

Returns:
representation of the function description

Reimplemented from OneWireContainer.

int getMaxSpeed ( )

Gets the maximum speed this 1-Wire device can communicate at.

Returns:
maximum speed this device can communicate at

Reimplemented from OneWireContainer.

String getName ( )

Retrieves the Maxim Integrated Products part number of this 1-Wire device as a string.

For example 'DS2890'.

Returns:
representation of this 1-Wire devices name

Reimplemented from OneWireContainer.

int getWiperPosition ( ) throws OneWireIOException, OneWireException

Gets the current wiper position of this device.

The wiper position is between 0 and 255, and describes the voltage output. The output lies between RH and RL.

Returns:
the wiper position between 0 and 255
Exceptions:
OneWireIOExceptionData was not written correctly
OneWireExceptionCould not find device

Implements PotentiometerContainer.

int increment ( boolean  reselect) throws OneWireIOException, OneWireException

Increments the wiper position.

Parameters:
reselectincrement/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-255)
Exceptions:
OneWireIOExceptionData was not written correctly
OneWireExceptionCould not find device

Implements PotentiometerContainer.

int increment ( ) throws OneWireIOException, OneWireException

Increments the wiper position after selecting the part.

Returns:
the new position of the wiper (0-255)
Exceptions:
OneWireIOExceptionData was not written correctly
OneWireExceptionCould not find device

Implements PotentiometerContainer.

boolean isChargePumpOn ( byte[]  state)

Determines if this device's charge pump is enabled.

Parameters:
statestate buffer of this Potentiometer One Wire Device (returned by readDevice())
Returns:
true if it is enabled; false if not

Implements PotentiometerContainer.

boolean isLinear ( byte[]  state)

Queries to see if this Potentiometer One Wire Device has linear potentiometer element(s) or logarithmic potentiometer element(s).

Parameters:
statestate buffer of the Potentiometer One Wire Device (returned by readDevice())
Returns:
true if this device has linear potentiometer element(s); false if this device has logarithmic potentiometer element(s)

Implements PotentiometerContainer.

int numberOfPotentiometers ( byte[]  state)

Queries to see how many potentiometers this Potentiometer One Wire Device has.

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

Implements PotentiometerContainer.

int numberOfWiperSettings ( byte[]  state)

Queries to find the number of wiper settings that any wiper on this Potentiometer One Wire Device can have.

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

Implements PotentiometerContainer.

int potentiometerResistance ( byte[]  state)

Queries to find the resistance value of the potentiometer.

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

Implements PotentiometerContainer.

byte [] readDevice ( ) throws OneWireIOException, OneWireException

Retrieves the 1-Wire device sensor state.

This state is returned as a byte array. Pass this byte array to the static query and set methods. If the device state needs to be changed then call the writeDevice to finalize the one or more change.

Returns:
1-Wire device sensor state
Exceptions:
OneWireIOExceptionData was not read correctly
OneWireExceptionCould not find device

Implements OneWireSensor.

void setChargePump ( boolean  charge_pump_on,
byte[]  state 
)

Sets this device'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 (see the DS2890 datasheet for more information at www.dalsemi.com)

Parameters:
charge_pump_ontrue if you want to enable the charge pump
statestate buffer of this Potentiometer One Wire Device (returned by readDevice())
Returns:
true if the operation was successful; false if there was an error

Implements PotentiometerContainer.

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_numberwiper number to select for communication. Valid choices are 0 to 3
statestate buffer of this 1-Wire Potentiometer device (returned by readDevice())

Implements PotentiometerContainer.

boolean setWiperPosition ( int  position) throws OneWireIOException, OneWireException

Sets the wiper position for the potentiometer.

Parameters:
positionthe position to set the wiper. This value will be cast to a byte, only the 8 least significant bits matter.
Returns:
true if the operation was successful; false otherwise
Exceptions:
OneWireIOExceptionData was not written correctly
OneWireExceptionCould not find device

Implements PotentiometerContainer.

boolean wiperSettingsAreVolatile ( byte[]  state)

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

Parameters:
statestate buffer of the 1-Wire Potentiometer device (returned by readDevice())
Returns:
true if the wiper settings are volatile; false if the wiper settings are non-volatile

Implements PotentiometerContainer.

void writeDevice ( byte[]  state) throws OneWireIOException, OneWireException

Writes the 1-Wire device sensor state that have been changed by the 'set' methods.

It knows which registers have changed by looking at the bitmap fields appended to the state data.

Parameters:
statebyte array of clock register page contents
Exceptions:
OneWireIOExceptionData was not written correctly
OneWireExceptionCould not find device

Implements OneWireSensor.


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