pub fn enable_interrupts(freq_hertz: u32) -> Result<(), &'static str>
Expand description

Configures the PIT to fire an interrupt at the given frequency (in Hz).

Only Channel 0 of the PIT is directly connected to an IRQ, so it must be used. Note that Channel 1 does not exist and Channel 2 is reserved for non-interrupt timer usage.

Arguments

  • freq_hertz: the frequency in Hz of the desired PIT interrupt. The minimum value is 19 Hz, which is based on the fact that the timer register cannot be loaded with a value larger than u16::MAX (65535), and that the value loaded into the register is a divisor value. That divisor value is the default timer frequency 1193182 divided by freq_hertz.