rtc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Thomas Eichinger <thomas.eichinger@fu-berlin.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
26 #ifndef PERIPH_RTC_H
27 #define PERIPH_RTC_H
28 
29 #include <time.h>
30 #include "periph_conf.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
41 typedef void(*rtc_alarm_cb_t)(void *arg);
42 
46 void rtc_init(void);
47 
56 int rtc_set_time(struct tm *time);
57 
66 int rtc_get_time(struct tm *time);
67 
81 int rtc_set_alarm(struct tm *time, rtc_alarm_cb_t cb, void *arg);
82 
91 int rtc_get_alarm(struct tm *time);
92 
96 void rtc_clear_alarm(void);
97 
101 void rtc_poweron(void);
102 
106 void rtc_poweroff(void);
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif /* PERIPH_RTC_H */
113 
void rtc_init(void)
Initialize RTC module.
void rtc_clear_alarm(void)
Clear any set alarm, do nothing if nothing set.
int rtc_set_time(struct tm *time)
Set RTC to given time.
void rtc_poweroff(void)
Turns the RTC hardware module off.
void rtc_poweron(void)
Turns the RTC hardware module on.
void(* rtc_alarm_cb_t)(void *arg)
Signature for alarm Callback.
Definition: rtc.h:41
int rtc_get_alarm(struct tm *time)
Gets the current alarm setting.
Datatype to represent time.
int rtc_set_alarm(struct tm *time, rtc_alarm_cb_t cb, void *arg)
Set an alarm for RTC to the specified value.
int rtc_get_time(struct tm *time)
Get current RTC time.