source: rtems/c/src/libchip/i2c/i2c-ds1621.h @ 78111c3

4.104.114.84.95
Last change on this file since 78111c3 was 78111c3, checked in by Till Straumann <strauman@…>, on 11/03/05 at 02:52:41

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

  • Property mode set to 100644
File size: 1000 bytes
Line 
1/* $Id$ */
2#ifndef I2C_DS_1621_DRIVER_H
3#define I2C_DS_1621_DRIVER_H
4
5/* Trivial i2c driver for the maxim DS1621 temperature sensor;
6 * just implements reading constant conversions with 8-bit
7 * resolution.
8 * Demonstrates the implementation of a i2c high-level driver.
9 */
10
11/* Author: Till Straumann, 2005 */
12
13#define DS1621_CMD_READ_TEMP    0xaa
14#define DS1621_CMD_CSR_ACCESS   0xac
15#define DS1621_CMD_START_CONV   0xee
16
17/* CSR bits */
18#define DS1621_CSR_DONE                 (1<<7)
19#define DS1621_CSR_TEMP_HI              (1<<6)  /* T >= hi register */
20#define DS1621_CSR_TEMP_LO              (1<<5)  /* T <= lo register */
21#define DS1621_CSR_NVMEM_BSY    (1<<4)  /* non-volatile memory busy */
22#define DS1621_CSR_OUT_POL              (1<<1)  /* Thermostat output active polarity */
23#define DS1621_CSR_1SHOT                (1<<0)  /* Oneshot mode     */
24
25#include <rtems.h>
26#include <rtems/libi2c.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32/* for registration with libi2c */
33extern rtems_libi2c_drv_t *i2c_ds1621_driver_descriptor;
34
35#ifdef __cplusplus
36}
37#endif
38
39#endif
Note: See TracBrowser for help on using the repository browser.