Lab3
|
Functions | |
int | timer_set_square (unsigned long timer, unsigned long freq) |
Configures a timer to generate a square wave. | |
int | timer_subscribe_int (void) |
Subscribes and enables Timer 0 interrupts. | |
int | timer_unsubscribe_int () |
Unsubscribes Timer 0 interrupts. | |
void | timer_int_handler () |
Timer 0 interrupt handler. | |
int | timer_test_square (unsigned long freq) |
Tests programming timer in square wave mode. | |
int | timer_test_int (unsigned long time) |
Tests Timer 0 interrupt handling. |
Functions for using the i8254 timers
int timer_set_square | ( | unsigned long | timer, |
unsigned long | freq | ||
) |
Configures a timer to generate a square wave.
timer | Timer to configure. (Ranges from 0 to 2) |
freq | Frequency of the square wave to generate |
int timer_subscribe_int | ( | void | ) |
Subscribes and enables Timer 0 interrupts.
int timer_unsubscribe_int | ( | ) |
Unsubscribes Timer 0 interrupts.
void timer_int_handler | ( | ) |
Timer 0 interrupt handler.
Increments counter
int timer_test_square | ( | unsigned long | freq | ) |
Tests programming timer in square wave mode.
Programs Timer 0 to generate square mode with input frequency
freq | Frequency of square wave to generate |
int timer_test_int | ( | unsigned long | time | ) |
Tests Timer 0 interrupt handling.
Subscribes Timer 0 interrupts and prints a message once per second for the specified time interval
time | Length of time interval while interrupts are subscribed |