78 constexpr uint8_t PIT_SETTING = CHANNEL::TIMER0 | ACCESSMODE::HI_LO | OPMODE::SQUAREWAVE_GENERATOR | DECIMALMODE::BINARY; 80 out8(PORT::COMMAND, PIT_SETTING); 82 constexpr uint16_t timer_reload = (BASE_FREQ / TICKS_PER_SECOND); 84 out8(PORT::CHANNEL_O, timer_reload & 0xFF); 85 out8(PORT::CHANNEL_O, (timer_reload >> 8) & 0xFF); 95 UnmaskInterrupt(INTRP::IVT::TIMER); I/O port for channel 1 data port.
I/O port for channel 0 data port.
DescriptorEntry idt_table[IDT_ENTRIES]
00(10)'0000 Low byte only
0000'000(0) 16 bit binary
const uint32_t BASE_FREQ
14.31818 MHz / 12 (due to hardware historical reason)
const uint16_t TICKS_PER_SECOND
00(01)'0000 Low byte only
(10)00'0000 Channel 2
I/O port for channel 2 data port.
const uint16_t IDT_ENTRIES
0000'000(1) 4 digit binary coded decimal
00(11)'0000 Low byte only
(01)00'0000 Channel 1
00(00)'0000 Latch count value
void TimerInterruptHandler()
Timer interrupt handler.
(00)00'0000 Channel 0