-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathmpc.hpp
281 lines (237 loc) · 9.48 KB
/
mpc.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
#pragma once
//=========================================================================//
/*! @file
@brief Multi-Function Pin Controller / マルチファンクションピンコントローラ (RX220)
@author 平松邦仁 ([email protected])
@copyright Copyright (C) 2022, 2024 Kunihito Hiramatsu @n
Released under the MIT license @n
https://github.com/hirakuni45/RX/blob/master/LICENSE
*/
//=========================================================================//
#include "common/io_utils.hpp"
namespace device {
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief MPC class
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct mpc_t {
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 書き込みプロテクトレジスタ (PWPR)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template <uint32_t base>
struct pwpr_t : public rw8_t<base> {
typedef rw8_t<base> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bit_rw_t<io_, bitpos::B6> PFSWE;
bit_rw_t<io_, bitpos::B7> B0WI;
};
static inline pwpr_t<0x0008'C11F> PWPR;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 端子機能制御規定クラス ASEL, ISEL, PSEL
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template <uint32_t base>
struct pfs_aip_t : public rw8_t<base> {
typedef rw8_t<base> io;
using io::operator =;
using io::operator ();
using io::operator |=;
using io::operator &=;
bits_rw_t<io, bitpos::B0, 4> PSEL;
bit_rw_t< io, bitpos::B6> ISEL;
bit_rw_t< io, bitpos::B7> ASEL;
};
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 端子機能制御規定クラス ISEL, PSEL
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template <uint32_t base>
struct pfs_ip_t : public rw8_t<base> {
typedef rw8_t<base> io;
using io::operator =;
using io::operator ();
using io::operator |=;
using io::operator &=;
bits_rw_t<io, bitpos::B0, 4> PSEL;
bit_rw_t< io, bitpos::B6> ISEL;
};
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 端子機能制御規定クラス PSEL
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template <uint32_t base>
struct pfs_p_t : public rw8_t<base> {
typedef rw8_t<base> io;
using io::operator =;
using io::operator ();
using io::operator |=;
using io::operator &=;
bits_rw_t<io, bitpos::B0, 4> PSEL;
};
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief 端子機能制御規定クラス ASEL
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template <uint32_t base>
struct pfs_a_t : public rw8_t<base> {
typedef rw8_t<base> io;
using io::operator =;
using io::operator ();
using io::operator |=;
using io::operator &=;
bit_rw_t<io, bitpos::B7> ASEL;
};
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief P0n 端子機能制御レジスタ(P07PFS)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_p_t<0x0008'C147> P07PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief P1n 端子機能制御レジスタ(P1nPFS)(n = 2 ~ 7)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_ip_t<0x0008'C14A> P12PFS;
static inline pfs_ip_t<0x0008'C14B> P13PFS;
static inline pfs_ip_t<0x0008'C14C> P14PFS;
static inline pfs_ip_t<0x0008'C14D> P15PFS;
static inline pfs_ip_t<0x0008'C14E> P16PFS;
static inline pfs_ip_t<0x0008'C14F> P17PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief P2n 端子機能制御レジスタ(P2nPFS)(n = 0 ~ 7)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_p_t<0x0008'C150> P20PFS;
static inline pfs_p_t<0x0008'C151> P21PFS;
static inline pfs_p_t<0x0008'C152> P22PFS;
static inline pfs_p_t<0x0008'C153> P23PFS;
static inline pfs_p_t<0x0008'C154> P24PFS;
static inline pfs_p_t<0x0008'C155> P25PFS;
static inline pfs_p_t<0x0008'C156> P26PFS;
static inline pfs_p_t<0x0008'C157> P27PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief P3n 端子機能制御レジスタ(P3nPFS)(n = 0 ~ 4)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_ip_t<0x0008'C158> P30PFS;
static inline pfs_ip_t<0x0008'C159> P31PFS;
static inline pfs_ip_t<0x0008'C15A> P32PFS;
static inline pfs_ip_t<0x0008'C15B> P33PFS;
static inline pfs_ip_t<0x0008'C15C> P34PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief P4n 端子機能制御レジスタ(P4nPFS)(n = 0 ~ 7)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_a_t<0x0008'C160> P40PFS;
static inline pfs_a_t<0x0008'C161> P41PFS;
static inline pfs_a_t<0x0008'C162> P42PFS;
static inline pfs_a_t<0x0008'C163> P43PFS;
static inline pfs_a_t<0x0008'C164> P44PFS;
static inline pfs_a_t<0x0008'C165> P45PFS;
static inline pfs_a_t<0x0008'C166> P46PFS;
static inline pfs_a_t<0x0008'C167> P47PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief P5n 端子機能制御レジスタ(P5nPFS)(n = 4, 5)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_p_t<0x0008'C16C> P54PFS;
static inline pfs_p_t<0x0008'C16D> P55PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief PAn 端子機能制御レジスタ(PAnPFS)(n = 0 ~ 7)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_aip_t<0x0008'C190> PA0PFS;
static inline pfs_aip_t<0x0008'C191> PA1PFS;
static inline pfs_aip_t<0x0008'C192> PA2PFS;
static inline pfs_aip_t<0x0008'C193> PA3PFS;
static inline pfs_aip_t<0x0008'C194> PA4PFS;
static inline pfs_aip_t<0x0008'C195> PA5PFS;
static inline pfs_aip_t<0x0008'C196> PA6PFS;
static inline pfs_aip_t<0x0008'C197> PA7PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief PBn 端子機能制御レジスタ(PBnPFS)(n = 0 ~ 7)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_ip_t<0x0008'C198> PB0PFS;
static inline pfs_ip_t<0x0008'C199> PB1PFS;
static inline pfs_ip_t<0x0008'C19A> PB2PFS;
static inline pfs_ip_t<0x0008'C19B> PB3PFS;
static inline pfs_ip_t<0x0008'C19C> PB4PFS;
static inline pfs_ip_t<0x0008'C19D> PB5PFS;
static inline pfs_ip_t<0x0008'C19E> PB6PFS;
static inline pfs_ip_t<0x0008'C19F> PB7PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief PCn 端子機能制御レジスタ(PCnPFS)(n = 0 ~ 7)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_p_t<0x0008'C1A0> PC0PFS;
static inline pfs_p_t<0x0008'C1A1> PC1PFS;
static inline pfs_p_t<0x0008'C1A2> PC2PFS;
static inline pfs_p_t<0x0008'C1A3> PC3PFS;
static inline pfs_p_t<0x0008'C1A4> PC4PFS;
static inline pfs_p_t<0x0008'C1A5> PC5PFS;
static inline pfs_p_t<0x0008'C1A6> PC6PFS;
static inline pfs_p_t<0x0008'C1A7> PC7PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief PDn 端子機能制御レジスタ(PDnPFS)(n = 0 ~ 7)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_ip_t<0x0008'C1A8> PD0PFS;
static inline pfs_ip_t<0x0008'C1A9> PD1PFS;
static inline pfs_ip_t<0x0008'C1AA> PD2PFS;
static inline pfs_ip_t<0x0008'C1AB> PD3PFS;
static inline pfs_ip_t<0x0008'C1AC> PD4PFS;
static inline pfs_ip_t<0x0008'C1AD> PD5PFS;
static inline pfs_ip_t<0x0008'C1AE> PD6PFS;
static inline pfs_ip_t<0x0008'C1AF> PD7PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief PEn 端子機能制御レジスタ(PEnPFS)(n = 0 ~ 7)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_aip_t<0x0008'C1B0> PE0PFS;
static inline pfs_aip_t<0x0008'C1B1> PE1PFS;
static inline pfs_aip_t<0x0008'C1B2> PE2PFS;
static inline pfs_aip_t<0x0008'C1B3> PE3PFS;
static inline pfs_aip_t<0x0008'C1B4> PE4PFS;
static inline pfs_aip_t<0x0008'C1B5> PE5PFS;
static inline pfs_aip_t<0x0008'C1B6> PE6PFS;
static inline pfs_aip_t<0x0008'C1B7> PE7PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief PHn 端子機能制御レジスタ(PHnPFS)(n = 0 ~ 3)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_ip_t<0x0008'C1C8> PH0PFS;
static inline pfs_ip_t<0x0008'C1C9> PH1PFS;
static inline pfs_ip_t<0x0008'C1CA> PH2PFS;
static inline pfs_ip_t<0x0008'C1CB> PH3PFS;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief PJn 端子機能制御レジスタ(PJnPFS)(n = 1, 3)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
static inline pfs_p_t<0x0008'C1D1> PJ1PFS;
static inline pfs_p_t<0x0008'C1D3> PJ3PFS;
};
typedef mpc_t MPC;
}