1 | /* |
---|
2 | * This file contains the definitions for the following real-time clocks: |
---|
3 | * |
---|
4 | * + Harris Semiconduction ICM7170 |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-1998. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * Copyright assigned to U.S. Government, 1994. |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.OARcorp.com/rtems/license.html. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef __LIBCHIP_ICM7170_h |
---|
18 | #define __LIBCHIP_ICM7170_h |
---|
19 | |
---|
20 | /* |
---|
21 | * Register indices |
---|
22 | */ |
---|
23 | |
---|
24 | #define ICM7170_CONTROL 0x11 |
---|
25 | |
---|
26 | |
---|
27 | #define ICM7170_COUNTER_HUNDREDTHS 0x00 |
---|
28 | #define ICM7170_HOUR 0x01 |
---|
29 | #define ICM7170_MINUTE 0x02 |
---|
30 | #define ICM7170_SECOND 0x03 |
---|
31 | #define ICM7170_MONTH 0x04 |
---|
32 | #define ICM7170_DATE 0x05 |
---|
33 | #define ICM7170_YEAR 0x06 |
---|
34 | #define ICM7170_DAY_OF_WEEK 0x07 |
---|
35 | |
---|
36 | /* |
---|
37 | * Configuration information in the parameters field |
---|
38 | */ |
---|
39 | |
---|
40 | #define ICM7170_AT_32_KHZ 0x00 |
---|
41 | #define ICM7170_AT_1_MHZ 0x01 |
---|
42 | #define ICM7170_AT_2_MHZ 0x02 |
---|
43 | #define ICM7170_AT_4_MHZ 0x03 |
---|
44 | |
---|
45 | /* |
---|
46 | * Driver function table |
---|
47 | */ |
---|
48 | |
---|
49 | extern rtc_fns icm7170_fns; |
---|
50 | |
---|
51 | /* |
---|
52 | * Default register access routines |
---|
53 | */ |
---|
54 | |
---|
55 | unsigned32 icm7170_get_register( /* registers are at 1 byte boundaries */ |
---|
56 | unsigned32 ulCtrlPort, /* and accessed as bytes */ |
---|
57 | unsigned8 ucRegNum |
---|
58 | ); |
---|
59 | |
---|
60 | void icm7170_set_register( |
---|
61 | unsigned32 ulCtrlPort, |
---|
62 | unsigned8 ucRegNum, |
---|
63 | unsigned32 ucData |
---|
64 | ); |
---|
65 | |
---|
66 | unsigned32 icm7170_get_register_2( /* registers are at 2 byte boundaries */ |
---|
67 | unsigned32 ulCtrlPort, /* and accessed as bytes */ |
---|
68 | unsigned8 ucRegNum |
---|
69 | ); |
---|
70 | |
---|
71 | void icm7170_set_register_2( |
---|
72 | unsigned32 ulCtrlPort, |
---|
73 | unsigned8 ucRegNum, |
---|
74 | unsigned32 ucData |
---|
75 | ); |
---|
76 | |
---|
77 | unsigned32 icm7170_get_register_4( /* registers are at 4 byte boundaries */ |
---|
78 | unsigned32 ulCtrlPort, /* and accessed as bytes */ |
---|
79 | unsigned8 ucRegNum |
---|
80 | ); |
---|
81 | |
---|
82 | void icm7170_set_register_4( |
---|
83 | unsigned32 ulCtrlPort, |
---|
84 | unsigned8 ucRegNum, |
---|
85 | unsigned32 ucData |
---|
86 | ); |
---|
87 | |
---|
88 | unsigned32 icm7170_get_register_8( /* registers are at 8 byte boundaries */ |
---|
89 | unsigned32 ulCtrlPort, /* and accessed as bytes */ |
---|
90 | unsigned8 ucRegNum |
---|
91 | ); |
---|
92 | |
---|
93 | void icm7170_set_register_8( |
---|
94 | unsigned32 ulCtrlPort, |
---|
95 | unsigned8 ucRegNum, |
---|
96 | unsigned32 ucData |
---|
97 | ); |
---|
98 | |
---|
99 | #endif |
---|
100 | /* end of include file */ |
---|