|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.wagner_ibw.iow.i2c.AbstractI2CDevice | +--de.wagner_ibw.iow.i2c.LM75
This is the implemenation of the LM75 device , "Digital Temperature
Sensor and Thermal Watchdog with Two-Wire Interface", by National
Semiconductors.
This class almost supports features of the device:
Nested Class Summary | |
private class |
LM75.LM75Temp
Inner class for LM75 temperature representation. |
Field Summary | |
static int |
CLASS
Group 1 part of slave address for LM75 (LM75 device specific constant). |
private int |
lastRegisterPointer
Flag for last register access. |
private int |
mode
Current mode (initialized with factory default value, read from LM75). |
static int |
MODE_COMPARATOR
Constant for 'Comparator' mode. |
static int |
MODE_INTERRUPT
Constant for 'Interrupt' mode. |
static java.lang.String |
NAME
PCF8570 device specific constants. |
private int |
polarity
Current polarity (initialized with factory default value, read from LM75). |
static int |
POLARITY_ACTIVE_HIGH
Constant for O.S. output polarity 'active high'. |
static int |
POLARITY_ACTIVE_LOW
Constant for O.S. output polarity 'active low'. |
static int |
REG_CONFIG
Constant for register pointer for 'Configuration' register (LM75 device specific constant). |
static int |
REG_TEMP
Constant for register pointer for 'Temperature' register (LM75 device specific constant). |
static int |
REG_TEMP_HYST
Constant for register pointer for 'THyst Set Point' register (LM75 device specific constant). |
static int |
REG_TEMP_OS
Constant for register pointer for 'TOS Set Point' register (LM75 device specific constant). |
private double |
tCurrent
Current temperature (measured by LM75). |
private double |
tHyst
Current setted THYST temperature (initialized with factory default value). |
private double |
tOs
Current setted OS temperature (initialized with factory default value). |
Fields inherited from class de.wagner_ibw.iow.i2c.AbstractI2CDevice |
devAdr, iow, MAX_I2C_LENGTH, monitor, readQueue, writeAckQueue |
Constructor Summary | |
LM75(int deviceAddress)
Constructor |
Method Summary | |
boolean |
equals(java.lang.Object o)
Indicates whether some other LM75 object is "equal to" this one. |
void |
getConfiguration()
|
int |
getMode()
Getter for mode of this LM75 device. |
int |
getPolarity()
Getter for polarity of this LM75 device. |
double |
getT()
Returns Current temperature measured by this LM75. |
private double |
getTemperature()
Support method for getting temperature value for register. |
double |
getTHyst()
Returns THYST set point stored in this LM75. |
double |
getTOs()
Returns TOS set point stored in this LM75. |
int |
hashCode()
Returns a hash code value for this LM75 object. |
private void |
init()
|
void |
setConfiguration(int mode,
int polarity)
|
void |
setIowDevice(AbstractIowDevcie iow)
Sets the reference to an iow device for write report operations. |
private void |
setRegister(int regAdr,
int count,
int firstByte,
int secondByte)
Support method for setting writeable registers. |
private void |
setRegisterPointer(int pointer)
Support method for setting register pointer. |
void |
setTHyst(double value)
Sets THYST set point in this LM75. |
void |
setTOs(double value)
Sets TOS set point in this LM75. |
java.lang.String |
toString()
Returns Information about this LM75 as String. |
Methods inherited from class de.wagner_ibw.iow.i2c.AbstractI2CDevice |
getI2cAddress, getName, readI2C, reportReceived, setMonitor, writeI2C |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String NAME
public static final int CLASS
public static final int REG_TEMP
public static final int REG_CONFIG
public static final int REG_TEMP_HYST
public static final int REG_TEMP_OS
public static final int MODE_COMPARATOR
public static final int MODE_INTERRUPT
public static final int POLARITY_ACTIVE_LOW
public static final int POLARITY_ACTIVE_HIGH
private double tOs
private double tHyst
private double tCurrent
private int mode
private int polarity
private int lastRegisterPointer
Constructor Detail |
public LM75(int deviceAddress) throws java.lang.Exception
deviceAddress
- Group 2 part of slave address (possible values 0...7).
java.lang.Exception
- If anything goes wrong.Method Detail |
private void init() throws java.lang.Exception
java.lang.Exception
public double getT() throws java.lang.Exception
java.lang.Exception
- If anything goes wrong.public void getConfiguration() throws java.lang.Exception
java.lang.Exception
public double getTHyst() throws java.lang.Exception
java.lang.Exception
- If anything goes wrong.public double getTOs() throws java.lang.Exception
java.lang.Exception
- If anything goes wrong.public void setConfiguration(int mode, int polarity) throws java.lang.Exception
java.lang.Exception
public void setTHyst(double value) throws java.lang.Exception
value
- Desired HYST temperature as doubel value.
java.lang.Exception
public void setTOs(double value) throws java.lang.Exception
value
- Desired OS temperature as doubel value.
java.lang.Exception
public int getMode()
public int getPolarity()
private void setRegisterPointer(int pointer) throws java.lang.Exception
pointer
- Desired register (possible values:
REG_TEMP (0), REG_CONFIG (1), REG_TEMP_HYST (2), REG_TEMP_OS (3)).
java.lang.Exception
- If anything goes wrong.private double getTemperature() throws java.lang.Exception
java.lang.Exception
- If anything goes wrong.private void setRegister(int regAdr, int count, int firstByte, int secondByte) throws java.lang.Exception
regAdr
- Desired register (possible values: REG_CONFIG (1), REG_TEMP_HYST (2), REG_TEMP_OS (3)).count
- Counter of bytes of pay load (possible values: 1 or 2).firstByte
- First byte of the pay load (must set).secondByte
- Second byte of the pay load (if counter is 1 this param must be set 0).
java.lang.Exception
- If anything goes wrong.public void setIowDevice(AbstractIowDevcie iow)
I2CDevice
setIowDevice
in interface I2CDevice
setIowDevice
in class AbstractI2CDevice
iow
- Instance of an iow device.public java.lang.String toString()
toString
in class AbstractI2CDevice
public boolean equals(java.lang.Object o)
equals
in class AbstractI2CDevice
public int hashCode()
hashCode
in class AbstractI2CDevice
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |