openMSX
Main Page
Namespaces
Classes
Files
File List
File Members
serial
I8254.hh
Go to the documentation of this file.
1
// This class implements the Intel 8254 chip (and 8253)
2
//
3
// * Only the 8254 is emulated, no surrounding hardware.
4
// Use the class I8254Interface to do that.
5
6
#ifndef I8254_HH
7
#define I8254_HH
8
9
#include "
EmuTime.hh
"
10
#include "
openmsx.hh
"
11
#include "
noncopyable.hh
"
12
#include <memory>
13
14
namespace
openmsx {
15
16
class
Scheduler
;
17
class
Counter;
18
class
ClockPin
;
19
class
ClockPinListener;
20
21
class
I8254
:
private
noncopyable
22
{
23
public
:
24
I8254
(
Scheduler
& scheduler,
ClockPinListener
* output0,
25
ClockPinListener
* output1,
ClockPinListener
* output2,
26
EmuTime::param
time);
27
~I8254
();
28
29
void
reset
(
EmuTime::param
time);
30
byte
readIO
(
word
port,
EmuTime::param
time);
31
byte
peekIO
(
word
port,
EmuTime::param
time)
const
;
32
void
writeIO
(
word
port,
byte
value,
EmuTime::param
time);
33
34
void
setGate
(
unsigned
counter,
bool
status,
EmuTime::param
time);
35
ClockPin
&
getClockPin
(
unsigned
cntr);
36
ClockPin
&
getOutputPin
(
unsigned
cntr);
37
38
template
<
typename
Archive>
39
void
serialize
(Archive& ar,
unsigned
version);
40
41
private
:
42
void
readBackHelper(
byte
value,
unsigned
cntr,
EmuTime::param
time);
43
44
std::unique_ptr<Counter> counter[3];
45
};
46
47
}
// namespace openmsx
48
49
#endif
Generated on Mon May 20 2013 12:16:58 for openMSX by
1.8.1.2