RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
include
libchip
icm7170.h
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
3
/*
4
* This file contains the definitions for the following real-time clocks:
5
*
6
* + Harris Semiconduction ICM7170
7
*
8
* COPYRIGHT (c) 1989-1999.
9
* On-Line Applications Research Corporation (OAR).
10
*
11
* Redistribution and use in source and binary forms, with or without
12
* modification, are permitted provided that the following conditions
13
* are met:
14
* 1. Redistributions of source code must retain the above copyright
15
* notice, this list of conditions and the following disclaimer.
16
* 2. Redistributions in binary form must reproduce the above copyright
17
* notice, this list of conditions and the following disclaimer in the
18
* documentation and/or other materials provided with the distribution.
19
*
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
* POSSIBILITY OF SUCH DAMAGE.
31
*/
32
33
#ifndef __LIBCHIP_ICM7170_h
34
#define __LIBCHIP_ICM7170_h
35
36
/*
37
* Register indices
38
*/
39
40
#define ICM7170_CONTROL 0x11
41
42
43
#define ICM7170_COUNTER_HUNDREDTHS 0x00
44
#define ICM7170_HOUR 0x01
45
#define ICM7170_MINUTE 0x02
46
#define ICM7170_SECOND 0x03
47
#define ICM7170_MONTH 0x04
48
#define ICM7170_DATE 0x05
49
#define ICM7170_YEAR 0x06
50
#define ICM7170_DAY_OF_WEEK 0x07
51
52
/*
53
* Configuration information in the parameters field
54
*/
55
56
#define ICM7170_AT_32_KHZ 0x00
57
#define ICM7170_AT_1_MHZ 0x01
58
#define ICM7170_AT_2_MHZ 0x02
59
#define ICM7170_AT_4_MHZ 0x03
60
61
/*
62
* Driver function table
63
*/
64
65
extern
rtc_fns icm7170_fns;
66
67
/*
68
* Default register access routines
69
*/
70
71
uint32_t icm7170_get_register(
/* registers are at 1 byte boundaries */
72
uintptr_t ulCtrlPort,
/* and accessed as bytes */
73
uint8_t ucRegNum
74
);
75
76
void
icm7170_set_register(
77
uintptr_t ulCtrlPort,
78
uint8_t ucRegNum,
79
uint32_t ucData
80
);
81
82
uint32_t icm7170_get_register_2(
/* registers are at 2 byte boundaries */
83
uintptr_t ulCtrlPort,
/* and accessed as bytes */
84
uint8_t ucRegNum
85
);
86
87
void
icm7170_set_register_2(
88
uintptr_t ulCtrlPort,
89
uint8_t ucRegNum,
90
uint32_t ucData
91
);
92
93
uint32_t icm7170_get_register_4(
/* registers are at 4 byte boundaries */
94
uintptr_t ulCtrlPort,
/* and accessed as bytes */
95
uint8_t ucRegNum
96
);
97
98
void
icm7170_set_register_4(
99
uintptr_t ulCtrlPort,
100
uint8_t ucRegNum,
101
uint32_t ucData
102
);
103
104
uint32_t icm7170_get_register_8(
/* registers are at 8 byte boundaries */
105
uintptr_t ulCtrlPort,
/* and accessed as bytes */
106
uint8_t ucRegNum
107
);
108
109
void
icm7170_set_register_8(
110
uintptr_t ulCtrlPort,
111
uint8_t ucRegNum,
112
uint32_t ucData
113
);
114
115
#endif
116
/* end of include file */
Generated by
1.18.0