Wim Huiskamp / LM77

Dependents:   mbed_HP03SA_LM77

Embed: (wiki syntax)

« Back to documentation index

LM77 Class Reference

LM77 Class Reference

Create an LM77 Class instance. More...

#include <LM77.h>

Public Types

enum  PowerMode { POWER_NORMAL, POWER_SHUTDOWN }
 

Represents the power mode of the LM77.

More...
enum  IntMode { INT_COMPARATOR, INT_EVENT }
 

Represents INT pin mode of the LM77.

More...
enum  PinPolarity { ACTIVE_LOW, ACTIVE_HIGH }
 

Represents Pin polarity of the LM77.

More...
enum  FaultQueue { FAULT_QUEUE_1, FAULT_QUEUE_4 }
 

Represents OS pin fault queue length of the LM77.

More...

Public Member Functions

 LM77 (I2C *i2c, char deviceAddress=LM77_SA0)
 Create an LM77 device instance.
LM77::PowerMode getPowerMode ()
 Get the current power mode of the LM77.
void setPowerMode (PowerMode mode)
 Set the power mode of the LM77.
LM77::IntMode getIntMode ()
 Get the current INT pin mode of the LM77 Reset value is INT_COMPARATOR.
void setIntMode (IntMode mode)
 Set the INT pin mode of the LM77.
LM77::PinPolarity getIntPolarity ()
 Get the current INT pin polarity of the LM77 Reset value is ACTIVE_LOW.
void setIntPolarity (PinPolarity polarity)
 Set the INT pin polarity of the LM77.
LM77::PinPolarity getTCritPolarity ()
 Get the current T_CRIT_A pin polarity of the LM77 Reset value is ACTIVE_LOW.
void setTCritPolarity (PinPolarity polarity)
 Set the T_CRIT_A pin polarity of the LM77.
LM77::FaultQueue getFaultQueue ()
 Get the current pin and flag fault queue length of the LM77 Reset value is FAULT_QUEUE_1, Pins and flags are asserted after 1 fault.
void setFaultQueue (FaultQueue queue)
 Set the pin and flag fault queue length of the LM77.
float getCritAlertTemp ()
 Get the current critical alert temperature threshold of the LM77 Reset value is 80.0 °C.
void setCritAlertTemp (float temp)
 Set the Critical alert temperature threshold of the LM77 Reset value is 80.0 °C.
float getLowAlertTemp ()
 Get the current Low temperature alert threshold of the LM77 Reset value is 10.0 °C.
void setLowAlertTemp (float temp)
 Set the current Low temperature alert threshold of the LM77 Reset value is 10.0 °C.
float getHighAlertTemp ()
 Get the current High temperature alert threshold of the LM77 Reset value is 64.0 °C.
void setHighAlertTemp (float temp)
 Set the High temperature alert threshold of the LM77 Reset value is 64.0 °C.
float getAlertHyst ()
 Get the current alert temperature hysteresis of the LM77 Reset value is 2.0 °C.
void setAlertHyst (float temp)
 Set the alert temperature hysteresis of the LM77 Reset value is 2.0 °C.
int getTemperatureInt (void)
 Get Temperature as Int in °Celsius x 10.
float getTemperature (void)
 Get Temperature as float in °Celsius.
int getAlertFlags (void)
 Get the Alert flags of the LM77.
 operator float ()
 A shorthand for Temperature()
float celsiusToFahrenheit (float celsius)
 Convert Temperature from °Celsius into °Fahrenheit.
bool getStatus (void)
 Get Status.

Detailed Description

Create an LM77 Class instance.

Definition at line 129 of file LM77.h.


Member Enumeration Documentation

enum FaultQueue

Represents OS pin fault queue length of the LM77.

Enumerator:
FAULT_QUEUE_1 

Pins and flags are asserted after 1 fault.

FAULT_QUEUE_4 

Pins and flags are asserted after 4 consecutive faults.

Definition at line 156 of file LM77.h.

enum IntMode

Represents INT pin mode of the LM77.

Enumerator:
INT_COMPARATOR 

INT pin asserted when temp exceeds an alert threshold, and de-asserted when temp crosses alert hysteresis threshold or when LM77 is read.

It will be re-asserted when condition is still true after reading.

INT_EVENT 

INT pin asserted when temp reaches an alert threshold or threshold +/- hysteris and only de-asserted when a register has been read.

It will be re-asserted when next event occurs.

Definition at line 142 of file LM77.h.

Represents Pin polarity of the LM77.

Enumerator:
ACTIVE_LOW 

Pin is a logic low when asserted, and a logic high when de-asserted.

ACTIVE_HIGH 

Pin is a logic high when asserted, and a logic low when de-asserted.

Definition at line 149 of file LM77.h.

enum PowerMode

Represents the power mode of the LM77.

Enumerator:
POWER_NORMAL 

Chip is enabled and samples every 100ms.

POWER_SHUTDOWN 

Chip is in low-power shutdown mode.

Definition at line 135 of file LM77.h.


Constructor & Destructor Documentation

LM77 ( I2C *  i2c,
char  deviceAddress = LM77_SA0 
)

Create an LM77 device instance.

Parameters:
i2cI2C Bus
chardeviceAddress I2C slaveaddress (defaults to LM77_SA0).
i2cI2C Bus
chardeviceAddress I2C slaveaddress

Definition at line 38 of file LM77.cpp.


Member Function Documentation

float celsiusToFahrenheit ( float  celsius )

Convert Temperature from °Celsius into °Fahrenheit.

Parameters:
floatcelsius in °Celsius
Returns:
float temperature in °Fahrenheit

