diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2005-11-03 02:52:41 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2005-11-03 02:52:41 +0000 |
commit | 78111c37c6174de035a546ca661f0f68bb68c4cd (patch) | |
tree | 4021f8669cde59979f675ec45a6dc940c13420a9 /c/src/libchip/i2c/i2c-ds1621.h | |
parent | 2005-11-02 straumanatslacdotstanford.edu (diff) | |
download | rtems-78111c37c6174de035a546ca661f0f68bb68c4cd.tar.bz2 |
2005-11-02 straumanatslacdotstanford.edu
* libchip/i2c/i2c-2b-eeprom.c, libchip/i2c/i2c-2b-eeprom.h,
libchip/i2c/i2c-ds1621.c, libchip/i2c/i2c-ds1621.h: New files.
* libchip/Makefile.am, libchip/preinstall.am, wrapup/Makefile.am:
added a simple API/library
for i2c devices and drivers for i2c 2-byte eeproms and a ds1621
temperature sensor; API is documented in libi2c.h
Diffstat (limited to 'c/src/libchip/i2c/i2c-ds1621.h')
-rw-r--r-- | c/src/libchip/i2c/i2c-ds1621.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/c/src/libchip/i2c/i2c-ds1621.h b/c/src/libchip/i2c/i2c-ds1621.h new file mode 100644 index 0000000000..802af03727 --- /dev/null +++ b/c/src/libchip/i2c/i2c-ds1621.h @@ -0,0 +1,39 @@ +/* $Id$ */ +#ifndef I2C_DS_1621_DRIVER_H +#define I2C_DS_1621_DRIVER_H + +/* Trivial i2c driver for the maxim DS1621 temperature sensor; + * just implements reading constant conversions with 8-bit + * resolution. + * Demonstrates the implementation of a i2c high-level driver. + */ + +/* Author: Till Straumann, 2005 */ + +#define DS1621_CMD_READ_TEMP 0xaa +#define DS1621_CMD_CSR_ACCESS 0xac +#define DS1621_CMD_START_CONV 0xee + +/* CSR bits */ +#define DS1621_CSR_DONE (1<<7) +#define DS1621_CSR_TEMP_HI (1<<6) /* T >= hi register */ +#define DS1621_CSR_TEMP_LO (1<<5) /* T <= lo register */ +#define DS1621_CSR_NVMEM_BSY (1<<4) /* non-volatile memory busy */ +#define DS1621_CSR_OUT_POL (1<<1) /* Thermostat output active polarity */ +#define DS1621_CSR_1SHOT (1<<0) /* Oneshot mode */ + +#include <rtems.h> +#include <rtems/libi2c.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* for registration with libi2c */ +extern rtems_libi2c_drv_t *i2c_ds1621_driver_descriptor; + +#ifdef __cplusplus +} +#endif + +#endif |