|
|||||||||
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
iButton container for iButton family type 2C (hex). This family type is a 'digital potentiometer' (DS2890).
Field Summary | |
static byte |
DECREMENT
Useful constant for one wire communications. |
static byte |
INCREMENT
Useful constant for one wire communications. |
static byte |
READ_CONTROL
Useful constant for one wire communications. |
static byte |
READ_POSITION
Useful constant for one wire communications. |
static byte |
WRITE_CONTROL
Useful constant for one wire communications. |
static byte |
WRITE_POSITION
Useful constant for one wire communications. |
Constructor Summary | |
OneWireContainer2C()
Default constructor |
|
OneWireContainer2C(DSPortAdapter sourceAdapter,
byte[] newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
|
OneWireContainer2C(DSPortAdapter sourceAdapter,
long newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
|
OneWireContainer2C(DSPortAdapter sourceAdapter,
java.lang.String newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
Method Summary | |
int |
decrement()
Decrements the wiper position after selecting the part. |
int |
decrement(boolean reselect)
Decrements the wiper position. |
java.lang.String |
getAlternateNames()
Retrieve the alternate Dallas Semiconductor part numbers or names. |
int |
getCurrentWiperNumber(byte[] state)
Gets the currently selected wiper number. |
java.lang.String |
getDescription()
Retrieve a short description of the function of the iButton type. |
int |
getMaxSpeed()
Returns the maximum speed this iButton or 1-Wire device can communicate at. |
java.lang.String |
getName()
Retrieve the Dallas Semiconductor part number of the iButton as a string. |
int |
getWiperPosition()
Get the current wiper position of the 2890. |
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 2890'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. |
byte[] |
readDevice()
This method retrieves the 1-Wire device sensor state. |
void |
setChargePump(boolean charge_pump_on,
byte[] state)
Set the 2890'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. |
void |
writeDevice(byte[] state)
This method write 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 |
Field Detail |
public static final byte WRITE_CONTROL
public static final byte READ_CONTROL
public static final byte WRITE_POSITION
public static final byte READ_POSITION
public static final byte INCREMENT
public static final byte DECREMENT
Constructor Detail |
public OneWireContainer2C()
public OneWireContainer2C(DSPortAdapter sourceAdapter, byte[] newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire devicepublic OneWireContainer2C(DSPortAdapter sourceAdapter, long newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire devicepublic OneWireContainer2C(DSPortAdapter sourceAdapter, java.lang.String newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire deviceMethod Detail |
public java.lang.String getName()
getName
in class OneWireContainer
String
representation of the iButton name.public java.lang.String getAlternateNames()
getAlternateNames
in class OneWireContainer
String
representation of the alternate names.public java.lang.String getDescription()
getDescription
in class OneWireContainer
String
representation of the function description.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 (reaturned by readDevice()).public boolean wiperSettingsAreVolatile(byte[] state)
wiperSettingsAreVolatile
in interface PotentiometerContainer
state
- State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).public int numberOfPotentiometers(byte[] state)
numberOfPotentiometers
in interface PotentiometerContainer
state
- State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).public int numberOfWiperSettings(byte[] state)
numberOfWiperSettings
in interface PotentiometerContainer
state
- State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).public int potentiometerResistance(byte[] state)
potentiometerResistance
in interface PotentiometerContainer
state
- State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).public int getCurrentWiperNumber(byte[] state)
getCurrentWiperNumber
in interface PotentiometerContainer
state
- State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).public void setCurrentWiperNumber(int wiper_number, byte[] state)
setCurrentWiperNumber
in interface PotentiometerContainer
wiper_number
- Wiper number to select for communication.
Valid choices are 0 to 3.state
- State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).public boolean isChargePumpOn(byte[] state)
isChargePumpOn
in interface PotentiometerContainer
state
- State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).public void setChargePump(boolean charge_pump_on, byte[] state)
setChargePump
in interface PotentiometerContainer
charge_pump_on
- True if you want to enable the charge pump.state
- State buffer of the Potentiometer One Wire Device (reaturned by readDevice()).public int getWiperPosition() throws OneWireIOException, OneWireException
getWiperPosition
in interface PotentiometerContainer
OneWireIOException
- OneWireException
- public 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.OneWireIOException
- OneWireException
- public 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
- OneWireException
- public 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
- OneWireException
- public int increment() throws OneWireIOException, OneWireException
increment
in interface PotentiometerContainer
OneWireIOException
- OneWireException
- public int decrement() throws OneWireIOException, OneWireException
decrement
in interface PotentiometerContainer
OneWireIOException
- OneWireException
- public byte[] readDevice() throws OneWireIOException, OneWireException
readDevice
in interface OneWireSensor
byte[]<\code> 1-Wire device sensor state *- Throws:
OneWireIOException
- OneWireException
-
public void writeDevice(byte[] state) throws OneWireIOException, OneWireException
writeDevice
in interface OneWireSensor
state
- - byte array of clock register page contentsOneWireIOException
- OneWireException
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |