1/** 2 * \file 3 * \brief Real Time Clock Header File 4 * 5 * This file contains the defines, the struct and the procedure 6 * signatures used to access the real time clock (the hardware 7 * clock). 8 */ 9 10/* 11 * Copyright (c) 2007, 2008, ETH Zurich. 12 * All rights reserved. 13 * 14 * This file is distributed under the terms in the attached LICENSE file. 15 * If you do not find this file, copies can be found by writing to: 16 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. 17 */ 18 19#ifndef RTC_H_ 20#define RTC_H_ 21 22#include <stdint.h> 23 24/** \struct rtc_time rtc.h <rtc.h> 25 \brief Time structure. 26 This structure is used to get the current RTC time 27*/ 28 29struct rtc_time { 30 uint8_t hr; /**< current hour */ 31 uint8_t min; /**< current minute */ 32 uint8_t sec; /**< current second */ 33}; 34 35extern void rtc_write_cmos(int addr, uint8_t b); 36extern void rtc_write_extended(int addr, uint8_t b); 37extern uint8_t rtc_read_cmos(int addr); 38extern uint8_t rtc_read_extended(int addr, uint8_t b); 39 40extern void rtc_read(struct rtc_time *t); 41uint8_t rtc_read_secs(void); 42extern void rtc_print(struct rtc_time *t); 43 44#endif // RTC_H_ 45