@web-font-path: "roboto-debian.css";
v2.2.0 (RP2040)
Loading...
Searching...
No Matches
rtc.h
Go to the documentation of this file.
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _HARDWARE_RTC_H
#define _HARDWARE_RTC_H
#include "pico.h"
#if HAS_RP2040_RTC
#include "hardware/structs/rtc.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*rtc_callback_t)(void);
void rtc_init(void);
bool rtc_set_datetime(const datetime_t *t);
bool rtc_get_datetime(datetime_t *t);
bool rtc_running(void);
void rtc_set_alarm(const datetime_t *t, rtc_callback_t user_callback);
void rtc_enable_alarm(void);
void rtc_disable_alarm(void);
#ifdef __cplusplus
}
#endif
#endif
rtc_callback_t
void(* rtc_callback_t)(void)
Definition rtc.h:42
rtc_set_datetime
bool rtc_set_datetime(const datetime_t *t)
Set the RTC to the specified time.
Definition rtc.c:54
rtc_disable_alarm
void rtc_disable_alarm(void)
Disable the RTC alarm (if active).
Definition rtc.c:184
rtc_get_datetime
bool rtc_get_datetime(datetime_t *t)
Get the current time from the RTC.
Definition rtc.c:87
rtc_set_alarm
void rtc_set_alarm(const datetime_t *t, rtc_callback_t user_callback)
Set a time in the future for the RTC to call a user provided callback.
Definition rtc.c:146
rtc_enable_alarm
void rtc_enable_alarm(void)
Enable the RTC alarm (if inactive).
Definition rtc.c:108
rtc_running
bool rtc_running(void)
Is the RTC running?
Definition rtc.c:18
rtc_init
void rtc_init(void)
Initialise the RTC system.
Definition rtc.c:22
pico.h
datetime_t
Structure containing date and time information.
Definition types.h:107