source: rtems/c/src/libchip/rtc/ds1375-rtc.h @ d371a97

4.104.114.9
Last change on this file since d371a97 was d371a97, checked in by Till Straumann <strauman@…>, on Nov 21, 2007 at 6:23:12 AM

2007-11-20 Till Straumann <strauman@…>

  • libchip/rtc/ds1375.c, libchip/rtc/ds1375-rtc.h: Avoid using 'stdio' before the system is up and fully initialized.
  • Property mode set to 100644
File size: 3.3 KB
Line 
1#ifndef DS1375_I2C_RTC_H
2#define DS1375_I2C_RTC_H
3/* Driver for the Maxim 1375 i2c RTC (TOD only; very simple...) */
4
5/*
6 * Authorship
7 * ----------
8 * This software was created by
9 *
10 *     Till Straumann <strauman@slac.stanford.edu>, 2005-2007,
11 *         Stanford Linear Accelerator Center, Stanford University.
12 *
13 * Acknowledgement of sponsorship
14 * ------------------------------
15 * The software was produced by
16 *     the Stanford Linear Accelerator Center, Stanford University,
17 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
18 *
19 * Government disclaimer of liability
20 * ----------------------------------
21 * Neither the United States nor the United States Department of Energy,
22 * nor any of their employees, makes any warranty, express or implied, or
23 * assumes any legal liability or responsibility for the accuracy,
24 * completeness, or usefulness of any data, apparatus, product, or process
25 * disclosed, or represents that its use would not infringe privately owned
26 * rights.
27 *
28 * Stanford disclaimer of liability
29 * --------------------------------
30 * Stanford University makes no representations or warranties, express or
31 * implied, nor assumes any liability for the use of this software.
32 *
33 * Stanford disclaimer of copyright
34 * --------------------------------
35 * Stanford University, owner of the copyright, hereby disclaims its
36 * copyright and all other rights in this software.  Hence, anyone may
37 * freely use it for any purpose without restriction. 
38 *
39 * Maintenance of notices
40 * ----------------------
41 * In the interest of clarity regarding the origin and status of this
42 * SLAC software, this and all the preceding Stanford University notices
43 * are to remain affixed to any copy or derivative of this software made
44 * or distributed by the recipient and are to be affixed to any copy of
45 * software made or distributed by the recipient that contains a copy or
46 * derivative of this software.
47 *
48 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
49 */ 
50
51#include <rtems.h>
52#include <libchip/rtc.h>
53#include <stdint.h>
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
59extern rtc_fns rtc_ds1375_fns;
60
61boolean
62rtc_ds1375_device_probe( int minor );
63
64uint32_t
65rtc_ds1375_get_register( uint32_t port, uint8_t reg );
66
67void
68rtc_ds1375_set_register( uint32_t port, uint8_t reg, uint32_t value );
69
70/*
71 * BSP must supply string constant argument 'i2cname' which matches
72 * the registered device name of the raw i2c device (created with mknod).
73 * E.g., "/dev/i2c.ds1375-raw"
74 *
75 * NOTE: The i2c bus driver must already be up and 'i2cname' already
76 *       be available when this ENTRY is registered or initialized.
77 *
78 *       If you want to allow applications to add the RTC driver to
79 *       the configuration table then the i2c subsystem must be
80 *       initialized by the BSP from the predriver_hook.
81 */
82#define DS1375_RTC_TBL_ENTRY(i2cname) \
83{                                                     \
84        sDeviceName:    "/dev/rtc",                       \
85        deviceType:             RTC_CUSTOM,                       \
86        pDeviceFns:             &rtc_ds1375_fns,                  \
87        deviceProbe:    rtc_ds1375_device_probe,          \
88        ulCtrlPort1:    (uint32_t)(i2cname),              \
89        ulDataPort:             0,                                \
90        getRegister:    rtc_ds1375_get_register,          \
91        setRegister:    rtc_ds1375_set_register,          \
92}
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif
Note: See TracBrowser for help on using the repository browser.