#ifndef RTC_H
#define RTC_H
#include "cpuDSP2802x_I2c_defines.h"
#define cRTCAddress 0xA2
#define cWriteOption 0x00
#define cReadOption 0x01
#define cRegAddrControlStatus1 0x00
#define cRegAddrControlStatus2 0x01
#define cRegAddrVLSecond 0x02
#define cRegAddrMinute 0x03
#define cRegAddrHour 0x04
#define cRegAddrDay 0x05
#define cRegAddrWeekday 0x06
#define cRegAddrCentryMonth 0x07
#define cRegAddrYear 0x08
#define cRegAddrMinuteAlARM 0x09
#define cRegAddrHourAlarm 0x0A
#define cRegAddrDayAlarm 0x0B
#define cRegAddrWeekdayAlarm 0x0C
#define cRegAddrCLKOUTControl 0x0D
#define cRegAddrTimerControl 0x0E
#define cRegAddrTimer 0x0F
struct stTime
{
INT8U second;
INT8U minute;
INT8U hour;
INT8U day;
INT8U weekday;
INT8U centrymonth;
INT8U year;
};
extern struct stTime m_time;
extern void sInitRTC();
extern void sReadRTC();
extern void sWriteRTC();
#endif
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>