Module pit

Source
Expand description

The Programmable Interval Timer (PIT) chip (Intel 8253/8254) basically consists of an oscillator, a prescaler and 3 independent frequency dividers. Each frequency divider has an output, which is used to allow the timer to control external circuitry (for example, IRQ 0).

Reference: https://wiki.osdev.org/Programmable_Interval_Timer

EnumsΒ§

AccessMode πŸ”’
This bits tell the PIT what access mode is used for the selected channel.
Channel πŸ”’
Used to select the configured channel in the MODE_COMMAND_PORT of the PIT.
OperatingMode
PIT Operating Mode.

ConstantsΒ§

TIMER_INTERRUPT πŸ”’
TIMER_RATE πŸ”’

StaticsΒ§

CHANNEL0_PORT πŸ”’
The output from PIT channel 0 is connected to the PIC chip and generate β€œIRQ 0”. If connected to PIC, the IRQ0 will generate by the rising edge of the output voltage.
CHANNEL1_PORT πŸ”’
The output from PIT channel 1 was once used for refreshing the DRAM or RAM so that the capacitors don’t forget their state.
CHANNEL2_PORT πŸ”’
The output from PIT channel 2 is connected to the PC speaker, so the frequency of the output determines the frequency of the sound produced by the speaker. For more information, check https://wiki.osdev.org/PC_Speaker.
MODE_COMMAND_PORT πŸ”’
PIT command port.

FunctionsΒ§

enable_interrupt πŸ”’
Enables the interrupt line that is connected to the PIT.
init πŸ”’