hc
2024-03-26 e0728245c89800c2038c23308f2d88969d5b41c8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/** @file
 
  Copyright (c) 2018, Hisilicon Limited. All rights reserved.<BR>
  Copyright (c) 2018, Linaro Limited. All rights reserved.<BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
 
**/
 
#ifndef __M41T83_REAL_TIME_CLOCK_H__
#define __M41T83_REAL_TIME_CLOCK_H__
 
#define M41T83_REGADDR_DOTSECONDS       0x00
#define M41T83_REGADDR_SECONDS          0x01
#define M41T83_REGADDR_MINUTES          0x02
#define M41T83_REGADDR_HOURS            0x03
#define M41T83_REGADDR_WEEK_DAY         0x04
#define M41T83_REGADDR_DAY              0x05
#define M41T83_REGADDR_MONTH            0x06
#define M41T83_REGADDR_YEAR             0x07
#define M41T83_REGADDR_ALARM1SEC        0x0E
#define M41T83_REGADDR_ALARM1MIN        0x0D
#define M41T83_REGADDR_ALARM1HOUR       0x0C
#define M41T83_REGADDR_ALARM1DATE       0x0B
#define M41T83_REGADDR_ALARM1MONTH      0x0A
 
#define M41T83_REGADDR_TIMERCONTROL     0x11
 
#define M41T83_REGADDR_ALARM2SEC        0x18
#define M41T83_REGADDR_ALARM2MIN        0x17
#define M41T83_REGADDR_ALARM2HOUR       0x16
#define M41T83_REGADDR_ALARM2DATE       0x15
#define M41T83_REGADDR_ALARM2MONTH      0x14
 
typedef union {
  struct {
    UINT8 TD0:1;
    UINT8 TD1:1;
    UINT8 RSV:3;
    UINT8 TIE:1;
    UINT8 TITP:1;
    UINT8 TE:1;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_TIMERCONTROL;
 
typedef union {
  struct {
    UINT8 MicroSeconds;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_DOTSECOND;
 
typedef union {
  struct{
    UINT8 Seconds:7;
    UINT8 ST:1;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_SECOND;
 
typedef union {
  struct {
    UINT8 Minutes:7;
    UINT8 Rsv:1;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_MINUTE;
 
typedef union {
  struct {
    UINT8 Hours:6;
    UINT8 CB:2;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_HOUR;
 
typedef union {
  struct{
    UINT8 Days:3;
    UINT8 Rsv:5;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_WEEK_DAY;
 
typedef union {
  struct{
    UINT8 Days:6;
    UINT8 Rsv:2;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_MONTH_DAY;
 
typedef union {
  struct {
    UINT8 Months:5;
    UINT8 Rsv:3;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_MONTH;
 
typedef union {
  struct {
    UINT8 Years:8;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_YEAR;
 
typedef union {
  struct {
    UINT8 Second:7;
    UINT8 RPT11:1;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_ALARM1SEC;
 
typedef union {
  struct {
    UINT8 Minute:7;
    UINT8 RPT12:1;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_ALARM1MIN;
 
typedef union {
  struct {
    UINT8 Hour:6;
    UINT8 HT:1;
    UINT8 RPT13:1;
  } Bits;
  UINT8 Uint8;
} RTC_M41T83_ALARM1HOUR;
 
typedef struct {
  RTC_M41T83_DOTSECOND  DotSecond;
  RTC_M41T83_SECOND     Second;
  RTC_M41T83_MINUTE     Minute;
  RTC_M41T83_HOUR       Hour;
  RTC_M41T83_WEEK_DAY   WeekDay;
  RTC_M41T83_MONTH_DAY  Day;
  RTC_M41T83_MONTH      Month;
  RTC_M41T83_YEAR       Year;
} RTC_M41T83_TIME;
 
#endif