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

📄 rtc.h

📁 dragon ball vz328 上的一个例子程序。 用于做手持仪表用。
💻 H
字号:
/*****************************BCD****************************************/
/*************************************************************************
       This funtion can be used to set the Time and run the module.
                     U8 second
                     U8 minite
                     U8 hour
                     U8 day
                     U8 week
                     U8 month
                     U16 year       sum to 9 varialbes.
      if success, the ret-value is '1'
      if fail, the ret-value is '0'.
*************************************************************************/  
U8 SetRealTime(U8 second,U8 minite,U8 hour,U8 day,U8 week,U8 month,U16 year);




/*************************************************************************************************************
           Obtain the real time form the PCF8563(RTC) keeped in the array:time[] and pointer: year.
                    buff[0]---second
                    buff[1]---minite
                    buff[2]---hour
                    buff[3]---day
                    buff[4]---week
                    buff[5]---month(century)
                    buff[6]---year(last two bits)
                    poiner year(P_U16) 
          if success, the ret-value is '1'
          if fail, the ret-value is '0'.
*************************************************************************************************************/
U8 GetRealTime(P_U8 buff,P_U16 year);



/*******************************************Decimal**********************************************************/
/*************************************************************************************************************
                  read_time[0]-----year
                  read_time[1]-----month
                  read_time[2]-----day
                  read_time[3]-----hour
                  read_time[4]-----minute
                  read_time[5]-----second
                  read_time[6]-----week
                  Note: the data or the time is decimal
                  If return value is 1 ,means the result is right,else the result is wrong.   
*************************************************************************************************************/
U8 FirstGetData(U16 read_time[7]);

/*************************************************************************************************************
          Note: the week is decimal
          
          You should define a variable "U16 week",and pass the parameter:"& week".
          If return value is 1 ,means the result is right,else the result is wrong.              
*************************************************************************************************************/
U8 GetWeek(P_U16 week);

/*************************************************************************************************************
                  read_time[0]----year
                  read_time[1]----month
                  read_time[2]----day
                  read_time[3]----hour
                  read_time[4]----minute
                  read_time[5]----second
                  Note: the data or the time is decimal
                  If return value is 1 ,means the result is right,else the result is wrong.              
*************************************************************************************************************/
U8 AnyGetTime(U16 read_time[6]);


/*************************************************************************************************************
                  This function can display the time.
*************************************************************************************************************/
U8 DisplayTime(P_U16 time);

U8 DisplayTimeAn(P_U16 time);

U8 DisplayTimeOt(P_U16 time);

⌨️ 快捷键说明

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