-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathhrpwm.hpp
181 lines (158 loc) · 5.69 KB
/
hrpwm.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
#pragma once
//=========================================================================//
/*! @file
@brief High Resolution PWM Waveform Generation Circuit / 高分解能 PWM 波形生成回路 @n
RX26T @n
RX66T/RX72T
@author 平松邦仁 (hira@rvf-rc45.net)
@copyright Copyright (C) 2019, 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 HRPWM class
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct hrpwm_t {
static constexpr auto PERIPHERAL = peripheral::HRPWM; ///< ペリフェラル型
//=================================================================//
/*!
@brief HRPWM 動作制御レジスタ (HROCR)
@param[in] base ベースアドレス
*/
//=================================================================//
template <uint32_t base>
struct hrocr_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::B0> DLLEN;
bit_rw_t<io_, bitpos::B1> HRRST;
};
static inline hrocr_t<0x000C'2A00> HROCR;
//=================================================================//
/*!
@brief HRPWM 動作制御レジスタ 2 (HROCR2)
@param[in] base ベースアドレス
*/
//=================================================================//
template <uint32_t base>
struct hrocr2_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::B0> HRSEL0;
bit_rw_t<io_, bitpos::B1> HRSEL1;
bit_rw_t<io_, bitpos::B2> HRSEL2;
bit_rw_t<io_, bitpos::B3> HRSEL3;
bit_rw_t<io_, bitpos::B8> HRDIS0;
bit_rw_t<io_, bitpos::B9> HRDIS1;
bit_rw_t<io_, bitpos::B10> HRDIS2;
bit_rw_t<io_, bitpos::B11> HRDIS3;
};
static inline hrocr2_t<0x000C'2A02> HROCR2;
//=================================================================//
/*!
@brief GTIOCnA 端子立ち上がりエッジ調整レジスタ (HRREARnA) (n = 0 ~ 3)
@param[in] base ベースアドレス
*/
//=================================================================//
template <uint32_t base>
struct hrrearna_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, 4> DLY;
};
static inline hrrearna_t<0x000C'2A18> HRREAR0A;
static inline hrrearna_t<0x000C'2A1C> HRREAR1A;
static inline hrrearna_t<0x000C'2A20> HRREAR2A;
static inline hrrearna_t<0x000C'2A24> HRREAR3A;
//=================================================================//
/*!
@brief GTIOCnA 端子立ち下がりエッジ調整レジスタ (HRFEARnA) (n = 0 ~ 3)
@param[in] base ベースアドレス
*/
//=================================================================//
template <uint32_t base>
struct hrfearna_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, 4> DLY;
};
static inline hrfearna_t<0x000C'2A28> HRFEAR0A;
static inline hrfearna_t<0x000C'2A2C> HRFEAR1A;
static inline hrfearna_t<0x000C'2A30> HRFEAR2A;
static inline hrfearna_t<0x000C'2A34> HRFEAR3A;
//=================================================================//
/*!
@brief GTIOCnB 端子立ち上がりエッジ調整レジスタ (HRREARnB) (n = 0 ~ 3)
@param[in] base ベースアドレス
*/
//=================================================================//
template <uint32_t base>
struct hrrearnb_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, 4> DLY;
};
static inline hrrearnb_t<0x000C'2A1A> HRREAR0B;
static inline hrrearnb_t<0x000C'2A1E> HRREAR1B;
static inline hrrearnb_t<0x000C'2A22> HRREAR2B;
static inline hrrearnb_t<0x000C'2A26> HRREAR3B;
//=================================================================//
/*!
@brief GTIOCnB 端子立ち下がりエッジ調整レジスタ (HRFEARnB) (n = 0 ~ 3)
@param[in] base ベースアドレス
*/
//=================================================================//
template <uint32_t base>
struct hrfearnb_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, 4> DLY;
};
static inline hrfearnb_t<0x000C'2A1A> HRFEAR0B;
static inline hrfearnb_t<0x000C'2A1E> HRFEAR1B;
static inline hrfearnb_t<0x000C'2A22> HRFEAR2B;
static inline hrfearnb_t<0x000C'2A26> HRFEAR3B;
#if defined(SIG_RX72T)
//=================================================================//
/*!
@brief HRPWM 動作クロック選択レジスタ (HRCKSR)
@param[in] base ベースアドレス
*/
//=================================================================//
template <uint32_t base>
struct hrcksr_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> HRCKSEL;
};
static inline hrcksr_t<0x000C'2A70> HRCKSR;
#endif
};
typedef hrpwm_t HRPWM;
}