Real Time Clock Module with I2C Interface  0.3
⇒ back to Project Page
 All Data Structures Files Functions Variables Typedefs Macros Pages
rtc_control.h
Go to the documentation of this file.
1 /****************************************************************************/
32 #ifndef RTC_CONTROL_H_INCLUDED
33 #define RTC_CONTROL_H_INCLUDED
34 
35 
36 
37 /*********************************************************************************************/
88 
154 /*********************************************************************************************/
155 
156 
157 
158 
159 /******************************************
160  \internal
161  General Definitions
162 *******************************************/
163 
164 #ifndef TRUE
165 #define TRUE 1
166 #endif
167 #ifndef FALSE
168 #define FALSE 0
169 #endif
170 
171 
172 #define RTC_CONTROL_VERSION 0.3
173 
174 
175 #define RTC_LCD_DEBUG 0
176 #define RTC_LCD_TIMEDEBUG 0
177 
178 #define RTC_OCR0A 195
179 
180 #define RTC_BASE_YEAR 2000
181 
182 
183 #define RTC_SAA1064_OUTPUT 1
184 
185 
186 #define MAX_TIME_SCALE 250
187 
188 #define DCF77_SAMPLE_TIME 1
189 
190 #define DCF77_UPDATE_CYCLE 30
191 #define DCF77_ENABLED_DEFAULT 1
192 
193 #define DCF77_CYCLE_SECONDS 58
194 
195 
196 #define LED_HIGH_CURRENT_START_TIME 72000UL
197 #define LED_LOW_CURRENT_START_TIME 214500UL
198 
199 
200 
201 /******************************************
202  \internal
203  Definitions for I2C interface to master
204 *******************************************/
205 
206 //requests from base
207 #define RTC_CTRL_GETTIME 0x01
208 #define RTC_CTRL_CONFIG 0x02
209 
210 
211 #define I2C_SLAVE_TRANSFER_ABORT_CYCLES 30
212 //only used, if master I/O has higher priority!
213 
214 
215 /******************************************
216  \internal
217  Structure definitions
218 *******************************************/
219 
220 typedef struct dcf77_config_struc {
221 
223  uint8_t dcf_state;
224 
225  uint8_t dcf_enabled;
226 
228 
229 
230 /******************************************
231  \internal
232  Function prototypes
233 *******************************************/
234 
235 
236 
237 
238 /******************************************
239  \internal
240  Register description
241 *******************************************/
242 
243 // Address Bit Value Range Access
244 //
245 // 0 0...7 current register address [see i2c.h] R/W
246 //
247 // 1 0 current_dcf_signal [0, 1] R
248 // 1 dcf_enabled [0, 1] R/W
249 // 2...6 dcf_state [see dcf77.h] R
250 // 7 set_time_command [0, 1] W
251 //
252 // 2 0...5 seconds [0...59] R/W
253 // 6...7 minutes (0...1) [0...59] R/W
254 //
255 // 3 0...3 minutes (2...5) [0...59] R/W
256 // 4...7 month [1...12] R/W
257 //
258 // 4 0...4 hours [0...24] R/W
259 // 5...7 day of week [see dcf77.h] R/W
260 //
261 // 5 0...4 day [0...31] R/W
262 //
263 // 6 0...6 year [0...99] R/W
264 
265 
266 
267 
268 
269 #endif // RTC_CONTROL_H_INCLUDED