rtc.h File Reference

Low-level RTC peripheral driver interface definitions. More...

Detailed Description

Low-level RTC peripheral driver interface definitions.

Author
Thomas Eichinger thoma.nosp@m.s.ei.nosp@m.ching.nosp@m.er@f.nosp@m.u-ber.nosp@m.lin..nosp@m.de

Definition in file rtc.h.

#include <stdbool.h>
#include <stdint.h>
#include <time.h>
#include "periph_conf.h"
+ Include dependency graph for rtc.h:

Go to the source code of this file.

Macros

#define RIOT_EPOCH   (2020)
 Earliest year of the RTC. More...
 

Typedefs

typedef void(* rtc_alarm_cb_t) (void *arg)
 Signature for alarm Callback. More...
 

Functions

void rtc_init (void)
 Initialize RTC module.
 
int rtc_set_time (struct tm *time)
 Set RTC to given time. More...
 
int rtc_get_time (struct tm *time)
 Get current RTC time. More...
 
int rtc_set_alarm (struct tm *time, rtc_alarm_cb_t cb, void *arg)
 Set an alarm for RTC to the specified value. More...
 
int rtc_get_alarm (struct tm *time)
 Gets the current alarm setting. More...
 
void rtc_clear_alarm (void)
 Clear any set alarm, do nothing if nothing set.
 
void rtc_poweron (void)
 Turns the RTC hardware module on.
 
void rtc_poweroff (void)
 Turns the RTC hardware module off.
 
void rtc_tm_normalize (struct tm *time)
 Normalize the time struct. More...
 
int rtc_tm_compare (const struct tm *a, const struct tm *b)
 Compare two time structs. More...
 
uint32_t rtc_mktime (struct tm *t)
 Convert time struct into timestamp. More...
 
void rtc_localtime (uint32_t time, struct tm *t)
 Converts an RTC timestamp into a time struct. More...
 
bool rtc_tm_valid (const struct tm *t)
 Verify that a time struct t contains valid data. More...