|
||||||||||
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, equals, getAdapter, getAddress, getAddressAsLong, getAddressAsString, getMemoryBanks, hashCode, isAlarming, isPresent, setSpeed, setupContainer, setupContainer, setupContainer, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, 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 devicepublic OneWireContainer2C(DSPortAdapter sourceAdapter, long newAddress)
sourceAdapter
- adapter object required to communicate with
this 1-Wire devicenewAddress
- address of this 1-Wire devicepublic OneWireContainer2C(DSPortAdapter sourceAdapter, String newAddress)
sourceAdapter
- adapter object required to communicate with
this 1-Wire devicenewAddress
- address of this 1-Wire deviceMethod Detail |
public String getName()
getName
in class OneWireContainer
public String getAlternateNames()
getAlternateNames
in class OneWireContainer
public String getDescription()
getDescription
in class OneWireContainer
public int getMaxSpeed()
getMaxSpeed
in class OneWireContainer
public boolean isLinear(byte[] state)
isLinear
in interface PotentiometerContainer
state
- 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 PotentiometerContainer
state
- 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 PotentiometerContainer
state
- state buffer of this 1-Wire Potentiometer device
(returned by readDevice()
)public int numberOfWiperSettings(byte[] state)
numberOfWiperSettings
in interface PotentiometerContainer
state
- state buffer of this 1-Wire Potentiometer device
(returned by readDevice()
)public int potentiometerResistance(byte[] state)
potentiometerResistance
in interface PotentiometerContainer
state
- state buffer of this 1-Wire Potentiometer device
(returned by readDevice()
)public int getCurrentWiperNumber(byte[] state)
numberOfPotentiometers()
.getCurrentWiperNumber
in interface PotentiometerContainer
state
- state buffer of this 1-Wire Potentiometer device
(returned by readDevice()
)public void setCurrentWiperNumber(int wiper_number, byte[] state)
numberOfPotentiometers()
.setCurrentWiperNumber
in interface PotentiometerContainer
wiper_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 PotentiometerContainer
state
- state buffer of this Potentiometer One Wire Device
(returned by readDevice()
)true
if it is enabled; false
if notpublic void setChargePump(boolean charge_pump_on, byte[] state)
setChargePump
in interface PotentiometerContainer
charge_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 errorpublic int getWiperPosition() throws OneWireIOException, OneWireException
getWiperPosition
in interface PotentiometerContainer
OneWireIOException
- Data was not written correctlyOneWireException
- Could not find devicepublic boolean setWiperPosition(int position) throws OneWireIOException, OneWireException
setWiperPosition
in interface PotentiometerContainer
position
- 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 devicepublic int increment(boolean reselect) throws OneWireIOException, OneWireException
increment
in interface PotentiometerContainer
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)OneWireIOException
- Data was not written correctlyOneWireException
- Could not find devicepublic int decrement(boolean reselect) throws OneWireIOException, OneWireException
decrement
in interface PotentiometerContainer
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)OneWireIOException
- Data was not written correctlyOneWireException
- Could not find devicepublic int increment() throws OneWireIOException, OneWireException
increment
in interface PotentiometerContainer
OneWireIOException
- Data was not written correctlyOneWireException
- Could not find devicepublic int decrement() throws OneWireIOException, OneWireException
decrement
in interface PotentiometerContainer
OneWireIOException
- Data was not written correctlyOneWireException
- Counld not find devicepublic byte[] readDevice() throws OneWireIOException, OneWireException
writeDevice
to finalize the one or more change.readDevice
in interface OneWireSensor
OneWireIOException
- Data was not read correctlyOneWireException
- Could not find devicepublic void writeDevice(byte[] state) throws OneWireIOException, OneWireException
writeDevice
in interface OneWireSensor
state
- 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 |