|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.dalsemi.onewire.container.OneWireContainer
|
+--com.dalsemi.onewire.container.OneWireContainer2C
1-Wire® container that encapsulates the functionality of the 1-Wire family type 2C (hex), Dallas Semiconductor part number: DS2890, 1-Wire Digital Potentiometer.
| Constructor Summary | |
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. |
|
| Method Summary | |
int |
decrement()
Decrements the wiper position after selecting the part. |
int |
decrement(boolean reselect)
Decrements the wiper position. |
String |
getAlternateNames()
Retrieves the alternate Dallas Semiconductor part numbers or names. |
int |
getCurrentWiperNumber(byte[] state)
Gets the currently selected wiper number. |
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. |
String |
getName()
Retrieves the Dallas Semiconductor part number of this 1-Wire device as a string. |
int |
getWiperPosition()
Gets the current wiper position of this device. |
int |
increment()
Increments the wiper position after selecting the part. |
int |
increment(boolean reselect)
Increments the wiper position. |
boolean |
isChargePumpOn(byte[] state)
Determines if this device's charge pump is enabled. |
boolean |
isLinear(byte[] state)
Queries to see if this Potentiometer One Wire Device has linear potentiometer element(s) or logarithmic potentiometer element(s). |
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. |
byte[] |
readDevice()
Retrieves the 1-Wire device sensor state. |
void |
setChargePump(boolean charge_pump_on,
byte[] state)
Sets this device's charge pump. |
void |
setCurrentWiperNumber(int wiper_number,
byte[] state)
Sets the currently selected wiper number. |
boolean |
setWiperPosition(int position)
Sets the wiper position for the potentiometer. |
boolean |
wiperSettingsAreVolatile(byte[] state)
Queries to see if this 1-Wire Potentiometer device's wiper settings are volatile or non-volatile. |
void |
writeDevice(byte[] state)
Writes the 1-Wire device sensor state that have been changed by the 'set' methods. |
| Methods inherited from class com.dalsemi.onewire.container.OneWireContainer |
doSpeed, getAdapter, getAddress, getAddressAsLong, getAddressAsString, getMemoryBanks, isAlarming, isPresent, setSpeed, setupContainer, setupContainer, setupContainer |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OneWireContainer2C()
public OneWireContainer2C(DSPortAdapter sourceAdapter,
byte[] newAddress)
sourceAdapter - adapter object required to communicate with
this 1-Wire devicenewAddress - address of this 1-Wire device
public OneWireContainer2C(DSPortAdapter sourceAdapter,
long newAddress)
sourceAdapter - adapter object required to communicate with
this 1-Wire devicenewAddress - address of this 1-Wire device
public OneWireContainer2C(DSPortAdapter sourceAdapter,
String newAddress)
sourceAdapter - adapter object required to communicate with
this 1-Wire devicenewAddress - address of this 1-Wire device| Method Detail |
public String getName()
getName in class OneWireContainerpublic String getAlternateNames()
getAlternateNames in class OneWireContainerpublic String getDescription()
getDescription in class OneWireContainerpublic int getMaxSpeed()
getMaxSpeed in class OneWireContainerpublic boolean isLinear(byte[] state)
isLinear in interface PotentiometerContainerstate - state buffer of the Potentiometer One Wire Device
(returned by readDevice())true if this device has linear potentiometer
element(s); false if this device has logarithmic
potentiometer element(s)public boolean wiperSettingsAreVolatile(byte[] state)
wiperSettingsAreVolatile in interface PotentiometerContainerstate - state buffer of the 1-Wire Potentiometer device
(returned by readDevice())true if the wiper settings are volatile;
false if the wiper settings are non-volatilepublic int numberOfPotentiometers(byte[] state)
numberOfPotentiometers in interface PotentiometerContainerstate - state buffer of this 1-Wire Potentiometer device
(returned by readDevice())public int numberOfWiperSettings(byte[] state)
numberOfWiperSettings in interface PotentiometerContainerstate - state buffer of this 1-Wire Potentiometer device
(returned by readDevice())public int potentiometerResistance(byte[] state)
potentiometerResistance in interface PotentiometerContainerstate - state buffer of this 1-Wire Potentiometer device
(returned by readDevice())public int getCurrentWiperNumber(byte[] state)
numberOfPotentiometers().getCurrentWiperNumber in interface PotentiometerContainerstate - state buffer of this 1-Wire Potentiometer device
(returned by readDevice())
public void setCurrentWiperNumber(int wiper_number,
byte[] state)
numberOfPotentiometers().setCurrentWiperNumber in interface PotentiometerContainerwiper_number - wiper number to select for communication.
Valid choices are 0 to 3state - state buffer of this 1-Wire Potentiometer device
(returned by readDevice())public boolean isChargePumpOn(byte[] state)
isChargePumpOn in interface PotentiometerContainerstate - state buffer of this Potentiometer One Wire Device
(returned by readDevice())true if it is enabled; false if not
public void setChargePump(boolean charge_pump_on,
byte[] state)
setChargePump in interface PotentiometerContainercharge_pump_on - true if you want to enable the charge pumpstate - state buffer of this Potentiometer One Wire Device
(returned by readDevice())true if the operation was successful;
false if there was an error
public int getWiperPosition()
throws OneWireIOException,
OneWireException
getWiperPosition in interface PotentiometerContainerOneWireIOException - Data was not written correctlyOneWireException - Could not find device
public boolean setWiperPosition(int position)
throws OneWireIOException,
OneWireException
setWiperPosition in interface PotentiometerContainerposition - the position to set the wiper. This value will be cast
to a byte, only the 8 least significant bits matter.true if the operation was successful;
false otherwiseOneWireIOException - Data was not written correctlyOneWireException - Could not find device
public int increment(boolean reselect)
throws OneWireIOException,
OneWireException
increment in interface PotentiometerContainerreselect - 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)OneWireIOException - Data was not written correctlyOneWireException - Could not find device
public int decrement(boolean reselect)
throws OneWireIOException,
OneWireException
decrement in interface PotentiometerContainerreselect - 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)OneWireIOException - Data was not written correctlyOneWireException - Could not find device
public int increment()
throws OneWireIOException,
OneWireException
increment in interface PotentiometerContainerOneWireIOException - Data was not written correctlyOneWireException - Could not find device
public int decrement()
throws OneWireIOException,
OneWireException
decrement in interface PotentiometerContainerOneWireIOException - Data was not written correctlyOneWireException - Counld not find device
public byte[] readDevice()
throws OneWireIOException,
OneWireException
writeDevice to finalize the one or more change.readDevice in interface OneWireSensorOneWireIOException - Data was not read correctlyOneWireException - Could not find device
public void writeDevice(byte[] state)
throws OneWireIOException,
OneWireException
writeDevice in interface OneWireSensorstate - byte array of clock register page contentsOneWireIOException - Data was not written correctlyOneWireException - Could not find device
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||