-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathlvd.hpp
57 lines (49 loc) · 1.78 KB
/
lvd.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
#pragma once
//=========================================================================//
/*! @file
@brief RX621/RX62N LVD 定義
@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 電圧検出回路(LVD)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct lvd_t {
// リセットステータスレジスタ(RSTSR)
// system クラスで定義されている。
//-----------------------------------------------------------------//
/*!
@brief 低電圧検出コントロールレジスタ用キーコードレジスタ(LVDKEYR)
@param[in] base ベース・アドレス
*/
//-----------------------------------------------------------------//
static inline rw8_t<0x0008'C28C> LVDKEYR;
//-----------------------------------------------------------------//
/*!
@brief 低電圧検出コントロールレジスタ(LVDCR)
@param[in] base ベース・アドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct lvdcr_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::B2> LVD1RI;
bit_rw_t<io_, bitpos::B3> LVD1E;
bit_rw_t<io_, bitpos::B6> LVD2RI;
bit_rw_t<io_, bitpos::B7> LVD2E;
};
static inline lvdcr_t<0x0008'C28D> LVDCR;
};
typedef lvd_t LVD;
}