tmp75.h File Reference

Routines to access TMP75 temperature sensor. More...

Include dependency graph for tmp75.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define TMP75_CONF_F0   3
#define TMP75_CONF_F1   4
#define TMP75_CONF_OS   7
#define TMP75_CONF_POL   2
#define TMP75_CONF_R0   5
#define TMP75_CONF_R1   6
#define TMP75_CONF_SD   0
#define TMP75_CONF_TM   1
#define TMP75_CONFIG_REGISTER   0b00000001
#define tmp75_setup()   tmp75_setup_io()
 Setup tmp75 ports and pins.
#define TMP75_TEMP_REGISTER   0b00000000
#define TMP75_THI_REGISTER   0b00000011
#define TMP75_TLOW_REGISTER   0b00000010

Functions

void tmp75_convert_temp (uns8 addr)
 Start temperature conversion on tmp75.
uns8 tmp75_get_config (uns8 addr)
 Get tmp75 config register.
uns16 tmp75_get_temp (uns8 addr)
 Read temperature from tmp75.
void tmp75_set_config (uns8 addr, uns8 config)
 Set tmp75 config register.
void tmp75_setup_io (void)

Detailed Description

Put the following in your config.h

// - - - - - - - - - - - - - - - - - - - - 
// TMP75 defines
// - - - - - - - - - - - - - - - - - - - - 

#define TMP75_ADDR  0x00

Define Documentation

#define TMP75_CONF_F0   3
#define TMP75_CONF_F1   4
#define TMP75_CONF_OS   7
#define TMP75_CONF_POL   2
#define TMP75_CONF_R0   5
#define TMP75_CONF_R1   6
#define TMP75_CONF_SD   0
#define TMP75_CONF_TM   1
#define TMP75_CONFIG_REGISTER   0b00000001
 
#define tmp75_setup (  )     tmp75_setup_io()
#define TMP75_TEMP_REGISTER   0b00000000
#define TMP75_THI_REGISTER   0b00000011
#define TMP75_TLOW_REGISTER   0b00000010

Function Documentation

void tmp75_convert_temp ( uns8  addr  ) 

This routine starts the temperature conversion in the tmp75. Issue this command before actually reading the temperature.

needs fixing

00107                                    {
00109 //  i2c_start();
00110 //  i2c_send_byte(0x90 + addr); 
00111 //  i2c_send_byte(ds1631_start_convert);    
00112 //  i2c_stop(); 
00113 }

uns8 tmp75_get_config ( uns8  addr  ) 

Gets the tmp75 config register (memory location 0x01)

00103 {
00104     return tmp75_read(addr, TMP75_CONFIG_REGISTER);
00105 }

Here is the call graph for this function:

uns16 tmp75_get_temp ( uns8  addr  ) 

Returns 16bit raw temperature register from tmp75.

00116 {
00117     return tmp75_read_16bit(addr, TMP75_TEMP_REGISTER);
00118 
00119 }

Here is the call graph for this function:

void tmp75_set_config ( uns8  addr,
uns8  config 
)

Sets the tmp75 config register

00098 {
00099     tmp75_write(addr, TMP75_CONFIG_REGISTER, config);
00100 }

Here is the call graph for this function:

void tmp75_setup_io ( void   ) 

Generated on Fri Aug 19 09:09:38 2011 for Pic Pack Library by  doxygen 1.6.1