CARME-M4 BSP  V1.5

RTC communication interface. More...

+ Collaboration diagram for RTC:

Modules

 External RTC
 RTC on CARME mainboard.
 

Files

file  rtc.h
 RTC interface.
Communication interface to use the RTC from the CARME-M4.
 
file  rtc.c
 Communication interface to use the RTC on the controller.
 

Data Structures

struct  _CARME_RTC_TIME_t
 Structure to store a full date and time. More...
 

Macros

#define CARME_ERROR_RTC   CARME_ERROR_RTC_BASE + 0
 
#define CARME_RTC_USE_WAKEUP_ISR   0
 
#define CARME_RTC_STATE_REG   RTC_BKP_DR0
 
#define CARME_RTC_STATE_INIT_OK   0x35AC
 
#define CARME_RTC_STATE_TIME_OK   0xA3C5
 

Typedefs

typedef struct _CARME_RTC_TIME_t CARME_RTC_TIME_t
 Structure to store a full date and time.
 

Functions

void CARME_RTC_Init (void)
 Initialize and start the internal RTC of the STM32F4xx.
The date and time is set from the external RTC on the mainboard. More...
 
ERROR_CODES CARME_RTC_SetTime (CARME_RTC_TIME_t *time)
 Set the internal rtc date and time. More...
 
void CARME_RTC_GetTime (CARME_RTC_TIME_t *time)
 Get the date and time from the internal rtc. More...
 
uint32_t get_fattime (void)
 Get the time from the RTC.
This function is used from the FatFs and the function prototype is given by the FatFs module. More...
 

Detailed Description

RTC communication interface.

Macro Definition Documentation

#define CARME_ERROR_RTC   CARME_ERROR_RTC_BASE + 0

Common RTC error

Definition at line 83 of file rtc.h.

#define CARME_RTC_STATE_INIT_OK   0x35AC

RTC initialized

Definition at line 86 of file rtc.c.

#define CARME_RTC_STATE_REG   RTC_BKP_DR0

Status register

Definition at line 85 of file rtc.c.

#define CARME_RTC_STATE_TIME_OK   0xA3C5

RTC set

Definition at line 87 of file rtc.c.

#define CARME_RTC_USE_WAKEUP_ISR   0

Disable wakeup interrupt

Definition at line 86 of file rtc.h.

Function Documentation

void CARME_RTC_GetTime ( CARME_RTC_TIME_t time)

Get the date and time from the internal rtc.

Parameters
[out]timeBuffer structure to save the date and time.
Returns
None

Definition at line 204 of file rtc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CARME_RTC_Init ( void  )

Initialize and start the internal RTC of the STM32F4xx.
The date and time is set from the external RTC on the mainboard.

Returns
None
Examples:
sdcard.c.

Definition at line 105 of file rtc.c.

+ Here is the call graph for this function:

ERROR_CODES CARME_RTC_SetTime ( CARME_RTC_TIME_t time)

Set the internal rtc date and time.

Parameters
[in]timeDate and time to write to the internal rtc.
Returns
ERROR_CODES

Definition at line 167 of file rtc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t get_fattime ( void  )

Get the time from the RTC.
This function is used from the FatFs and the function prototype is given by the FatFs module.

Returns
Bit 25 to 31: Year from 1980 (0..127)
Bit 21 to 24: Month (1..12)
Bit 16 to 20: Day in month (1..31)
Bit 11 to 15: Hour (0..23)
Bit 5 to 10: Minute (0..59)
Bit 1 to 4: Second / 2 (0..29)

Definition at line 326 of file rtc.c.

+ Here is the call graph for this function: