OOStuBS - Technische Informatik II (TI-II)  2.4
keyctrl.h
gehe zur Dokumentation dieser Datei
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2  * Technische Informatik II *
3  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4  * *
5  * K E Y B O A R D _ C O N T R O L L E R *
6  * *
7 \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8 
9 #ifndef __Keyboard_Controller_include__
10 #define __Keyboard_Controller_include__
11 
12 #include "machine/io_port.h"
13 #include "machine/key.h"
14 
33  private:
34 
39  unsigned char code;
40 
45  unsigned char prefix;
46 
52 
57  char leds;
58 
72 
85 
86 
91  enum StatusMasks{
92  outb = 0x01,
94  inpb = 0x02,
96  auxb = 0x20
98  };
99 
101  enum Commands{
102  cmd_set_led = 0xed,
103  cmd_set_speed = 0xf3,
105  };
106 
108  enum Responses{
109  ack = 0xfa
110  };
111 
113  enum Decodes{
114  break_bit = 0x80,
115  prefix1 = 0xe0,
116  prefix2 = 0xe1
117  };
118 
119  public:
120 
122  enum Leds{
123  caps_lock = 4,
124  num_lock = 2,
126  };
127 
128  private:
130  static unsigned char normal_tab[];
131 
133  static unsigned char shift_tab[];
134 
136  static unsigned char alt_tab[];
137 
139  static unsigned char asc_num_tab[];
140 
142  static unsigned char scan_num_tab[];
143 
152  bool key_decoded ();
153 
159  void get_ascii_code ();
160 
161  public:
162 
167 
178  Key key_hit ();
179 
184  void reboot ();
185 
191  void set_repeat_rate (unsigned char speed, unsigned char delay);
192 
198  void set_led (Leds led, bool on);
199 };
200 
201 #endif