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

4.104.115
Last change on this file since d0e2fa3 was 6640459d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/07/08 at 03:44:14

Convert to "bool".

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