Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

clock.h File Reference

The system clock headers. More...

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.
Returns:
The system ticks.


void delay (dword millisec)
 Delay some milliseconds
Parameters:
millisec  How many milliseconds you want to delay.


void set_timeout (timeout_t *t, unsigned int millisec)
 Initialize a timeout variable.
Parameters:
t  The timeout variable.
millisec  How many milliseconds have to elapse before the timeout occurs.


bool is_timeout (timeout_t *t)
 Check if a timeout has been elapsed.
Parameters:
t  The timeout variable.


void clock_thread ()
 This is a task that occurs at every clock tick.


Detailed Description

The system clock headers.

Author:
Andrea Righi <drizzt@inwind.it>
Date:
Last update: 2003-11-01
Note:
Copyright (©) 2003 Andrea Righi

Definition in file clock.h.


Generated on Fri Feb 20 15:32:17 2004 for Minirighi by doxygen1.2.18