comparison src/cs/drivers/drv_app/rtc/rtc_api.h @ 0:92470e5d0b9e

src: partial import from FC Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 15 May 2020 01:28:16 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92470e5d0b9e
1 /********************************************************************************/
2 /* */
3 /* File Name: rtc_functions.h */
4 /* */
5 /* Purpose: This file contains prototypes of RTC's internal functions. */
6 /* */
7 /* Note: None. */
8 /* */
9 /* Revision History: */
10 /* 03/20/01 Laurent Sollier Create. */
11 /* */
12 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */
13 /* */
14 /********************************************************************************/
15
16 #ifndef _RTC_FUNCTIONS_H_
17 #define _RTC_FUNCTIONS_H_
18
19 #include "rvf/rvf_api.h"
20
21
22 /********************************************************************************/
23 /* */
24 /* Generic functions declarations. */
25 /* */
26 /********************************************************************************/
27
28
29
30 /* Structure containing date and time */
31 typedef struct { UINT8 second; /* seconds after the minute - [0,59] */
32 UINT8 minute; /* minutes after the hour - [0,59] */
33 UINT8 hour; /* hours after the midnight - [0,23] */
34 UINT8 day; /* day of the month - [1,31] */
35 UINT8 month; /* months - [01,12] */
36 UINT8 year; /* years - [00,99] */
37 UINT8 wday; /* days in a week - [0,6] */
38 BOOL mode_12_hour; /* TRUE->12 hour mode ; FALSE-> 24 hour mode */
39 BOOL PM_flag; /* if 12 hour flag = TRUE
40 TRUE->PM ; FALSE->AM */
41 } T_RTC_DATE_TIME;
42
43
44 /*******************************************************************************
45 *
46 * RTC_RtcReset
47 *
48 * Purpose : Indicate if aRTC reset occured.
49 *
50 * Arguments: In : none
51 * Out: none
52 *
53 * Returns: TRUE if a RTC reset occurred
54 * FALSE if RTC didn't reset.
55 *
56 *
57 ******************************************************************************/
58
59 BOOL RTC_RtcReset(void);
60
61
62 /*******************************************************************************
63 *
64 * RTC_GetDateTime
65 *
66 * Purpose : Get date and time information.
67 *
68 * Arguments: In : none.
69 * Out: date_time : contain date and time data if return value is
70 * RVF_OK
71 *
72 * Returns: RVF_OK if date and time available in date_time variable
73 * RVF_NOT_READY if date and time is temporary not accessible for
74 * 30 micro seconds
75 * RVF_INTERNAL_ERROR else
76 *
77 ******************************************************************************/
78
79 T_RVF_RET RTC_GetDateTime(T_RTC_DATE_TIME* date_time);
80
81
82 /*******************************************************************************
83 *
84 * RTC_SetDateTime
85 *
86 * Purpose : Set date and time in RTC module.
87 *
88 * Arguments: In : date_time : date and time to set in RTC module
89 * Out: none
90 *
91 * Returns: RVF_OK if date and time have been set in RTC module
92 * RVF_NOT_READY if date and time cannot be saved before
93 * 30 micro seconds max
94 * RVF_INVALID_PARAMETER if date or/and timeformat is incorrect
95 * RVF_INTERNAL_ERROR else
96 *
97 *
98 ******************************************************************************/
99
100 T_RVF_RET RTC_SetDateTime(T_RTC_DATE_TIME date_time);
101
102
103 /*******************************************************************************
104 *
105 * RTC_GetAlarm
106 *
107 * Purpose : Get date and time alarm.
108 *
109 * Arguments: In : none
110 * Out: date_time : contain date and time data if return value is
111 * RVF_OK
112 *
113 * Returns: RVF_OK if date and time is available in date_time data
114 * RVF_INTERNAL_ERROR else
115 *
116 *
117 ******************************************************************************/
118
119 T_RVF_RET RTC_GetAlarm(T_RTC_DATE_TIME* date_time);
120
121
122 /*******************************************************************************
123 *
124 * RTC_SetAlarm
125 *
126 * Purpose : Set date and time alarmin RTC module.
127 *
128 * Arguments: In : date_time : Date and time alarm to set in RTC module
129 * return_path : return path used when date and time alarm is
130 * reached. This path can be a callback function or both
131 * task id and mailbox number
132 * Out: none
133 *
134 * Returns: RVF_OK if date and time alarm have been set in RTC module
135 * RVF_NOT_READY if date and time cannot be saved before
136 * 30 micro seconds max
137 * RVF_INVALID_PARAMETER if date or/and time format is incorrect
138 * RVF_INTERNAL_ERROR else
139 *
140 *
141 ******************************************************************************/
142
143 T_RVF_RET RTC_SetAlarm(T_RTC_DATE_TIME date_time, T_RV_RETURN return_path);
144
145
146 /*******************************************************************************
147 *
148 * RTC_UnsetAlarm
149 *
150 * Purpose : Unset alarm function.
151 *
152 * Arguments: In : none
153 * Out: none
154 *
155 * Returns: RVF_OK if date and time alarm have been set in RTC module
156 * RVF_NOT_READY if date and time cannot be saved before
157 * 30 micro seconds max
158 * RVF_INVALID_PARAMETER if date or/and time format is incorrect
159 * RVF_INTERNAL_ERROR else
160 *
161 *
162 ******************************************************************************/
163
164 T_RVF_RET RTC_UnsetAlarm(void);
165
166
167 /*******************************************************************************
168 *
169 * RTC_Rounding30s
170 *
171 * Purpose : Round time to the closest minute.
172 *
173 * Arguments: In : none
174 * Out: none
175 *
176 * Returns: none
177 *
178 *
179 ******************************************************************************/
180
181 void RTC_Rounding30s(void);
182
183
184 /*******************************************************************************
185 *
186 * RTC_Set12HourMode
187 *
188 * Purpose : Set the 12 or 24 hour mode for time get by RTC_GetDateTime and
189 * RTC_GetAlarm.
190 *
191 * Arguments: In : 12HourMode : TRUE if current time is on 12 hour mode
192 * FALSE if current time is on 24 hour mode
193 * Out: none
194 *
195 * Returns: none
196 *
197 *
198 ******************************************************************************/
199
200 void RTC_Set12HourMode(BOOL Mode12Hour);
201
202
203 /*******************************************************************************
204 *
205 * RTC_Is12HourMode
206 *
207 * Purpose : Define if the time given by RTC_GetAlarm and RTC_GetDateTime is in
208 * the 12 or 24 hour mode
209 *
210 * Arguments: In : none
211 * Out: none
212 *
213 * Returns: TRUE if current time is on 12 hour mode
214 * FALSE if current time is on 24 hour mode
215 *
216 *
217 ******************************************************************************/
218
219 BOOL RTC_Is12HourMode(void);
220
221
222 #endif /* #ifndef _RTC_FUNCTIONS_H_ */