Definition at line 413 of file LM77.cpp.

int getAlertFlags ( void   )

Get the Alert flags of the LM77.

Returns:
The current Alert flags as int.

Definition at line 374 of file LM77.cpp.

float getAlertHyst (  )

Get the current alert temperature hysteresis of the LM77 Reset value is 2.0 °C.

Returns:
The current alert temperature hysteresis in °C.

Definition at line 332 of file LM77.cpp.

float getCritAlertTemp (  )

Get the current critical alert temperature threshold of the LM77 Reset value is 80.0 °C.

Get the current Critical alert temperature threshold of the LM77 Reset value is 80.0 °C.

Returns:
The current crtitcal alert temperature threshold in °C.
The current Critical alert temperature threshold in °C.

Definition at line 265 of file LM77.cpp.

LM77::FaultQueue getFaultQueue (  )

Get the current pin and flag fault queue length of the LM77 Reset value is FAULT_QUEUE_1, Pins and flags are asserted after 1 fault.

Get the current pin and flag fault queue length of the LM77.

Returns:
The current pin and flag fault queue length as an FaultQueue enum.

Definition at line 224 of file LM77.cpp.

float getHighAlertTemp (  )

Get the current High temperature alert threshold of the LM77 Reset value is 64.0 °C.

Returns:
The current High temperature alert threshold in °C.

Definition at line 309 of file LM77.cpp.

LM77::IntMode getIntMode (  )

Get the current INT pin mode of the LM77 Reset value is INT_COMPARATOR.

Get the current INT pin mode of the LM77.

Returns:
The current INT pin mode as an IntMode enum.

Definition at line 103 of file LM77.cpp.

LM77::PinPolarity getIntPolarity (  )

Get the current INT pin polarity of the LM77 Reset value is ACTIVE_LOW.

Get the current INT pin polarity of the LM77.

Returns:
The current INT pin polarity as an PinPolarity enum.

Definition at line 145 of file LM77.cpp.

float getLowAlertTemp (  )

Get the current Low temperature alert threshold of the LM77 Reset value is 10.0 °C.

Returns:
The current Low temperature alert threshold in °C.

Definition at line 287 of file LM77.cpp.

LM77::PowerMode getPowerMode (  )

Get the current power mode of the LM77.

Returns:
The current power mode as a PowerMode enum.

Definition at line 62 of file LM77.cpp.

bool getStatus ( void   )

Get Status.

Returns:
bool Sensor ready

Definition at line 46 of file LM77.cpp.

LM77::PinPolarity getTCritPolarity (  )

Get the current T_CRIT_A pin polarity of the LM77 Reset value is ACTIVE_LOW.

Get the current T_CRIT_A pin polarity of the LM77.

Returns:
The current T_CRIT_A pin polarity as an PinPolarity enum.

Definition at line 184 of file LM77.cpp.

float getTemperature ( void   )

Get Temperature as float in °Celsius.

Returns:
float Temperature in °Celsius

Definition at line 395 of file LM77.cpp.

int getTemperatureInt ( void   )

Get Temperature as Int in °Celsius x 10.

Get Temperature as int in °Celsius x 10.

Returns:
int Temperature in °Celsius x 10

Definition at line 354 of file LM77.cpp.

operator float (  )

A shorthand for Temperature()

Returns:
The current temperature measurement in °C.

Definition at line 401 of file LM77.cpp.

void setAlertHyst ( float  temp )

Set the alert temperature hysteresis of the LM77 Reset value is 2.0 °C.

Parameters:
tempThe new alert temperature hysteris in °C.
tempThe new alert temperature hysteresis in °C.

Definition at line 343 of file LM77.cpp.

void setCritAlertTemp ( float  temp )

Set the Critical alert temperature threshold of the LM77 Reset value is 80.0 °C.

Set the critical alert temperature threshold of the LM77 Reset value is 80.0 °C.

Parameters:
tempThe new Critical alert temperature threshold in °C.
tempThe new critical alert temperature threshold in °C.

Definition at line 276 of file LM77.cpp.

void setFaultQueue ( FaultQueue  queue )

Set the pin and flag fault queue length of the LM77.

Parameters:
queueThe new pin and flag fault queue length as an FaultQueue enum.

Definition at line 243 of file LM77.cpp.

void setHighAlertTemp ( float  temp )

Set the High temperature alert threshold of the LM77 Reset value is 64.0 °C.

Parameters:
tempThe new High temperature alert threshold in °C.

Definition at line 320 of file LM77.cpp.

void setIntMode ( IntMode  mode )

Set the INT pin mode of the LM77.

Parameters:
modeThe new INT pin mode as an IntMode enum.

Definition at line 122 of file LM77.cpp.

void setIntPolarity ( PinPolarity  polarity )

Set the INT pin polarity of the LM77.

Parameters:
polarityThe new INT pin polarity as an PinPolarity enum.

Definition at line 163 of file LM77.cpp.

void setLowAlertTemp ( float  temp )

Set the current Low temperature alert threshold of the LM77 Reset value is 10.0 °C.

Parameters:
tempThe new Low alert temperature threshold in °C.

Definition at line 298 of file LM77.cpp.

void setPowerMode ( PowerMode  mode )

Set the power mode of the LM77.

Parameters:
modeThe new power mode as a PowerMode enum.

Definition at line 81 of file LM77.cpp.

void setTCritPolarity ( PinPolarity  polarity )

Set the T_CRIT_A pin polarity of the LM77.

Parameters:
polarityThe new T_CRIT_A pin polarity as an PinPolarity enum.

Definition at line 202 of file LM77.cpp.