[][src]Module sunrise_kernel::devices::pit

Programmable Interval Timer

channels

There are 3 channels :

operating modes

Each channel can operate in different modes. The ones we use are:

commands

Pit commands are sent on port 0x43. See OSDEV

To write channel reload values we always use the Access mode "lobyte/hibyte"

port 0x61

The PIT makes great use of the IO port 0x61 :

References

Structs

PITChannel2

Channel 2

PITPorts

We put the PIT ports in a structure to have them under a single mutex

PIT_PORTS

The mutex wrapping the ports

Port61Flags

The port 0x61 flags we use.

Enums

ChannelSelector

Used internally to select which channel to apply operations to.

Constants

CHAN_0_DIVISOR

The channel 0 reset value

CHAN_0_FREQUENCY

The frequency of channel 0 irqs, in hertz. One every 10 millisecond.

OSCILLATOR_FREQ

The oscillator frequency when not divided, in hertz.

Functions

disable

Prevent the PIT from generating interrupts.

init_channel_0

Initialize the channel 0 to send recurring irqs.

spin_wait_ms

Spin waits for at least ms amount of milliseconds