spi is shared between the rtc and tsc2100
[Rockbox.git] / firmware / drivers / rtc / rtc_rx5x348ab.c
blob3db30d2a38715a46d1cde6497b342211661a9efd
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: rtc_as3514.c 12131 2007-01-27 20:48:48Z dan_a $
10 * Copyright (C) 2007 by Jonathan Gordon
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #include "config.h"
21 #include "spi.h"
22 #include "rtc.h"
23 #include <stdbool.h>
25 void rtc_init(void)
29 int rtc_read_datetime(unsigned char* buf)
31 char command = 0x04; /* burst read from the start of the time/date reg */
32 spi_block_transfer(SPI_target_RX5X348AB,
33 &command, 1, buf, 7);
34 return 1;