RTEMS 6.1-rc2
Loading...
Searching...
No Matches
i2c-ds1621.h
1#ifndef I2C_DS_1621_DRIVER_H
2#define I2C_DS_1621_DRIVER_H
3
4/* Trivial i2c driver for the maxim DS1621 temperature sensor;
5 * just implements reading constant conversions with 8-bit
6 * resolution.
7 * Demonstrates the implementation of a i2c high-level driver.
8 */
9
10/*
11 * Authorship
12 * ----------
13 * This software was created by
14 * Till Straumann <strauman@slac.stanford.edu>, 2005,
15 * Stanford Linear Accelerator Center, Stanford University.
16 *
17 * Acknowledgement of sponsorship
18 * ------------------------------
19 * This software was produced by
20 * the Stanford Linear Accelerator Center, Stanford University,
21 * under Contract DE-AC03-76SFO0515 with the Department of Energy.
22 *
23 * Government disclaimer of liability
24 * ----------------------------------
25 * Neither the United States nor the United States Department of Energy,
26 * nor any of their employees, makes any warranty, express or implied, or
27 * assumes any legal liability or responsibility for the accuracy,
28 * completeness, or usefulness of any data, apparatus, product, or process
29 * disclosed, or represents that its use would not infringe privately owned
30 * rights.
31 *
32 * Stanford disclaimer of liability
33 * --------------------------------
34 * Stanford University makes no representations or warranties, express or
35 * implied, nor assumes any liability for the use of this software.
36 *
37 * Stanford disclaimer of copyright
38 * --------------------------------
39 * Stanford University, owner of the copyright, hereby disclaims its
40 * copyright and all other rights in this software. Hence, anyone may
41 * freely use it for any purpose without restriction.
42 *
43 * Maintenance of notices
44 * ----------------------
45 * In the interest of clarity regarding the origin and status of this
46 * SLAC software, this and all the preceding Stanford University notices
47 * are to remain affixed to any copy or derivative of this software made
48 * or distributed by the recipient and are to be affixed to any copy of
49 * software made or distributed by the recipient that contains a copy or
50 * derivative of this software.
51 *
52 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
53 */
54
55#define DS1621_CMD_READ_TEMP 0xaa
56#define DS1621_CMD_CSR_ACCESS 0xac
57#define DS1621_CMD_START_CONV 0xee
58
59/* CSR bits */
60#define DS1621_CSR_DONE (1<<7)
61#define DS1621_CSR_TEMP_HI (1<<6) /* T >= hi register */
62#define DS1621_CSR_TEMP_LO (1<<5) /* T <= lo register */
63#define DS1621_CSR_NVMEM_BSY (1<<4) /* non-volatile memory busy */
64#define DS1621_CSR_OUT_POL (1<<1) /* Thermostat output active polarity */
65#define DS1621_CSR_1SHOT (1<<0) /* Oneshot mode */
66
67#include <rtems.h>
68#include <rtems/libi2c.h>
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74/* for registration with libi2c */
75extern rtems_libi2c_drv_t *i2c_ds1621_driver_descriptor;
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif
Legacy I2C Library.
This header file defines the RTEMS Classic API.
Definition: libi2c.h:297