summaryrefslogtreecommitdiff
path: root/firmware/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/rtc')
-rw-r--r--firmware/drivers/rtc/rtc_zenvisionm.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/firmware/drivers/rtc/rtc_zenvisionm.c b/firmware/drivers/rtc/rtc_zenvisionm.c
new file mode 100644
index 0000000000..b44af65c42
--- /dev/null
+++ b/firmware/drivers/rtc/rtc_zenvisionm.c
@@ -0,0 +1,37 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Maurus Cuelenaere
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20 #include "i2c-dm320.h"
21
22 #define I2C_ADDRESS 0x51
23
24 unsigned char* rtc_send_command(short unk1, short unk2)
25 {
26 unsigned char ret[12];
27 i2c_write(I2C_ADDRESS, (unk2 & 0xFF) | (unk << 8), 1);
28 i2c_read(I2C_ADDRESS, ret, 12);
29 return ret;
30 }
31
32 unsigned char* rtc_read(void)
33 {
34 unsigned char ret[12];
35 i2c_read(I2C_ADDRESS, ret, 12);
36 return ret;
37 } \ No newline at end of file