Files
STC89C51-Perpetual-Calendar/Keil Code/Revise_1/ds1302.h
T

32 lines
617 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef __DS1302_H_
#define __DS1302_H_
//---����ͷ�ļ�---//
#include<reg51.h>
#include<intrins.h>
//---�ض���ؼ���---//
#ifndef uchar
#define uchar unsigned char
#endif
#ifndef uint
#define uint unsigned int
#endif
//---����ds1302ʹ�õ�IO��---//
sbit DSIO=P1^1;
sbit RST=P1^2;
sbit SCLK=P1^0;
//---����ȫ�ֺ���---//
void Ds1302Write(uchar addr, uchar dat);
uchar Ds1302Read(uchar addr);
void Ds1302Init();
void Ds1302ReadTime();
void Ds1302WriteTime();
//---����ȫ�ֱ���--//
extern uchar TIME[7]; //����ȫ�ֱ���
#endif