You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#ifndef __DS1302_H_
|
|
|
|
|
#define __DS1302_H_
|
|
|
|
|
|
|
|
|
|
//---<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>---//
|
|
|
|
|
#include<reg51.h>
|
|
|
|
|
#include<intrins.h>
|
|
|
|
|
|
|
|
|
|
//---<EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD>---//
|
|
|
|
|
#ifndef uchar
|
|
|
|
|
#define uchar unsigned char
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef uint
|
|
|
|
|
#define uint unsigned int
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
//---<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ds1302ʹ<EFBFBD>õ<EFBFBD>IO<EFBFBD><EFBFBD>---//
|
|
|
|
|
sbit DSIO=P3^4;
|
|
|
|
|
sbit RST=P3^3;
|
|
|
|
|
sbit SCLK=P3^5;
|
|
|
|
|
|
|
|
|
|
//---<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD>ֺ<EFBFBD><EFBFBD><EFBFBD>---//
|
|
|
|
|
void Ds1302Write(uchar addr, uchar dat);
|
|
|
|
|
uchar Ds1302Read(uchar addr);
|
|
|
|
|
void Ds1302Init();
|
|
|
|
|
void Ds1302ReadTime();
|
|
|
|
|
|
|
|
|
|
//---<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD>--//
|
|
|
|
|
extern uchar TIME[7]; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
#endif
|