-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbus.hpp
119 lines (101 loc) · 3.58 KB
/
bus.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
#pragma once
//=============================================================================//
/*! @file
@brief 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 バス定義基底クラス
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct bus_t {
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief バスエラーステータスクリアレジスタ(BERCLR)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template<uint32_t base>
struct berclr_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> STSCLR;
};
static inline berclr_t<0x0008'1300> BERCLR;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief バスエラー監視許可レジスタ(BEREN)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template<uint32_t base>
struct beren_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> IGAEN;
};
static inline beren_t<0x0008'1304> BEREN;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief バスエラーステータスレジスタ 1(BERSR1)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template<uint32_t base>
struct bersr1_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> IA;
bits_rw_t<io_, bitpos::B4, 3> MST;
};
static inline bersr1_t<0x0008'1308> BERSR1;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief バスエラーステータスレジスタ 2(BERSR2)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template<uint32_t base>
struct bersr2_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::B3, 13> ADDR;
};
static inline bersr2_t<0x0008'130A> BERSR2;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief バスプライオリティ制御レジスタ(BUSPRI)
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template<uint32_t base>
struct buspri_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> BPRA;
bits_rw_t<io_, bitpos::B2, 2> BPRO;
bits_rw_t<io_, bitpos::B4, 2> BPIB;
bits_rw_t<io_, bitpos::B6, 2> BPGB;
bits_rw_t<io_, bitpos::B10, 2> BPFB;
};
static inline buspri_t<0x0008'1310> BUSPRI;
};
typedef bus_t BUS;
}