1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * Real-time clock driver interface. |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * COPYRIGHT (c) 1989-2001. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.com/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef _RTEMS_RTC_H |
---|
17 | #define _RTEMS_RTC_H |
---|
18 | |
---|
19 | #include <rtems.h> |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif |
---|
24 | |
---|
25 | /** |
---|
26 | * @defgroup rtems_rtc Real-Time Clock Driver Interface |
---|
27 | * |
---|
28 | * This driver interface provides support to read and set the real-time clock |
---|
29 | * and to initialize the time of day for the system. |
---|
30 | * |
---|
31 | * @{ |
---|
32 | */ |
---|
33 | |
---|
34 | /** |
---|
35 | * Device file name path. |
---|
36 | */ |
---|
37 | #define RTC_DEVICE_NAME "/dev/rtc" |
---|
38 | |
---|
39 | /** |
---|
40 | * Device driver table entry. |
---|
41 | */ |
---|
42 | #define RTC_DRIVER_TABLE_ENTRY \ |
---|
43 | { rtc_initialize, rtc_open, rtc_close, \ |
---|
44 | rtc_read, rtc_write, rtc_control } |
---|
45 | |
---|
46 | /** |
---|
47 | * Initializes the real-time clock device and sets the time of day for the |
---|
48 | * system. |
---|
49 | * |
---|
50 | * If the real-time clock provides an invalid time of day value the system time |
---|
51 | * of day must remain untouched. |
---|
52 | */ |
---|
53 | rtems_device_driver rtc_initialize( |
---|
54 | rtems_device_major_number, |
---|
55 | rtems_device_minor_number, |
---|
56 | void * |
---|
57 | ); |
---|
58 | |
---|
59 | /** |
---|
60 | * Opens the real-time clock device. |
---|
61 | */ |
---|
62 | rtems_device_driver rtc_open( |
---|
63 | rtems_device_major_number, |
---|
64 | rtems_device_minor_number, |
---|
65 | void * |
---|
66 | ); |
---|
67 | |
---|
68 | /** |
---|
69 | * Closes the real-time clock device. |
---|
70 | */ |
---|
71 | rtems_device_driver rtc_close( |
---|
72 | rtems_device_major_number, |
---|
73 | rtems_device_minor_number, |
---|
74 | void * |
---|
75 | ); |
---|
76 | |
---|
77 | /** |
---|
78 | * Reads the real-time clock value. |
---|
79 | * |
---|
80 | * The value will be returned in a @ref rtems_time_of_day structure. |
---|
81 | */ |
---|
82 | rtems_device_driver rtc_read( |
---|
83 | rtems_device_major_number, |
---|
84 | rtems_device_minor_number, |
---|
85 | void * |
---|
86 | ); |
---|
87 | |
---|
88 | /** |
---|
89 | * Sets the real-time clock value. |
---|
90 | * |
---|
91 | * The value will be set from a @ref rtems_time_of_day structure. |
---|
92 | */ |
---|
93 | rtems_device_driver rtc_write( |
---|
94 | rtems_device_major_number, |
---|
95 | rtems_device_minor_number, |
---|
96 | void * |
---|
97 | ); |
---|
98 | |
---|
99 | /** |
---|
100 | * Controls the real-time clock. |
---|
101 | */ |
---|
102 | rtems_device_driver rtc_control( |
---|
103 | rtems_device_major_number, |
---|
104 | rtems_device_minor_number, |
---|
105 | void * |
---|
106 | ); |
---|
107 | |
---|
108 | /** @} */ |
---|
109 | |
---|
110 | #ifdef __cplusplus |
---|
111 | } |
---|
112 | #endif |
---|
113 | |
---|
114 | #endif |
---|