FS#8961 - Anti-Aliased Fonts.
[kugel-rb.git] / firmware / drivers / rtc / rtc_pcf50606.c
blob50df5a1f95b222d9959d110d525938b5a96ef77f
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Linus Nielsen Feltzing, Uwe Freese, Laurent Baum
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #include "config.h"
22 #include "i2c.h"
23 #include "rtc.h"
24 #include "kernel.h"
25 #include "system.h"
26 #include "pcf50606.h"
27 #include <stdbool.h>
29 void rtc_init(void)
33 int rtc_read_datetime(unsigned char* buf) {
34 int rc;
35 int oldlevel = disable_irq_save();
37 rc = pcf50606_read_multiple(0x0a, buf, 7);
39 restore_irq(oldlevel);
40 return rc;
43 int rtc_write_datetime(unsigned char* buf) {
44 int rc;
45 int oldlevel = disable_irq_save();
47 rc = pcf50606_write_multiple(0x0a, buf, 7);
49 restore_irq(oldlevel);
51 return rc;