Lab 2
|
Functions | |
int | timer_set_frequency (unsigned char timer, unsigned long freq) |
Changes the operating frequency of a timer. More... | |
int | timer_subscribe_int (void) |
Subscribes and enables Timer 0 interrupts. More... | |
int | timer_unsubscribe_int () |
Unsubscribes Timer 0 interrupts. More... | |
void | timer_int_handler () |
Timer 0 interrupt handler. More... | |
int | timer_get_conf (unsigned char timer, unsigned char *st) |
Reads the input timer configuration via read-back command. More... | |
int | timer_display_conf (unsigned char conf) |
Shows timer configuration. More... | |
int | timer_test_time_base (unsigned long freq) |
Tests change of Timer O interrupt frequency. More... | |
int | timer_test_int (unsigned long time) |
Tests Timer 0 interrupt handling. More... | |
int | timer_test_config (unsigned char timer) |
Tests display of timer config. More... | |
Functions for using the i8254 timers
int timer_display_conf | ( | unsigned char | conf | ) |
Shows timer configuration.
Displays in a human friendly way, the configuration of a timer as read via the read-back command, by providing the values (and meanings) of the different components of a timer configuration
conf | configuration to display in human friendly way |
int timer_get_conf | ( | unsigned char | timer, |
unsigned char * | st | ||
) |
Reads the input timer configuration via read-back command.
timer | Timer whose config to read (Ranges from 0 to 2) |
st | Address of memory position to be filled with the timer config |
void timer_int_handler | ( | ) |
Timer 0 interrupt handler.
Increments counter
int timer_set_frequency | ( | unsigned char | timer, |
unsigned long | freq | ||
) |
Changes the operating frequency of a timer.
Must not change the 3 LSBs (mode and BCD/binary) of the timer's control word.
timer | Timer to configure. (Ranges from 0 to 2) |
freq | Timer operating frequency |
int timer_subscribe_int | ( | void | ) |
Subscribes and enables Timer 0 interrupts.
int timer_test_config | ( | unsigned char | timer | ) |
Tests display of timer config.
Just calls timer_get_conf() followed by timer_display_conf()
timer | Timer whose config to read (Ranges from 0 to 2) |
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 |
int timer_test_time_base | ( | unsigned long | freq | ) |
Tests change of Timer O interrupt frequency.
Programs Timer 0 to generate interrupts with input frequency
freq | Frequency of interrupts to generate |
int timer_unsubscribe_int | ( | ) |
Unsubscribes Timer 0 interrupts.