Loading...
Searching...
No Matches
walltime.h File Reference

Detailed Description

#include <stdbool.h>
#include <stdint.h>
#include <time.h>
+ Include dependency graph for walltime.h:

Go to the source code of this file.

Data Structures

struct  walltime_change_sub_t
 Time change notification subscription. More...
 

Typedefs

typedef void(* walltime_change_cb_t) (void *ctx, int32_t diff_sec, int16_t diff_ms)
 Time change notification callback.
 

Functions

void walltime_change_subscribe (walltime_change_sub_t *sub)
 Add a time change notification subscription This will be called whenever the system time changes.
 
bool walltime_change_unsubscribe (walltime_change_sub_t *sub)
 Remove a time change notification subscription.
 
int walltime_set (struct tm *time)
 Set the system date / time.
 
int walltime_get (struct tm *time, uint16_t *ms)
 Get the system date / time.
 
uint32_t walltime_get_riot (uint16_t *ms)
 Get the current system time in seconds since RIOT_EPOCH.
 
time_t walltime_get_unix (uint16_t *ms)
 Get the current system time in seconds since 01.01.1970.
 
uint32_t walltime_uptime (bool full)
 Get seconds elapsed since last reset.
 
void walltime_impl_init (void)
 Backend implementation init, only implement when necessary.
 
int walltime_impl_set (struct tm *time)
 Backend implementation to set the system time.
 
int walltime_impl_get (struct tm *time, uint16_t *ms)
 Backend implementation to get the system time.