Nut/OS  5.0.5
API Reference
stm32_rtc.c File Reference
#include <cfg/os.h>
#include <sys/event.h>
#include <sys/timer.h>
#include <dev/rtc.h>
#include <arch/arm/stm32f10x_rtc.h>
#include <arch/arm/stm32f10x_rcc.h>
#include <arch/arm/stm32f10x_pwr.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for stm32_rtc.c:

Functions

int Stm32RtcGetClock (struct _tm *tm)
 Get date and time from an DS1307 hardware clock.
int Stm32RtcSetClock (const struct _tm *tm)
 Set the DS1307 hardware clock.
int Stm32RtcInit (void)
 Initialize the RTC in stm32f10x controller.

Variables

NUTRTC rtcStm32

Function Documentation

int Stm32RtcGetClock ( struct _tm tm)

Get date and time from an DS1307 hardware clock.

Parameters:
tmPoints to a structure that receives the date and time information.
Returns:
0 on success or -1 in case of an error.

References localtime_r(), rc, RTC, RTC_FLAG_RSF, and time().

Here is the call graph for this function:

int Stm32RtcSetClock ( const struct _tm tm)

Set the DS1307 hardware clock.

Parameters:
tmPoints to a structure which contains the date and time information.
Returns:
0 on success or -1 in case of an error.

References mktime(), RTC, RTC_FLAG_CNF, and time().

Here is the call graph for this function:

int Stm32RtcInit ( void  )

Initialize the RTC in stm32f10x controller.

Returns:
0 on success or -1 in case of an error.

References PWR, PWR_CR_DBP, rc, RCC, RCC_APB1Periph_BKP, RCC_APB1Periph_PWR, RCC_RTCCLKSource_HSE_Div128, RTC, RTC_FLAG_CNF, and RTC_FLAG_RSF.


Variable Documentation