-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathpoe2.hpp
253 lines (216 loc) · 8.02 KB
/
poe2.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
#pragma once
//=========================================================================//
/*! @file
@brief RX621/RX62N ポートアウトプットイネーブル 2 定義
@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/device.hpp"
namespace device {
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief ポートアウトプットイネーブル 2 クラス
@param[in] per ペリフェラル型
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template <peripheral per>
struct poe2_t {
static constexpr auto PERIPHERAL = per; ///< ペリフェラル型
static constexpr auto OEI1_VEC = ICU::VECTOR::OEI1; ///< POE3F, POE2F, POE1F, POE0F, OSF1
static constexpr auto OEI2_VEC = ICU::VECTOR::OEI2; ///< POE8F
static constexpr auto OEI3_VEC = ICU::VECTOR::OEI3; ///< POE4F, POE5F, POE6F, POE7F, OSF2
static constexpr auto OEI4_VEC = ICU::VECTOR::OEI4; ///< POE9F
//-----------------------------------------------------------------//
/*!
@brief 入力レベルコントロール / ステータスレジスタ 1(ICSR1)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct icsr1_t : public rw16_t<base> {
typedef rw16_t<base> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bits_rw_t<io_, bitpos::B0, 2> POE0M;
bits_rw_t<io_, bitpos::B2, 2> POE1M;
bits_rw_t<io_, bitpos::B4, 2> POE2M;
bits_rw_t<io_, bitpos::B6, 2> POE3M;
bit_rw_t <io_, bitpos::B8> PIE1;
bit_rw_t <io_, bitpos::B12> POE0F;
bit_rw_t <io_, bitpos::B13> POE1F;
bit_rw_t <io_, bitpos::B14> POE2F;
bit_rw_t <io_, bitpos::B15> POE3F;
};
static inline icsr1_t<0x0008'8900> ICSR1;
//-----------------------------------------------------------------//
/*!
@brief 出力レベルコントロール / ステータスレジスタ 1(OCSR1)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct ocsr1_t : public rw16_t<base> {
typedef rw16_t<base> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bit_rw_t<io_, bitpos::B8> OIE1;
bit_rw_t<io_, bitpos::B9> OCE1;
bit_rw_t<io_, bitpos::B15> OSF1;
};
static inline ocsr1_t<0x0008'8902> OCSR1;
//-----------------------------------------------------------------//
/*!
@brief 入力レベルコントロール / ステータスレジスタ 2(ICSR2)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct icsr2_t : public rw16_t<base> {
typedef rw16_t<base> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bits_rw_t<io_, bitpos::B0, 2> POE4M;
bits_rw_t<io_, bitpos::B2, 2> POE5M;
bits_rw_t<io_, bitpos::B4, 2> POE6M;
bits_rw_t<io_, bitpos::B6, 2> POE7M;
bit_rw_t <io_, bitpos::B8> PIE2;
bit_rw_t <io_, bitpos::B12> POE4F;
bit_rw_t <io_, bitpos::B13> POE5F;
bit_rw_t <io_, bitpos::B14> POE6F;
bit_rw_t <io_, bitpos::B15> POE7F;
};
static inline icsr2_t<0x0008'8904> ICSR2;
//-----------------------------------------------------------------//
/*!
@brief 出力レベルコントロール / ステータスレジスタ 2(OCSR2)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct ocsr2_t : public rw16_t<base> {
typedef rw16_t<base> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bit_rw_t<io_, bitpos::B8> OIE2;
bit_rw_t<io_, bitpos::B9> OCE2;
bit_rw_t<io_, bitpos::B15> OSF2;
};
static inline ocsr2_t<0x0008'8906> OCSR2;
//-----------------------------------------------------------------//
/*!
@brief 入力レベルコントロール / ステータスレジスタ 3(ICSR3)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct icsr3_t : public rw16_t<base> {
typedef rw16_t<base> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bits_rw_t<io_, bitpos::B0, 2> POE8M;
bit_rw_t <io_, bitpos::B8> PIE3;
bit_rw_t <io_, bitpos::B9> POE8E;
bit_rw_t <io_, bitpos::B12> POE8F;
};
static inline icsr3_t<0x0008'8908> ICSR3;
//-----------------------------------------------------------------//
/*!
@brief 入力レベルコントロール / ステータスレジスタ 4(ICSR4)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct icsr4_t : public rw16_t<base> {
typedef rw16_t<base> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bits_rw_t<io_, bitpos::B0, 2> POE9M;
bit_rw_t <io_, bitpos::B8> PIE4;
bit_rw_t <io_, bitpos::B9> POE9E;
bit_rw_t <io_, bitpos::B12> POE9F;
};
static inline icsr4_t<0x0008'890E> ICSR4;
//-----------------------------------------------------------------//
/*!
@brief ソフトウェアポートアウトプットイネーブルレジスタ(SPOER)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct spoer_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::B0> CH34HIZ;
bit_rw_t<io_, bitpos::B1> CH0HIZ;
bit_rw_t<io_, bitpos::B2> CH910HIZ;
bit_rw_t<io_, bitpos::B3> CH6HIZ;
};
static inline spoer_t<0x0008'890A> SPOER;
//-----------------------------------------------------------------//
/*!
@brief ポートアウトプットイネーブルコントロールレジスタ 1(POECR1)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct poecr1_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::B0> PE0ZE;
bit_rw_t<io_, bitpos::B1> PE1ZE;
bit_rw_t<io_, bitpos::B2> PE2ZE;
bit_rw_t<io_, bitpos::B3> PE3ZE;
bit_rw_t<io_, bitpos::B4> PE4ZE;
bit_rw_t<io_, bitpos::B5> PE5ZE;
bit_rw_t<io_, bitpos::B6> PE6ZE;
bit_rw_t<io_, bitpos::B7> PE7ZE;
};
static inline poecr1_t<0x0008'890B> POECR1;
//-----------------------------------------------------------------//
/*!
@brief ポートアウトプットイネーブルコントロールレジスタ 2(POECR2)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct poecr2_t : public rw16_t<base> {
typedef rw16_t<base> io_;
using io_::operator =;
using io_::operator ();
using io_::operator |=;
using io_::operator &=;
bit_rw_t<io_, bitpos::B4> P6CZE;
bit_rw_t<io_, bitpos::B5> P5CZE;
bit_rw_t<io_, bitpos::B6> P4CZE;
bit_rw_t<io_, bitpos::B8> P3CZEB;
bit_rw_t<io_, bitpos::B9> P2CZEB;
bit_rw_t<io_, bitpos::B10> P1CZEB;
bit_rw_t<io_, bitpos::B12> P3CZEA;
bit_rw_t<io_, bitpos::B13> P2CZEA;
bit_rw_t<io_, bitpos::B14> P1CZEA;
};
static inline poecr2_t<0x0008'890C> POECR2;
};
typedef poe2_t<peripheral::POE2> POE2;
}