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, 2010, 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, Universitaetstrasse 6, CH-8092 Zurich. Attn: NetOS Group. 17 */ 18 19#ifndef RTC_H_ 20#define RTC_H_ 21 22/** \struct rtc_time rtc.h <rtc.h> 23 \brief Time structure. 24 This structure is used to get the current RTC time 25*/ 26 27struct rtc_time { 28 uint8_t hr; /**< current hour */ 29 uint8_t min; /**< current minute */ 30 uint8_t sec; /**< current second */ 31}; 32 33void rtc_read(struct rtc_time *t); 34void rtc_print(struct rtc_time *t); 35void rtc_write_cmos(int addr, uint8_t b); 36void rtc_write_extended(int addr, uint8_t b); 37uint8_t rtc_read_cmos(int addr); 38uint8_t rtc_read_extended(int addr, uint8_t b); 39uint8_t rtc_read_secs(void); 40void rtc_init(void); 41 42#endif // RTC_H_ 43