⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcf8563lib.h

📁 基于AT89S52控制芯片的电子万年历程序
💻 H
字号:
#ifndef PCF8563_H
#define PCF8563_H

#include "reg52.h"
#include <intrins.h>
#include "IIClib.h"                                        /*包含IIC总线读写函数头文件*/

#define nop _nop_()
#define uchar unsigned char
#define uint unsigned int

struct c_s{                                               /*定义控制/状态结构*/
    uchar cs1;  
    uchar cs2;
};

struct time{                                               /*定义时间结构*/
    uchar seconds;
    uchar minutes;
    uchar hours;
    uchar days;
    uchar weekdays;
    uchar mon_cen;
    uchar years;
};
  
struct alarm{                                              /*定义闹钟结构*/
    uchar minute; 
    uchar hour;
    uchar day;
    uchar weekday;
 };
 
void PCF8563_SetCS(struct c_s cs);                         /*设置控制/状态字函数*/
void PCF8563_ReadCS(struct c_s* cs);                       /*读控制/状态字*/
void PCF8563_ReadTime(struct time* tm);                    /*读时间函数*/
bit PCF8563_SetTime(struct time tm);                           /*设定时间函数*/
void PCF8563_ReadAlarm(struct alarm* alm);                  /*读闹钟函数*/
bit PCF8563_SetAlarm(struct alarm alm,bit min,bit hou,bit day,bit wee); 
                                                            /*设定闹钟函数*/
void PCF8563_StartTimer(char freq);                         /*启动定时器*/
void PCF8563_StopTimer(void);                               /*停止定时器*/
void PCF8563_SetTimerCount(uchar count);                     /*设置定时器初值*/

#endif    /*PCF8563_H*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -