Go to the source code of this file.
Data Structures | |||||
| struct | timeout | ||||
| Timeout variable structure. More... | |||||
Defines | |||||
| #define | LATCH_COUNT 0x00 | ||||
| To copy chip count. | |||||
| #define | TIMER0 0x40 | ||||
| I/O port for timer channel 0. | |||||
| #define | TIMER2 0x42 | ||||
| I/O port for timer channel 2. | |||||
| #define | TIMER_MODE 0x43 | ||||
| I/O port for timer mode control. | |||||
| #define | SQUARE_WAVE 0x36 | ||||
| The sqare-wave form. | |||||
| #define | TIMER_FREQ 1193182L | ||||
| Clock frequency for timer in PC. | |||||
| #define | TIMER_COUNT (unsigned)(TIMER_FREQ/HZ) | ||||
| Value to initialize timer. | |||||
| #define | LATCH ((TIMER_FREQ + HZ/2) / HZ) | ||||
| LATCH is used for the interval timer. | |||||
| #define | HZ 200 | ||||
| Clock Frequancy (User settable, default=200Hz). | |||||
| #define | usleep(m) delay(m) | ||||
| Macro equivalent to delay(dword millisec). | |||||
Typedefs | |||||
| typedef timeout | timeout_t | ||||
| Timeout variable structure. | |||||
Functions | |||||
| void | init_clock () | ||||
| Initialize channel 0 of the 8253A timer. | |||||
| void | stop_clock () | ||||
| Reset the clock for rebooting. | |||||
| dword | sys_get_ticks (void) | ||||
Return the system ticks.
| |||||
| void | delay (dword millisec) | ||||
Delay some milliseconds
| |||||
| void | set_timeout (timeout_t *t, unsigned int millisec) | ||||
Initialize a timeout variable.
| |||||
| bool | is_timeout (timeout_t *t) | ||||
Check if a timeout has been elapsed.
| |||||
| void | clock_thread () | ||||
| This is a task that occurs at every clock tick. | |||||
Definition in file clock.h.
1.2.18