OOStuBS - Technische Informatik II (TI-II)  2.4
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:
22  {
23  timestep = 838,
24  maxUS = 0xFFFFUL*timestep/1000
25  };
26 
27  enum Ports{
31  ctrl0Port=0x43,
35  ctrl1Port=0x4B
36  };
37 
39  {
42  };
43 
45  {
52  };
53 
54  enum RWTypes
55  {
60  };
61 
62  enum Counters
63  {
67  };
68 
70  {
71  struct
72  {
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