Routines to access TMP75 temperature sensor. More...
#include "pic_utils.h"
#include "i2c.h"
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) |
Put the following in your config.h
// - - - - - - - - - - - - - - - - - - - - // TMP75 defines // - - - - - - - - - - - - - - - - - - - - #define TMP75_ADDR 0x00
Definition in file tmp75.h.
#define TMP75_CONFIG_REGISTER 0b00000001 |
Definition at line 54 of file tmp75.h.
Referenced by tmp75_get_config(), and tmp75_set_config().
#define TMP75_TEMP_REGISTER 0b00000000 |
Definition at line 53 of file tmp75.h.
Referenced by tmp75_get_temp().
void tmp75_convert_temp | ( | uns8 | addr | ) |
uns8 tmp75_get_config | ( | uns8 | addr | ) |
Gets the tmp75 config register (memory location 0x01)
Definition at line 102 of file tmp75.c.
References TMP75_CONFIG_REGISTER, and tmp75_read().
uns16 tmp75_get_temp | ( | uns8 | addr | ) |
Returns 16bit raw temperature register from tmp75.
Definition at line 115 of file tmp75.c.
References tmp75_read_16bit(), and TMP75_TEMP_REGISTER.
void tmp75_set_config | ( | uns8 | addr, | |
uns8 | config | |||
) |
Sets the tmp75 config register
Definition at line 97 of file tmp75.c.
References TMP75_CONFIG_REGISTER, and tmp75_write().
void tmp75_setup_io | ( | void | ) |