ApertureOS
priv_ps2.h
Go to the documentation of this file.
1 #ifndef _PRIV_PS2_H_
2 #define _PRIV_PS2_H_
3 
4 #include "types.h"
5 #include "ps2.h"
6 
7 #define CMD_PORT 0x64
8 #define DATA_PORT 0x60
9 
10 
11 #define DISABLE_PORT1_CMD 0xAD
12 #define ENABLE_PORT1_CMD 0xAE
13 #define DISABLE_PORT2_CMD 0xA7
14 #define ENABLE_PORT2_CMD 0xA8
15 #define READ_CFG_CMD 0x20
16 #define WRITE_CFG_CMD 0x60
17 #define PERFORM_SELFTEST 0xAA
18 #define PERFORM_PORT1TEST 0xAB
19 #define PERFORM_PORT2TEST 0xA9
20 
21 #define IS_CMD_SENT (!(PS2_ReadStatus() & 2))
22 #define IS_DATA_AVL (PS2_ReadStatus() & 1)
23 
24 #define WAIT_CMD_SENT while(!IS_CMD_SENT)
25 #define WAIT_DATA_AVL while(!IS_DATA_AVL)
26 #define WAIT_DATA_SENT while(IS_DATA_AVL)
27 
28 
29 #endif /* end of include guard: _PRIV_PS2_H_ */