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/target/arm/adc-as3514.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'firmware/target/arm/adc-as3514.c') diff --git a/firmware/target/arm/adc-as3514.c b/firmware/target/arm/adc-as3514.c index 26cdc76f0d..9c2a421441 100644 --- a/firmware/target/arm/adc-as3514.c +++ b/firmware/target/arm/adc-as3514.c @@ -20,7 +20,7 @@ ****************************************************************************/ #include "adc.h" #include "kernel.h" -#include "i2c-pp.h" +#include "ascodec.h" #include "as3514.h" /* Read 10-bit channel data */ @@ -30,21 +30,21 @@ unsigned short adc_read(int channel) if ((unsigned)channel < NUM_ADC_CHANNELS) { - i2c_lock(); + ascodec_lock(); /* Select channel */ - if (pp_i2c_send( AS3514_I2C_ADDR, AS3514_ADC_0, (channel << 4)) >= 0) + if (ascodec_write(AS3514_ADC_0, (channel << 4)) >= 0) { unsigned char buf[2]; /* Read data */ - if (i2c_readbytes( AS3514_I2C_ADDR, AS3514_ADC_0, 2, buf) >= 0) + if (ascodec_readbytes(AS3514_ADC_0, 2, buf) >= 0) { data = (((buf[0] & 0x3) << 8) | buf[1]); } } - i2c_unlock(); + ascodec_unlock(); } return data; -- cgit v1.2.3