implements the PIT
This commit is contained in:
@ -61,4 +61,15 @@ void set_pit_count(uint8_t channel, uint16_t count) // Only in lobyte/hibyte mod
|
||||
// TODO: make sure to set interrupts
|
||||
}
|
||||
|
||||
void init_pit(uint8_t init_command, uint8_t channel, uint32_t divisor)
|
||||
{
|
||||
uint32_t normalized_div = normalize_divisor(divisor);
|
||||
|
||||
pit.divisor = normalized_div;
|
||||
pit.interrupts = 0;
|
||||
|
||||
outb(PIT_CMD_REG, init_command); // access mode must be lobyte/hibyte
|
||||
|
||||
outb(channel, normalized_div & 0xFF);
|
||||
outb(channel, (normalized_div & 0xFF00) >> 8);
|
||||
}
|
||||
|
Reference in New Issue
Block a user