-
Notifications
You must be signed in to change notification settings - Fork 0
/
port.cpp
100 lines (64 loc) · 944 Bytes
/
port.cpp
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
#include "port.h"
Port::Port(uint16_t portnumber)
{
this->portnumber = portnumber;
}
Port::~Port()
{
}
Port8::Port8(uint16_t portnumber)
: Port(portnumber)
{
}
Port8::~Port8()
{
}
void Port8::write(uint8_t data)
{
write8(portnumber, data);
}
uint8_t Port8::read()
{
return read8(portnumber);
}
Port8Slow::Port8Slow(uint16_t portnumber)
: Port8(portnumber)
{
}
Port8Slow::~Port8Slow()
{
}
void Port8Slow::write(uint8_t data)
{
write8Slow(portnumber, data);
}
Port16::Port16(uint16_t portnumber)
: Port(portnumber)
{
}
Port16::~Port16()
{
}
void Port16::write(uint16_t data)
{
write16(portnumber, data);
}
uint16_t Port16::read()
{
return read16(portnumber);
}
Port32::Port32(uint16_t portnumber)
: Port(portnumber)
{
}
Port32::~Port32()
{
}
void Port32::write(uint32_t data)
{
write32(portnumber, data);
}
uint32_t Port32::read()
{
return read32(portnumber);
}