OOStuBS - Technische Informatik II (TI-II)
2.4
Hauptseite
Zusätzliche Informationen
Klassen
Dateien
Auflistung der Dateien
Datei-Elemente
include
machine
pit.h
gehe zur Dokumentation dieser Datei
1
/*---------------------------------------------------------------------------*
2
* Operating Systems I *
3
*---------------------------------------------------------------------------*
4
* *
5
* P I T *
6
* *
7
*---------------------------------------------------------------------------*/
8
9
#ifndef __pit_include__
10
#define __pit_include__
11
12
#include "stdint.h"
13
#include "
machine/io_port.h
"
14
19
class
PIT
{
20
private
:
21
enum
Parameters
22
{
23
timestep
= 838,
24
maxUS
= 0xFFFFUL*
timestep
/1000
25
};
26
27
enum
Ports
{
28
counter0Port
=0x40,
29
counter1Port
=0x41,
30
counter2Port
=0x42,
31
ctrl0Port
=0x43,
32
counter3Port
=0x48,
33
counter4Port
=0x49,
34
counter5Port
=0x4A,
35
ctrl1Port
=0x4B
36
};
37
38
enum
CountTypes
39
{
40
binary
,
41
bcd
42
};
43
44
enum
CountModes
45
{
46
intOnTerminal
,
47
hwOneShot
,
48
rateGen
,
49
squareWave
,
50
swStrobe
,
51
hwStrobe
52
};
53
54
enum
RWTypes
55
{
56
latch
,
57
lowOnly
,
58
highOnly
,
59
lowThenHigh
60
};
61
62
enum
Counters
63
{
64
counter0
,
65
counter1
,
66
counter2
67
};
68
69
union
PitControlByte
70
{
71
struct
72
{
73
CountTypes
countType
: 1;
74
CountModes
mode
: 3;
75
RWTypes
rwType
: 2;
76
Counters
counter
: 2;
77
};
78
uint8_t
ctrlByte
;
79
}
pcb
;
80
81
unsigned
short
currIntervall
;
82
83
public
:
87
PIT
();
88
92
virtual
~PIT
();
93
99
unsigned
short
interval
();
100
107
void
interval
(
unsigned
short
us);
108
};
109
110
#endif
Erzeugt am Mon Jun 30 2014 07:13:28 für OOStuBS - Technische Informatik II (TI-II) von
1.8.1.2