ds1631.h File Reference

DS1631 temperature sensor routines. More...

#include "pic_utils.h"
#include "i2c.h"

Include dependency graph for ds1631.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ds1631_access_config   0xAC
#define ds1631_access_th   0xA1
#define ds1631_access_tl   0xA2
#define ds1631_read_temp   0xAA
#define ds1631_software_por   0x54
#define ds1631_start_convert   0x51
#define ds1631_stop_convert   0x22

Functions

void ds1631_convert_temp (uns8 addr)
 Start temperature conversion on ds1631.
uns8 ds1631_get_config (uns8 addr)
 Get ds1631 config register.
uns16 ds1631_get_temp (uns8 addr)
 Read temperature from ds1631.
void ds1631_set_config (uns8 addr, uns8 config)
 Set ds1631 config register.
void ds1631_setup (void)
 Setup ds1631 ports and pins.


Detailed Description

A library to communicate with the DS1631 sensor

Ian Harris 2008 imharris [at] gmail.com

Released under the "do whatever you like with this but if you use it send me an email" license. Oh, and if it breaks, you get to keep both pieces.

Definition in file ds1631.h.


Define Documentation

#define ds1631_access_config   0xAC

Definition at line 24 of file ds1631.h.

Referenced by ds1631_get_config(), and ds1631_set_config().

#define ds1631_access_th   0xA1

Definition at line 22 of file ds1631.h.

#define ds1631_access_tl   0xA2

Definition at line 23 of file ds1631.h.

#define ds1631_read_temp   0xAA

Definition at line 21 of file ds1631.h.

Referenced by ds1631_get_temp().

#define ds1631_software_por   0x54

Definition at line 25 of file ds1631.h.

#define ds1631_start_convert   0x51

Definition at line 19 of file ds1631.h.

Referenced by ds1631_convert_temp().

#define ds1631_stop_convert   0x22

Definition at line 20 of file ds1631.h.


Function Documentation

void ds1631_convert_temp ( uns8  addr  ) 

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

Definition at line 17 of file ds1631.c.

References ds1631_start_convert, i2c_send_byte(), i2c_start(), and i2c_stop().

Here is the call graph for this function:

uns8 ds1631_get_config ( uns8  addr  ) 

Gets the ds1631 config register (memory location 0x01)

Definition at line 12 of file ds1631.c.

References ds1631_access_config, and i2c_read_eeprom().

Here is the call graph for this function:

uns16 ds1631_get_temp ( uns8  addr  ) 

Returns 16bit raw temperature register from ds1631. Note that if you are in one-shot mode (the default) you must have already issued a start_convert and waited until it is complete (to check for completion you can either wait long enough, or query the config register to check).

Definition at line 24 of file ds1631.c.

References ds1631_read_temp, and i2c_read_eeprom_16bit().

Here is the call graph for this function:

void ds1631_set_config ( uns8  addr,
uns8  config 
)

Sets the ds1631 config register

Definition at line 7 of file ds1631.c.

References ds1631_access_config, and i2c_write_eeprom().

Here is the call graph for this function:

void ds1631_setup ( void   ) 

Definition at line 3 of file ds1631.c.

References i2c_setup().

Here is the call graph for this function:


Generated on Fri May 16 12:18:47 2008 for Pic Pack by  doxygen 1.5.5