📄 pcf8563.c
字号:
//---------------------------------------------------------------------------
// YuXiang Inc. Company Confidential Strictly Private
// $Archive: PCF8563.c.c $
// $Revision: 0.1 $
// $Author: YuCheng $
// $Date: 2005/08/19 16:15:51 $
//
// --------------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// --------------------------------------------------------------------------
// Copyright 2005(c) YuXiang Inc.
// This is an unpublished work.
// --------------------------------------------------------------------------
#include <intrins.h>
#include "includes.h"
#include "PCF8563.h"
#include "IIC.c"
INT8U T_m_second;
INT8U T_Second;
INT8U T_Minute;
INT8U T_Hour;
//INT8U T_Year;
//INT8U T_Mon;
//INT8U T_date;
INT8U PCF8563_RD(INT8U RTC_ADD) reentrant
{
INT8U temp;
temp=IICReadByte(PCF8563, RTC_ADD);
return(temp);
}
void PCF8563_WR(INT8U RTC_ADD,INT8U RTC_DATA)
{
IICWriteByte(PCF8563,RTC_ADD,RTC_DATA);
}
void RTC_Time_Init(void)
{
// T_Hour=0x3f&PCF8563_RD(RTC_ADD_Hour);
// T_Minute=0x7f&PCF8563_RD(RTC_ADD_Min);
// T_Second=0x7f&PCF8563_RD(RTC_ADD_Sec);
// if(((T_Hour)>0x24)||(T_Minute>0x60)||(T_Second>0x60))
{
PCF8563_WR(RTC_ADD_Hour,0x12);
PCF8563_WR(RTC_ADD_Min,0x00);
PCF8563_WR(RTC_ADD_Sec,0x00);
T_m_second=0;
T_Second=0;
T_Minute=0;
T_Hour=12;
}
}
void Timer_Set(INT8U Hour,INT8U Minute,INT8U Second)
{
PCF8563_WR(RTC_ADD_Hour,Hour);
PCF8563_WR(RTC_ADD_Min,Minute);
PCF8563_WR(RTC_ADD_Sec,Second);
}
void Timer_Read(void) reentrant
{
T_Second=PCF8563_RD(RTC_ADD_Sec);
T_Minute=PCF8563_RD(RTC_ADD_Min);
T_Hour=PCF8563_RD(RTC_ADD_Hour);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -