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