第 0 页(共 14 页)
//====================================================================
// File Name : 2410RTC.h
// Function : S3C2410 RTC Head file
//====================================================================
#ifndef __2410RTC_H__
#define __2410RTC_H__
void Display_Rtc(void);
void RndRst_Rtc(void);
void Test_Rtc_Alarm(void);
void Rtc_Init(void);
void Rtc_TimeSet(void);
void Test_Rtc_Tick(void);
void EINT0_int(void) __attribute__ ((interrupt ("IRQ")));
void Rtc_Int(void) __attribute__ ((interrupt ("IRQ")));
void Rtc_Tick(void) __attribute__ ((interrupt ("IRQ")));
#define TESTYEAR (0x01)
#define TESTMONTH (0x12)
#define TESTDATE (0x31)
#define TESTDAY (0x02) //SUN:1 MON:2 TUE:3 WED:4 THU:5 FRI:6 SAT:7
#define TESTHOUR (0x23)
#define TESTMIN (0x59)
#define TESTSEC (0x59)
#define TESTYEAR2 (0x02)
#define TESTMONTH2 (0x01)
#define TESTDATE2 (0x01)
#define TESTDAY2 (0x03) //SUN:1 MON:2 TUE:3 WED:4 THU:5 FRI:6 SAT:7
#define TESTHOUR2 (0x00)
#define TESTMIN2 (0x00)
#define TESTSEC2 (0x00)
#endif //__2410RTC_H__
//====================================================================
// File Name : 2410RTC.c
// Function : S3C2410 RTC Test Program
//====================================================================
#include "2410addr.h"
#include "2410lib.h"
#include "2410RTC.h"
char *day[8] = {" ","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
volatile int isRtcInt, isInit = 2;
volatile unsigned int sec_tick;
//=======================================
//Period = (n + 1) / 128 second
// n : Tick time count value (1~127)