A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing, Uwe Freese
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _RTC_H_
22#define _RTC_H_
23
24#include <stdbool.h>
25#include "system.h"
26#include "config.h"
27#include "time.h"
28
29/* Macros used to convert to and from BCD, used in various rtc drivers
30 this is the wrong place but misc.h is in apps... */
31#define BCD2DEC(X) (((((X)>>4) & 0x0f) * 10) + ((X) & 0xf))
32#define DEC2BCD(X) ((((X)/10)<<4) | ((X)%10))
33
34#if CONFIG_RTC
35
36/* Common functions for all targets */
37void rtc_init(void);
38int rtc_read_datetime(struct tm *tm);
39int rtc_write_datetime(const struct tm *tm);
40
41#ifdef HAVE_RTC_ALARM
42void rtc_set_alarm(int h, int m);
43void rtc_get_alarm(int *h, int *m);
44void rtc_enable_alarm(bool enable);
45bool rtc_check_alarm_started(bool release_alarm);
46bool rtc_check_alarm_flag(void);
47#endif /* HAVE_RTC_ALARM */
48
49#endif /* CONFIG_RTC */
50
51#endif
52