文件名称:110325dj9p6ik6j9iniiii
介绍说明--下载内容来自于网络,使用问题请自行百度
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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.