-
Notifications
You must be signed in to change notification settings - Fork 0
/
port.h
49 lines (42 loc) · 924 Bytes
/
port.h
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
#ifndef __PORT_H
#define __PORT_H
#include "types.h"
class Port
{
protected:
uint16_t portnumber;
Port(uint16_t portnumber);
~Port();
};
class Port8Bit : public Port
{
public:
Port8Bit(uint16_t portnumber);
~Port8Bit();
virtual void Write(uint8_t data);
virtual uint8_t Read();
};
class Port8BitSlow : public Port8Bit
{
public:
Port8BitSlow(uint16_t portnumber);
~Port8BitSlow();
virtual void Write(uint8_t data);
};
class Port16Bit : public Port
{
public:
Port16Bit(uint16_t portnumber);
~Port16Bit();
void Write(uint16_t data);
uint16_t Read();
};
class Port32Bit : public Port
{
public:
Port32Bit(uint16_t portnumber);
~Port32Bit();
void Write(uint32_t data);
uint32_t Read();
};
#endif