Sync with trunk for console graphics palettes.
[reactos.git] / subsystems / ntvdm / timer.h
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: timer.h
5 * PURPOSE: Programmable Interval Timer emulation (header file)
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9 #ifndef _TIMER_H_
10 #define _TIMER_H_
11
12 /* INCLUDES *******************************************************************/
13
14 #include "ntvdm.h"
15
16 /* DEFINES ********************************************************************/
17
18 #define PIT_CHANNELS 3
19 #define PIT_BASE_FREQUENCY 1193182LL
20 #define PIT_DATA_PORT(x) (0x40 + (x))
21 #define PIT_COMMAND_PORT 0x43
22
23 enum
24 {
25 PIT_MODE_INT_ON_TERMINAL_COUNT,
26 PIT_MODE_HARDWARE_ONE_SHOT,
27 PIT_MODE_RATE_GENERATOR,
28 PIT_MODE_SQUARE_WAVE,
29 PIT_MODE_SOFTWARE_STROBE,
30 PIT_MODE_HARDWARE_STROBE
31 };
32
33 typedef struct _PIT_CHANNEL
34 {
35 WORD ReloadValue;
36 WORD CurrentValue;
37 WORD LatchedValue;
38 INT Mode;
39 BOOLEAN Pulsed;
40 BOOLEAN LatchSet;
41 BOOLEAN InputFlipFlop;
42 BOOLEAN OutputFlipFlop;
43 BYTE AccessMode;
44 } PIT_CHANNEL, *PPIT_CHANNEL;
45
46 /* FUNCTIONS ******************************************************************/
47
48 VOID PitWriteCommand(BYTE Value);
49 BYTE PitReadData(BYTE Channel);
50 VOID PitWriteData(BYTE Channel, BYTE Value);
51 VOID PitDecrementCount();
52
53 #endif // _TIMER_H_
54
55 /* EOF */