ReactOS 0.4.15-dev-7953-g1f49173
ps2.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/hardware/ps2.h
5 * PURPOSE: PS/2 controller emulation
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10#ifndef _PS2_H_
11#define _PS2_H_
12
13/* DEFINES ********************************************************************/
14
15/* I/O Ports */
16#define PS2_DATA_PORT 0x60
17#define PS2_CONTROL_PORT 0x64
18
19/* Controller Status Register flags */
20#define PS2_STAT_OUT_BUF_FULL (1 << 0)
21// #define PS2_STAT_IN_BUF_FULL (1 << 1)
22#define PS2_STAT_SYSTEM (1 << 2)
23#define PS2_STAT_COMMAND (1 << 3)
24#define PS2_STAT_KBD_ENABLE (1 << 4) // 0: Locked; 1: Not locked
25#define PS2_STAT_AUX_OUT_BUF_FULL (1 << 5)
26#define PS2_STAT_GEN_TIMEOUT (1 << 6)
27#define PS2_STAT_PARITY_ERROR (1 << 7)
28
29/* Controller Configuration Byte flags */
30#define PS2_CONFIG_KBD_INT (1 << 0)
31#define PS2_CONFIG_AUX_INT (1 << 1)
32#define PS2_CONFIG_SYSTEM (1 << 2)
33#define PS2_CONFIG_NO_KEYLOCK (1 << 3)
34#define PS2_CONFIG_KBD_DISABLE (1 << 4)
35#define PS2_CONFIG_AUX_DISABLE (1 << 5)
36// #define PS2_CONFIG_KBD_XLAT (1 << 6)
37
38/* Output Port flags */
39#define PS2_OUT_CPU_NO_RESET (1 << 0)
40#define PS2_OUT_A20_SET (1 << 1)
41#define PS2_OUT_AUX_DATA (1 << 2)
42// #define PS2_OUT_AUX_CLOCK (1 << 3)
43#define PS2_OUT_IRQ01 (1 << 4)
44#define PS2_OUT_IRQ12 (1 << 5)
45// #define PS2_OUT_KBD_CLOCK (1 << 6)
46#define PS2_OUT_KBD_DATA (1 << 7)
47
49
50/* FUNCTIONS ******************************************************************/
51
52VOID PS2SetDeviceCmdProc(BYTE PS2Port, LPVOID Param, PS2_DEVICE_CMDPROC DeviceCommand);
53
56
59
60#endif /* _PS2_H_ */
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
VOID PS2SetDeviceCmdProc(BYTE PS2Port, LPVOID Param, PS2_DEVICE_CMDPROC DeviceCommand)
Definition: ps2.c:478
BOOLEAN PS2PortQueueRead(BYTE PS2Port)
Definition: ps2.c:415
BOOLEAN PS2QueuePush(BYTE PS2Port, BYTE Data)
Definition: ps2.c:486
VOID(WINAPI * PS2_DEVICE_CMDPROC)(LPVOID Param, BYTE Command)
Definition: ps2.h:48
BOOLEAN PS2Initialize(VOID)
Definition: ps2.c:520
VOID PS2Cleanup(VOID)
Definition: ps2.c:546
Definition: shell.h:41
#define WINAPI
Definition: msvc.h:6
unsigned char BYTE
Definition: xxhash.c:193