文件名称:110325dj9p6ik6j9iniiii
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2015-02-15
- 文件大小:
- 3kb
- 下载次数:
- 0次
- 提 供 者:
- 大***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
STM32实时时钟功能的标准库实现首先是bsp驱动,包括初始化函数RTC_Init()和设置时间函数RTC_Set()。
接下来就是<time.h>中的相关函数,我只实现了我认为最重要的函数
time_t time(time_t *time)
time_t mktime(struct tm *timeptr)
struct tm *gmtime(const time_t *timer)
以及辅助函数
static int getTotalDays(int year, int month, int day)
因为gmtime函数需要用到<stdlib.h>中的malloc函数,有时不希望使用该函数,所以我还实现了一个他的变体函数
UINT8 gmtime2(struct tm *time, const time_t *timer) -The standard library STM32 real time clock function to realize the first is the BSP driver, including the initialization function (RTC_Init) and set the time function RTC_Set ().
The next is the correlation function in the <time.h>, I just realized I think the most important function of the
Time_t time (time_t*time)
Time_t mktime (struct TM*timeptr)
Struct TM*gmtime (const time_t*timer)
And the auxiliary function
Static int getTotalDays (int year, int month, int day)
Because the gmtime function need to use malloc function in <stdlib.h>, sometimes do not want to use this function, so I also realized a his variant function
UINT8 gmtime2 (struct TM*time, const time_t*timer)
接下来就是<time.h>中的相关函数,我只实现了我认为最重要的函数
time_t time(time_t *time)
time_t mktime(struct tm *timeptr)
struct tm *gmtime(const time_t *timer)
以及辅助函数
static int getTotalDays(int year, int month, int day)
因为gmtime函数需要用到<stdlib.h>中的malloc函数,有时不希望使用该函数,所以我还实现了一个他的变体函数
UINT8 gmtime2(struct tm *time, const time_t *timer) -The standard library STM32 real time clock function to realize the first is the BSP driver, including the initialization function (RTC_Init) and set the time function RTC_Set ().
The next is the correlation function in the <time.h>, I just realized I think the most important function of the
Time_t time (time_t*time)
Time_t mktime (struct TM*timeptr)
Struct TM*gmtime (const time_t*timer)
And the auxiliary function
Static int getTotalDays (int year, int month, int day)
Because the gmtime function need to use malloc function in <stdlib.h>, sometimes do not want to use this function, so I also realized a his variant function
UINT8 gmtime2 (struct TM*time, const time_t*timer)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
rtc_time.c