ReactOS  0.4.15-dev-1374-g8d3e80e
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.

◆ _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 */
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

Function Documentation

◆ Read8253Timer()

FORCEINLINE ULONG Read8253Timer ( TIMER_CHANNELS  TimerChannel)

Definition at line 77 of file pit.h.

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

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 }
unsigned char * PUCHAR
Definition: retypes.h:3
#define TIMER_CHANNEL0_DATA_PORT
Definition: pit.h:10
int Count
Definition: noreturn.cpp:7
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define TIMER_CONTROL_PORT
Definition: pit.h:13

Referenced by CpSetBaud(), and HalpCalibrateStallExecution().