RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
include
libchip
m48t08.h
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
3
/*
4
* This file contains the definitions for the following real-time clocks:
5
*
6
* + Mostek M48T08
7
* + Mostek M48T18
8
* + Dallas Semiconductor DS1643
9
*
10
* COPYRIGHT (c) 1989-1999.
11
* On-Line Applications Research Corporation (OAR).
12
*
13
* Redistribution and use in source and binary forms, with or without
14
* modification, are permitted provided that the following conditions
15
* are met:
16
* 1. Redistributions of source code must retain the above copyright
17
* notice, this list of conditions and the following disclaimer.
18
* 2. Redistributions in binary form must reproduce the above copyright
19
* notice, this list of conditions and the following disclaimer in the
20
* documentation and/or other materials provided with the distribution.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
* POSSIBILITY OF SUCH DAMAGE.
33
*/
34
35
#ifndef __LIBCHIP_M48T08_h
36
#define __LIBCHIP_M48T08_h
37
38
/*
39
* Register indices
40
*/
41
42
#define M48T08_CONTROL 0
43
#define M48T08_SECOND 1
44
#define M48T08_MINUTE 2
45
#define M48T08_HOUR 3
46
#define M48T08_DAY_OF_WEEK 4
47
#define M48T08_DATE 5
48
#define M48T08_MONTH 6
49
#define M48T08_YEAR 7
50
51
/*
52
* Driver function table
53
*/
54
55
extern
rtc_fns m48t08_fns;
56
57
/*
58
* Default register access routines
59
*/
60
61
uint32_t m48t08_get_register(
/* registers are at 1 byte boundaries */
62
uintptr_t ulCtrlPort,
/* and accessed as bytes */
63
uint8_t ucRegNum
64
);
65
66
void
m48t08_set_register(
67
uintptr_t ulCtrlPort,
68
uint8_t ucRegNum,
69
uint32_t ucData
70
);
71
72
uint32_t m48t08_get_register_2(
/* registers are at 2 byte boundaries */
73
uintptr_t ulCtrlPort,
/* and accessed as bytes */
74
uint8_t ucRegNum
75
);
76
77
void
m48t08_set_register_2(
78
uintptr_t ulCtrlPort,
79
uint8_t ucRegNum,
80
uint32_t ucData
81
);
82
83
uint32_t m48t08_get_register_4(
/* registers are at 4 byte boundaries */
84
uintptr_t ulCtrlPort,
/* and accessed as bytes */
85
uint8_t ucRegNum
86
);
87
88
void
m48t08_set_register_4(
89
uintptr_t ulCtrlPort,
90
uint8_t ucRegNum,
91
uint32_t ucData
92
);
93
94
uint32_t m48t08_get_register_8(
/* registers are at 8 byte boundaries */
95
uintptr_t ulCtrlPort,
/* and accessed as bytes */
96
uint8_t ucRegNum
97
);
98
99
void
m48t08_set_register_8(
100
uintptr_t ulCtrlPort,
101
uint8_t ucRegNum,
102
uint32_t ucData
103
);
104
105
#endif
106
/* end of include file */
Generated by
1.18.0