This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
RP2040_RTC.h
50 lines (37 loc) · 1.7 KB
/
RP2040_RTC.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/****************************************************************************************************************************
RP2040_RTC.h
For RP2040-based boards using internal RTC
with WiFiNINA, ESP8266/ESP32 WiFi, ESP8266-AT, W5x00, ENC28J60, LAN8742A Ethernet modules/shields
Built by Khoi Hoang https://github.com/khoih-prog/RP2040_RTC
Licensed under MIT license
Version: 1.0.5
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/06/2021 Initial release to support RP2040-based boards using internal RTC
1.0.1 K Hoang 14/06/2021 Add mbed_nano architecture to library.properties
1.0.2 K Hoang 16/06/2021 Fix bug in display alarm time
1.0.3 K Hoang 23/06/2021 Add simple example with manual time input
1.0.4 K Hoang 26/06/2021 Using TimeLib instead of Time
1.0.5 K Hoang 30/09/2021 Fix examples' issue with Nano_RP2040_Connect
*****************************************************************************************************************************/
#pragma once
#ifndef RP2040_RTC_H
#define RP2040_RTC_H
#define RP2040_RTC_VERSION "RP2040_RTC v1.0.5"
#if !defined(RTC_DEBUG)
#define RTC_DEBUG false
#endif
extern "C"
{
typedef void(* rtc_callback_t )(void);
void rtc_init (void);
bool rtc_set_datetime (datetime_t *t);
bool rtc_get_datetime (datetime_t *t);
void rtc_set_alarm (datetime_t *t, rtc_callback_t user_callback);
void rtc_disable_alarm (void);
void rtc_enable_alarm (void);
bool rtc_alarm_repeats(datetime_t *t);
void datetime_to_str(char *buf, uint buf_size, const datetime_t *t);
}
#include "DateTime_Generic.h"
#endif // RP2040_RTC_H