-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathclock.hpp
186 lines (155 loc) · 5.34 KB
/
clock.hpp
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#pragma once
//=====================================================================//
/*! @file
@brief R8C/M110AN, R8C/M120AN グループ・クロック・レジスター定義
@author 平松邦仁 ([email protected])
@copyright Copyright (C) 2014, 2017 Kunihito Hiramatsu @n
Released under the MIT license @n
https://github.com/hirakuni45/R8C/blob/master/LICENSE
*/
//=====================================================================//
#include "common/io_utils.hpp"
namespace device {
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 外部クロック制御レジスタ EXCKCR
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct exckcr_t : public rw8_t<0x0020> {
typedef rw8_t<0x0020> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bits_rw_t<io_, bitpos::B0, 2> CKPT;
bit_rw_t <io_, bitpos::B6> XRCUT;
};
static exckcr_t EXCKCR;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 高速/低速オンチップオシレータ制御レジスタ OCOCR
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct ococr_t : public rw8_t<0x0021> {
typedef rw8_t<0x0021> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bit_rw_t<io_, bitpos::B0> HOCOE;
bit_rw_t<io_, bitpos::B1> LOCODIS;
};
static ococr_t OCOCR;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief システムクロックf制御レジスタ SCKCR
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct sckcr_t : public rw8_t<0x0022> {
typedef rw8_t<0x0022> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bits_rw_t<io_, bitpos::B0, 3> PHISSEL;
bit_rw_t <io_, bitpos::B5> WAITM;
bit_rw_t <io_, bitpos::B6> HSCKSEL;
};
static sckcr_t SCKCR;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief システムクロックf選択レジスタ PHISEL
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct phisel_t : public rw8_t<0x0023> {
typedef rw8_t<0x0023> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bit_rw_t<io_, bitpos::B0> PHISEL0;
bit_rw_t<io_, bitpos::B1> PHISEL1;
bit_rw_t<io_, bitpos::B2> PHISEL2;
bit_rw_t<io_, bitpos::B3> PHISEL3;
bit_rw_t<io_, bitpos::B4> PHISEL4;
bit_rw_t<io_, bitpos::B5> PHISEL5;
bit_rw_t<io_, bitpos::B6> PHISEL6;
bit_rw_t<io_, bitpos::B7> PHISEL7;
};
static phisel_t PHISEL;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief クロック停止制御レジスタ CKSTPR
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct ckstpr_t : public rw8_t<0x0024> {
typedef rw8_t<0x0024> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bit_rw_t<io_, bitpos::B0> STPM;
bit_rw_t<io_, bitpos::B1> WCKSTP;
bit_rw_t<io_, bitpos::B2> PSCSTP;
bit_rw_t<io_, bitpos::B7> SCKSEL;
};
static ckstpr_t CKSTPR;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief モード復帰時クロック制御レジスタ CKRSCR
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct ckrscr_t : public rw8_t<0x0025> {
typedef rw8_t<0x0025> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bits_rw_t<io_, bitpos::B0, 4> CKST;
bit_rw_t <io_, bitpos::B5> PHISRS;
bit_rw_t <io_, bitpos::B6> WAITRS;
bit_rw_t <io_, bitpos::B7> STOPRS;
};
static ckrscr_t CKRSCR;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 発振停止検出レジスタ BAKCR
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct bakcr_t : public rw8_t<0x0026> {
typedef rw8_t<0x0026> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bit_rw_t<io_, bitpos::B0> XINBAKE;
bit_rw_t<io_, bitpos::B1> CKSWIE;
bit_rw_t<io_, bitpos::B2> XINHALT;
bit_rw_t<io_, bitpos::B3> CKSWIF;
};
static bakcr_t BAKCR;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 高速オンチップオシレータ18.432MHz制御レジスタ 0 FR18S0
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static rw8_t<0x0064> FR18S0;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 高速オンチップオシレータ18.432MHz制御レジスタ 1 FR18S1
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static rw8_t<0x0065> FR18S1;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 高速オンチップオシレータ制御レジスタ1 FRV1
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static rw8_t<0x0067> FRV1;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 高速オンチップオシレータ制御レジスタ2 FRV2
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static rw8_t<0x0068> FRV2;
}