00001 /* 00002 * $Id: rtc.h,v 1 2004/11/25 10:31:00 BorisK Exp $ 00003 * 00004 * Copyright (C) 2004 ONTRACK s.r.o. 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00019 * 02111-1307, USA. 00020 * 00021 * [1] ARM-based Microcontroller LPC2119/2129/2194/2292/9994, "Preliminary User Manual", February 03, 2004 00022 * 00023 * Written by Boris Kralik <kralikbo@yahoo.com>, 2004 00024 * 00025 */ 00026 #ifndef RTC_H 00027 #define RTC_H 00028 #define DEBUG 1 00029 #include "lpc229x.h" 00030 #include "types.h" 00031 typedef struct Alarm{ 00032 uint8_t ALSEC; 00033 uint8_t ALMIN; 00034 uint8_t ALHOUR; 00035 uint8_t ALDOM; 00036 uint8_t ALDOW; 00037 uint8_t ALDOY; 00038 uint8_t ALMON; 00039 uint8_t ALYEAR; 00040 uint8_t AMR; 00041 }pAlarm; 00042 typedef struct Timer{ 00043 uint8_t SEC; 00044 uint8_t MIN; 00045 uint8_t HOUR; 00046 uint8_t DOM; 00047 uint8_t DOW; 00048 uint8_t DOY; 00049 uint8_t MONTH; 00050 uint8_t YEAR; 00051 00052 }pTimer; 00053 00054 void ResetRTC(pTimer); 00055 void StartRTC(void); 00056 void SetRTC(uint8_t,pTimer); 00057 void StopRTC(void); 00058 pTimer GetTimeRTC(void); 00059 void SetAlarm(pAlarm); 00060 #endif
1.4.7