📄 rtc.h
字号:
/****************************************Copyright (c)**************************************************
**--------------File Info-------------------------------------------------------------------------------
** File name:RTC.h
** Last modified Date:2007-12-20
** Last Version: 1.0
** Descriptions: RTC初始化,时间设置以及获取
**------------------------------------------------------------------------------------------------------
** Created by: Rein Lee
** Created date: 2007-12-20
** Version: 1.0
** Descriptions: The original version
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
********************************************************************************************************/
#ifndef RTCDRV_H
#define RTCDRV_H
struct date {
uint16 da_year; /* 公元年 */
uint8 da_mon; /* 月 */
uint8 da_day; /* 月中日期 */
uint8 da_dow; /* 星期中日期 */
};
struct time {
uint8 ti_hour; /* 时 */
uint8 ti_min; /* 分 */
uint8 ti_sec; /* 秒 */
uint8 ti_hund; /* 毫秒 */
};
/*********************************************************************************************************
** 函数名称: RTCInit
** 功能描述: RTC初始化
** 输 入: 无
** 输 出: 无
** 全局变量: 无
** 调用模块: 无
**------------------------------------------------------------------------------------------------------
** Created by Rein Lee
** Created date: 2007-12-20
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void RTCInit(void);
/*********************************************************************************************************
** 函数名称: getdate
** 功能描述: 获取当前日期
** 输 入: today 日期结构体
** 输 出: 无
** 全局变量: 无
** 调用模块: 无
**------------------------------------------------------------------------------------------------------
** Created by Rein Lee
** Created date: 2007-12-20
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void getdate(struct date *today);
/*********************************************************************************************************
** 函数名称: gettime
** 功能描述: 获取当前时间
** 输 入: now 时间结构体
** 输 出: 无
** 全局变量: 无
** 调用模块: 无
**------------------------------------------------------------------------------------------------------
** Created by Rein Lee
** Created date: 2007-12-20
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void gettime(struct time *now);
/*********************************************************************************************************
** 函数名称: setdate
** 功能描述: 设置当前日期
** 输 入: today 日期结构体
** 输 出: 无
** 全局变量: 无
** 调用模块: 无
**------------------------------------------------------------------------------------------------------
** Created by Rein Lee
** Created date: 2007-12-20
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void setdate(struct date *today);
/*********************************************************************************************************
** 函数名称: settime
** 功能描述: 设置当前时间
** 输 入: now 时间结构体
** 输 出: 无
** 全局变量: 无
** 调用模块: 无
**------------------------------------------------------------------------------------------------------
** Created by Rein Lee
** Created date: 2007-12-20
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void settime(struct time *now);
#endif
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -