BRTOS  1.90
Brazilian Real-Time Operating System
 All Data Structures Files Functions Variables Macros
OSTime.h
Go to the documentation of this file.
1 
8 /*********************************************************************************************************
9 * BRTOS
10 * Brazilian Real-Time Operating System
11 * Acronymous of Basic Real-Time Operating System
12 *
13 *
14 * Open Source RTOS under MIT License
15 *
16 *
17 *
18 * OS Time managment functions Header
19 *
20 *
21 * Author: Gustavo Weber Denardin
22 * Revision: 1.0
23 * Date: 20/03/2009
24 *
25 *********************************************************************************************************/
26 
27 #ifndef OS_TIME_H
28 #define OS_TIME_H
29 
30 #include "OS_types.h"
31 
32 
33 
34 
35 
41 
47 typedef struct {
48 
49  uint8_t RTC_Second;
50  uint8_t RTC_Minute;
51  uint8_t RTC_Hour;
52 
53 } OSTime;
54 
59 
60 
61 
62 
63 
69 
75 typedef struct {
76 
77  uint8_t RTC_Day;
78  uint8_t RTC_Month;
79  uint16_t RTC_Year;
80 } OSDate;
81 
86 
87 
88 
89 
90 
96 
102 typedef struct {
103 
104 
105  OSTime DC_Hora_Exata;
106  OSDate DC_Dia_Exato;
107 
108 } OSTime_Date;
109 
114 
115 
116 struct _OSRTC
117 {
118  uint16_t Year;
119  uint8_t Month;
120  uint8_t Day;
121  uint8_t Hour;
122  uint8_t Min;
123  uint8_t Sec;
124 };
125 
126 
127 typedef struct _OSRTC OS_RTC;
128 
129 
130 
131 
132 
138 
139 /*****************************************************************************************
140 * \fn void OSUpdateTime(OSTime *Ptr_Hora)
141 * \brief Update the system time
142 * Used to update the system time
143 * \param Ptr_Hora - pointer to the current system time
144 * \return None
145 *****************************************************************************************/
146 
147 void OSUpdateTime(void);
148 
149 void OSUpdateDate(void);
150 
151 void OSResetTime(void);
152 
153 void OSResetDate(void);
154 
155 void OSUpdateUptime(void);
156 
157 OSTime OSUptime(void);
158 
159 OSDate OSUpDate(void);
160 
161 // Calendar Functions
162 void OSUpdateCalendar(void);
163 void GetCalendar(OS_RTC *rtc);
164 void SetCalendar(OS_RTC *rtc);
165 void Init_Calendar(void);
166 
171 
172 
173 
174 
175 
176 
177 
182 
183 
184 #endif
Definition: OSTime.h:47
uint8_t RTC_Minute
Minutes of the clock.
Definition: OSTime.h:50
uint8_t RTC_Month
Month of the date.
Definition: OSTime.h:78
Definition: OSTime.h:75
uint16_t RTC_Year
Year of the date.
Definition: OSTime.h:79
uint8_t RTC_Hour
Hours of the clock.
Definition: OSTime.h:51
Definition: OSTime.h:102
uint8_t RTC_Day
Day of the date.
Definition: OSTime.h:77
uint8_t RTC_Second
Seconds of the clock.
Definition: OSTime.h:49
BRTOS types declaration.