-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathlcdc.hpp
106 lines (92 loc) · 3.13 KB
/
lcdc.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
#pragma once
//=========================================================================//
/*! @file
@brief LCD Controller / Driver / LCD コントローラ / ドライバ
@author 平松邦仁 ([email protected])
@copyright Copyright (C) 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 LCDC class
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
struct lcdc_t {
//-----------------------------------------------------------------//
/*!
@brief LCD モードレジスタ 0(LCDM0)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct lcdm0_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, 2> LBAS;
bits_rw_t<io_, bitpos::B2, 3> LDTY;
bit_rw_t <io_, bitpos::B5> LWAVE;
bits_rw_t<io_, bitpos::B6, 2> MDSET;
};
static inline lcdm0_t<0x000A'0800> LCDM0;
//-----------------------------------------------------------------//
/*!
@brief LCD モードレジスタ 1(LCDM1)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct lcdm1_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> LCDVLM;
bit_rw_t <io_, bitpos::B3> LCDSEL;
bit_rw_t <io_, bitpos::B4> BLON;
bit_rw_t <io_, bitpos::B5> VLCON;
bit_rw_t <io_, bitpos::B6> SCOC;
bit_rw_t <io_, bitpos::B7> LCDON;
};
static inline lcdm1_t<0x000A'0801> LCDM1;
//-----------------------------------------------------------------//
/*!
@brief LCD クロック制御レジスタ 0(LCDC0)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct lcdc0_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, 6> LCDC0;
};
static inline lcdc0_t<0x000A'0802> LCDC0;
//-----------------------------------------------------------------//
/*!
@brief LCD 昇圧レベル制御レジスタ(VLCD)
@param[in] base ベースアドレス
*/
//-----------------------------------------------------------------//
template <uint32_t base>
struct vlcd_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, 5> VLCD;
};
static inline vlcd_t<0x000A'0803> VLCD;
};
}