root / trunk / code / projects / colonet / robot / wl_network_colonet / time.h @ 481
History | View | Annotate | Download (1.25 KB)
1 | 13 | emarinel | /*
|
---|---|---|---|
2 | time.h
|
||
3 | |||
4 | provisional (Suresh)
|
||
5 | |||
6 | */
|
||
7 | |||
8 | #ifndef _TIME_H_
|
||
9 | #define _TIME_H_
|
||
10 | |||
11 | #define TIMER_OFF 0x00 |
||
12 | #define PRESCALE_NONE 0x01 |
||
13 | #define PRESCALE_DIV_8 0x02 |
||
14 | #define PRESCALE_DIV_32 0x03 |
||
15 | #define PRESCALE_DIV_64 0x04 |
||
16 | #define PRESCALE_DIV_128 0x05 |
||
17 | #define PRESCALE_DIV_256 0x06 |
||
18 | #define PRESCALE_DIV_1024 0x07 |
||
19 | |||
20 | /*
|
||
21 | delay_ms(int ms)
|
||
22 | pause_ms(int ms)
|
||
23 | sleep_ms(int ms)
|
||
24 | pause(int ms)
|
||
25 | sleep(int ms)
|
||
26 | |||
27 | all have the same behavior
|
||
28 | pauses the calling process for the specified
|
||
29 | amount of time in milliseconds
|
||
30 | */
|
||
31 | void delay_ms(int ms) ; |
||
32 | void pause_ms(int ms); |
||
33 | void pause(int ms); |
||
34 | void sleep_ms(int ms); |
||
35 | void sleep(int ms); |
||
36 | |||
37 | /*
|
||
38 | void rtc_init(void)
|
||
39 | call this function to initialize the real time clock
|
||
40 | real time clock requires global interrupts to be enabled
|
||
41 | */
|
||
42 | void rtc_init(int prescale_opt, unsigned char ocr_val, void (*rtc_func)(void)); |
||
43 | |||
44 | /*
|
||
45 | void rtc_reset(void)
|
||
46 | use this to reset the real time value
|
||
47 | rtc_init() should be called beforehand
|
||
48 | */
|
||
49 | void rtc_reset(void); |
||
50 | |||
51 | /*
|
||
52 | int rtc(void)
|
||
53 | returns the current value of the real time clock (in seconds)
|
||
54 | rtc_init() should be called beforehand
|
||
55 | |||
56 | the returned amount is the number of seconds that have past since the
|
||
57 | last call to rtc_init() or rtc_reset()
|
||
58 | */
|
||
59 | int rtc(void); |
||
60 | |||
61 | #endif |