📄 ds1302.h
字号:
#ifndef __DS1302_H__
#define __DS1302_H__
#include <reg52.h>
sbit DSCK = P3^4;
sbit DSIO = P3^5;//DS1302 的引脚分配
sbit DSRST = P3^6;
#define uchar unsigned char
//定义一个结构体
struct time//时间结构,用结构管理时间
{
uchar sec;
uchar minute;
uchar hour;
uchar date;
uchar month;
uchar week;
uchar year;
};
uchar rt_rbyte();
void rt_reset();
void rt_wbyte(uchar);
void GetTime(struct time *p);//这里就定义左一个变量为*p的结构体,具有以上的参数
void SetTime(struct time *p);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -