OOStuBS - Technische Informatik II (TI-II)
2.4
Hauptseite
Zusätzliche Informationen
Klassen
Dateien
Auflistung der Dateien
Datei-Elemente
src
machine
pit.cc
gehe zur Dokumentation dieser Datei
1
/*---------------------------------------------------------------------------*
2
* Operating Systems I *
3
*---------------------------------------------------------------------------*
4
* *
5
* P I T *
6
* *
7
*---------------------------------------------------------------------------*/
8
9
#include "
machine/pit.h
"
10
11
PIT::PIT
(){
12
pcb
.
countType
=
binary
;
13
pcb
.
mode
=
rateGen
;
14
pcb
.
rwType
=
lowThenHigh
;
15
pcb
.
counter
=
counter0
;
16
}
17
18
PIT::~PIT
(){
19
20
}
21
22
void
PIT::interval
(
unsigned
short
us){
23
IO_Port
value(
counter0Port
);
24
IO_Port
ctrl(
ctrl0Port
);
25
if
(us>
maxUS
)
26
us=
maxUS
;
27
28
unsigned
long
temp = us * 1000;
29
temp/=
timestep
;
30
31
ctrl.
outb
(
pcb
.
ctrlByte
);
32
value.
outb
(temp&0xFF);
33
value.
outb
((temp>>8)&0xFF);
34
35
currIntervall
=us;
36
}
37
38
unsigned
short
PIT::interval
(){
39
return
currIntervall
;
40
}
Erzeugt am Mon Jun 30 2014 07:13:28 für OOStuBS - Technische Informatik II (TI-II) von
1.8.1.2