ReactOS 0.4.15-dev-7670-g69b08be
pit.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  _TIMER_CONTROL_PORT_REGISTER
 

Macros

#define TIMER_CHANNEL0_DATA_PORT   0x71
 
#define TIMER_CHANNEL1_DATA_PORT   0x73
 
#define TIMER_CHANNEL2_DATA_PORT   0x75
 
#define TIMER_CONTROL_PORT   0x77
 
#define TIMER_FREQUENCY_1   1996800 /* 8 MHz */
 
#define TIMER_FREQUENCY_2   2457600 /* 10 MHz, 5 MHz */
 

Typedefs

typedef enum _TIMER_OPERATING_MODES TIMER_OPERATING_MODES
 
typedef enum _TIMER_ACCESS_MODES TIMER_ACCESS_MODES
 
typedef enum _TIMER_CHANNELS TIMER_CHANNELS
 
typedef union _TIMER_CONTROL_PORT_REGISTER TIMER_CONTROL_PORT_REGISTER
 
typedef union _TIMER_CONTROL_PORT_REGISTERPTIMER_CONTROL_PORT_REGISTER
 

Enumerations

enum  _TIMER_OPERATING_MODES {
  PitOperatingMode0 , PitOperatingMode1 , PitOperatingMode2 , PitOperatingMode3 ,
  PitOperatingMode4 , PitOperatingMode5 , PitOperatingMode2Reserved , PitOperatingMode5Reserved ,
  PitOperatingMode0 , PitOperatingMode1 , PitOperatingMode2 , PitOperatingMode3 ,
  PitOperatingMode4 , PitOperatingMode5
}
 
enum  _TIMER_ACCESS_MODES {
  PitAccessModeCounterLatch , PitAccessModeLow , PitAccessModeHigh , PitAccessModeLowHigh ,
  PitAccessModeCounterLatch , PitAccessModeLow , PitAccessModeHigh , PitAccessModeLowHigh
}
 
enum  _TIMER_CHANNELS {
  PitChannel0 , PitChannel1 , PitChannel2 , PitReadBack ,
  PitChannel0 , PitChannel1 , PitChannel2 , MultipleLatch
}
 

Functions

FORCEINLINE ULONG Read8253Timer (TIMER_CHANNELS TimerChannel)
 
FORCEINLINE VOID Write8253Timer (TIMER_CONTROL_PORT_REGISTER TimerControl, USHORT Count)
 

Macro Definition Documentation

◆ TIMER_CHANNEL0_DATA_PORT

#define TIMER_CHANNEL0_DATA_PORT   0x71

Definition at line 10 of file pit.h.

◆ TIMER_CHANNEL1_DATA_PORT

#define TIMER_CHANNEL1_DATA_PORT   0x73

Definition at line 11 of file pit.h.

◆ TIMER_CHANNEL2_DATA_PORT

#define TIMER_CHANNEL2_DATA_PORT   0x75

Definition at line 12 of file pit.h.

◆ TIMER_CONTROL_PORT

#define TIMER_CONTROL_PORT   0x77

Definition at line 13 of file pit.h.

◆ TIMER_FREQUENCY_1

#define TIMER_FREQUENCY_1   1996800 /* 8 MHz */

Definition at line 16 of file pit.h.

◆ TIMER_FREQUENCY_2

#define TIMER_FREQUENCY_2   2457600 /* 10 MHz, 5 MHz */

Definition at line 17 of file pit.h.

Typedef Documentation

◆ PTIMER_CONTROL_PORT_REGISTER

◆ TIMER_ACCESS_MODES

◆ TIMER_CHANNELS

◆ TIMER_CONTROL_PORT_REGISTER

◆ TIMER_OPERATING_MODES

Enumeration Type Documentation

◆ _TIMER_ACCESS_MODES

Enumerator
PitAccessModeCounterLatch 
PitAccessModeLow 
PitAccessModeHigh 
PitAccessModeLowHigh 
PitAccessModeCounterLatch 
PitAccessModeLow 
PitAccessModeHigh 
PitAccessModeLowHigh 

Definition at line 40 of file pit.h.

41{
enum _TIMER_ACCESS_MODES TIMER_ACCESS_MODES
@ PitAccessModeLow
Definition: pit.h:43
@ PitAccessModeCounterLatch
Definition: pit.h:42
@ PitAccessModeHigh
Definition: pit.h:44
@ PitAccessModeLowHigh
Definition: pit.h:45

◆ _TIMER_CHANNELS

Enumerator
PitChannel0 
PitChannel1 
PitChannel2 
PitReadBack 
PitChannel0 
PitChannel1 
PitChannel2 
MultipleLatch 

Definition at line 48 of file pit.h.

49{
50 /* IRQ 0 */
52
53 /* PC Speaker */
55
56 /* RS-232 chipset */
58
59 /* Execute multiple latch command */
@ PitChannel0
Definition: pit.h:51
@ MultipleLatch
Definition: pit.h:60
@ PitChannel2
Definition: pit.h:57
@ PitChannel1
Definition: pit.h:54
enum _TIMER_CHANNELS TIMER_CHANNELS

◆ _TIMER_OPERATING_MODES

Enumerator
PitOperatingMode0 
PitOperatingMode1 
PitOperatingMode2 
PitOperatingMode3 
PitOperatingMode4 
PitOperatingMode5 
PitOperatingMode2Reserved 
PitOperatingMode5Reserved 
PitOperatingMode0 
PitOperatingMode1 
PitOperatingMode2 
PitOperatingMode3 
PitOperatingMode4 
PitOperatingMode5 

Definition at line 19 of file pit.h.

20{
21 /* Interrupt On Terminal Count */
23
24 /* Hardware Re-triggerable One-Shot */
26
27 /* Rate Generator */
29
30 /* Square Wave Generator */
32
33 /* Software Triggered Strobe */
35
36 /* Hardware Triggered Strobe */
enum _TIMER_OPERATING_MODES TIMER_OPERATING_MODES
@ PitOperatingMode3
Definition: pit.h:31
@ PitOperatingMode2
Definition: pit.h:28
@ PitOperatingMode5
Definition: pit.h:37
@ PitOperatingMode0
Definition: pit.h:22
@ PitOperatingMode4
Definition: pit.h:34
@ PitOperatingMode1
Definition: pit.h:25

Function Documentation

◆ Read8253Timer()

FORCEINLINE ULONG Read8253Timer ( TIMER_CHANNELS  TimerChannel)

Definition at line 77 of file pit.h.

78{
80
83 Count |= READ_PORT_UCHAR((PUCHAR)(TIMER_CHANNEL0_DATA_PORT + TimerChannel * 2)) << 8;
84
85 return Count;
86}
int Count
Definition: noreturn.cpp:7
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define TIMER_CONTROL_PORT
Definition: pit.h:13
#define TIMER_CHANNEL0_DATA_PORT
Definition: pit.h:10
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59

Referenced by HalpCalibrateStallExecution(), and WaitFor8253Wraparound().

◆ Write8253Timer()

FORCEINLINE VOID Write8253Timer ( TIMER_CONTROL_PORT_REGISTER  TimerControl,
USHORT  Count 
)

Definition at line 90 of file pit.h.

93{
95 WRITE_PORT_UCHAR((PUCHAR)(TIMER_CHANNEL0_DATA_PORT + TimerControl.Channel * 2), Count & 0xFF);
96 WRITE_PORT_UCHAR((PUCHAR)(TIMER_CHANNEL0_DATA_PORT + TimerControl.Channel * 2), (Count >> 8) & 0xFF);
97}

Referenced by CpSetBaud(), and HalpCalibrateStallExecution().