From 42f77d4eb027afed4f4ef80f10c16112c2b7fe2b Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Fri, 31 Oct 2008 00:16:42 +0000 Subject: Abstract the PortalPlayer AS3514 handling with an "ascodec" API - inspired by the wmcodec API used with the Wolfson codecs. The intention is to implement this API for the AS3525 and then share code with the Sansa V2 ports. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18940 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/rtc/rtc_as3514.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'firmware/drivers/rtc/rtc_as3514.c') diff --git a/firmware/drivers/rtc/rtc_as3514.c b/firmware/drivers/rtc/rtc_as3514.c index 65d8359e08..878f204a4e 100644 --- a/firmware/drivers/rtc/rtc_as3514.c +++ b/firmware/drivers/rtc/rtc_as3514.c @@ -22,6 +22,7 @@ #include "rtc.h" #include "i2c-pp.h" #include "as3514.h" +#include "ascodec.h" #define MINUTE_SECONDS 60 #define HOUR_SECONDS 3600 @@ -57,7 +58,7 @@ int rtc_read_datetime(unsigned char* buf) /* RTC_AS3514's slave address is 0x46*/ for (i=0;i<4;i++){ - tmp[i] = i2c_readbyte(AS3514_I2C_ADDR, AS3514_RTC_0 + i); + tmp[i] = ascodec_read(AS3514_RTC_0 + i); } seconds = tmp[0] + (tmp[1]<<8) + (tmp[2]<<16) + (tmp[3]<<24); @@ -162,7 +163,7 @@ int rtc_write_datetime(unsigned char* buf) /* Send data to RTC */ for (i=0;i<4;i++){ - pp_i2c_send(AS3514_I2C_ADDR, AS3514_RTC_0 + i, ((seconds >> (8 * i)) & 0xff)); + ascodec_write(AS3514_RTC_0 + i, ((seconds >> (8 * i)) & 0xff)); } return 1; } -- cgit v1.2.3