Core
Loading...
Searching...
No Matches
rtc.h File Reference

Core RTC library. More...

#include <stdbool.h>
#include <stdint.h>
#include <time.h>

Go to the source code of this file.

Functions

bool core_RTC_init (bool force_init)
 Initialize the RTC module.
 
void core_RTC_get_time (struct tm *tm)
 Get the current RTC time as a tm struct (as defined in time.h)
 
void core_RTC_set_time (struct tm *tm, uint64_t sync)
 Set the current RTC time from a tm struct (as defined in time.h)
 
uint32_t core_RTC_get_usec ()
 Get the microsecond value associated with the most recent core_RTC_get_time() call.
 

Detailed Description

Core RTC library.

The core library component is used to set and get the current time using the internal RTC module.

Function Documentation

◆ core_RTC_get_time()

void core_RTC_get_time ( struct tm * tm)

Get the current RTC time as a tm struct (as defined in time.h)

When this function is called, the microsecond value is calculated but is not stored in the struct. This value can be retrieved with a subsequent call to core_RTC_get_usec().

Parameters
tmPointer to a tm struct

◆ core_RTC_get_usec()

uint32_t core_RTC_get_usec ( )

Get the microsecond value associated with the most recent core_RTC_get_time() call.

Returns
The microsecond value

◆ core_RTC_init()

bool core_RTC_init ( bool force_init)

Initialize the RTC module.

Return values
1if the initialization is successful
0otherwise

◆ core_RTC_set_time()

void core_RTC_set_time ( struct tm * tm,
uint64_t sync )

Set the current RTC time from a tm struct (as defined in time.h)

Parameters
tmPointer to a tm struct