1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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 ****************************************************************************/
25 #define ADDR_READ 0x04
26 #define ADDR_WRITE 0x00
29 #define ADDR_BURST 0x00
34 int rtc_read_datetime(unsigned char* buf
)
36 char command
= ADDR_READ
|ADDR_BURST
; /* burst read from the start of the time/date reg */
37 spi_block_transfer(SPI_target_RX5X348AB
,
41 int rtc_write_datetime(unsigned char* buf
)
43 char command
= ADDR_WRITE
|ADDR_BURST
; /* burst read from the start of the time/date reg */
49 spi_block_transfer(SPI_target_RX5X348AB
,