de.wagner_ibw.iow.i2c
Class LM75

java.lang.Object
  |
  +--de.wagner_ibw.iow.i2c.AbstractI2CDevice
        |
        +--de.wagner_ibw.iow.i2c.LM75
All Implemented Interfaces:
I2CDevice

public class LM75
extends AbstractI2CDevice

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:

Unsupported features are:

Author:
Thomas Wagner

Field Summary
static int CLASS
          Group 1 part of slave address for LM75 (LM75 device specific constant).
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.
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).
 
Fields inherited from class de.wagner_ibw.iow.i2c.AbstractI2CDevice
MAX_I2C_LENGTH
 
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.
 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.
 void setConfiguration(int mode, int polarity)
           
 void setIowDevice(AbstractIowDevice iow)
          Sets the reference to an IO-Warrior device for write report operations.
 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
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
PCF8570 device specific constants.

See Also:
Constant Field Values

CLASS

public static final int CLASS
Group 1 part of slave address for LM75 (LM75 device specific constant).

See Also:
Constant Field Values

REG_TEMP

public static final int REG_TEMP
Constant for register pointer for 'Temperature' register (LM75 device specific constant).

See Also:
Constant Field Values

REG_CONFIG

public static final int REG_CONFIG
Constant for register pointer for 'Configuration' register (LM75 device specific constant).

See Also:
Constant Field Values

REG_TEMP_HYST

public static final int REG_TEMP_HYST
Constant for register pointer for 'THyst Set Point' register (LM75 device specific constant).

See Also:
Constant Field Values

REG_TEMP_OS

public static final int REG_TEMP_OS
Constant for register pointer for 'TOS Set Point' register (LM75 device specific constant).

See Also:
Constant Field Values

MODE_COMPARATOR

public static final int MODE_COMPARATOR
Constant for 'Comparator' mode.

See Also:
Constant Field Values

MODE_INTERRUPT

public static final int MODE_INTERRUPT
Constant for 'Interrupt' mode.

See Also:
Constant Field Values

POLARITY_ACTIVE_LOW

public static final int POLARITY_ACTIVE_LOW
Constant for O.S. output polarity 'active low'.

See Also:
Constant Field Values

POLARITY_ACTIVE_HIGH

public static final int POLARITY_ACTIVE_HIGH
Constant for O.S. output polarity 'active high'.

See Also:
Constant Field Values
Constructor Detail

LM75

public LM75(int deviceAddress)
     throws java.lang.Exception
Constructor

Parameters:
deviceAddress - Group 2 part of slave address (possible values 0...7).
Throws:
java.lang.Exception - If anything goes wrong.
Method Detail

getT

public double getT()
            throws java.lang.Exception
Returns Current temperature measured by this LM75.

Returns:
Temperature as double value from this LM75.
Throws:
java.lang.Exception - If anything goes wrong.

getConfiguration

public void getConfiguration()
                      throws java.lang.Exception
java.lang.Exception

getTHyst

public double getTHyst()
                throws java.lang.Exception
Returns THYST set point stored in this LM75.

Returns:
HYST temperature as double value from this LM75.
Throws:
java.lang.Exception - If anything goes wrong.

getTOs

public double getTOs()
              throws java.lang.Exception
Returns TOS set point stored in this LM75.

Returns:
OS temperature as double value from this LM75.
Throws:
java.lang.Exception - If anything goes wrong.

setConfiguration

public void setConfiguration(int mode,
                             int polarity)
                      throws java.lang.Exception
java.lang.Exception

setTHyst

public void setTHyst(double value)
              throws java.lang.Exception
Sets THYST set point in this LM75.

Parameters:
value - Desired HYST temperature as doubel value.
java.lang.Exception

setTOs

public void setTOs(double value)
            throws java.lang.Exception
Sets TOS set point in this LM75.

Parameters:
value - Desired OS temperature as doubel value.
java.lang.Exception

getMode

public int getMode()
Getter for mode of this LM75 device.

Returns:
Mode of this I2C device.

getPolarity

public int getPolarity()
Getter for polarity of this LM75 device.

Returns:
Polarity of this I2C device.

setIowDevice

public void setIowDevice(AbstractIowDevice iow)
Description copied from interface: I2CDevice
Sets the reference to an IO-Warrior device for write report operations.

Specified by:
setIowDevice in interface I2CDevice
Specified by:
setIowDevice in class AbstractI2CDevice
Parameters:
iow - Instance of an IO-Warrior device.

toString

public java.lang.String toString()
Returns Information about this LM75 as String.

Overrides:
toString in class AbstractI2CDevice
Returns:
String representation of information obout this LM75 (slave address, temperatures, ...).

equals

public boolean equals(java.lang.Object o)
Indicates whether some other LM75 object is "equal to" this one. Criterias are the i2c device class and i2c device address (in I2CAddress).

Overrides:
equals in class AbstractI2CDevice
Returns:
True if this object is the same as the obj argument; false otherwise.
Since:
0.9.4

hashCode

public int hashCode()
Returns a hash code value for this LM75 object. It is derived from the i2c device class and i2c device address.

Overrides:
hashCode in class AbstractI2CDevice
Returns:
a hash code value for this object.
Since:
0.9.4