summaryrefslogtreecommitdiff
path: root/firmware/target/arm/adc-as3514.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-10-31 00:16:42 +0000
committerDave Chapman <dave@dchapman.com>2008-10-31 00:16:42 +0000
commit42f77d4eb027afed4f4ef80f10c16112c2b7fe2b (patch)
tree2da09bcab257322dce48ddccc4a71d915318aa3a /firmware/target/arm/adc-as3514.c
parent324816f0190dec308f3496a288820a47926b1c17 (diff)
downloadrockbox-42f77d4eb027afed4f4ef80f10c16112c2b7fe2b.tar.gz
rockbox-42f77d4eb027afed4f4ef80f10c16112c2b7fe2b.zip
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
Diffstat (limited to 'firmware/target/arm/adc-as3514.c')
-rw-r--r--firmware/target/arm/adc-as3514.c10
1 files changed, 5 insertions, 5 deletions
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 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "adc.h" 21#include "adc.h"
22#include "kernel.h" 22#include "kernel.h"
23#include "i2c-pp.h" 23#include "ascodec.h"
24#include "as3514.h" 24#include "as3514.h"
25 25
26/* Read 10-bit channel data */ 26/* Read 10-bit channel data */
@@ -30,21 +30,21 @@ unsigned short adc_read(int channel)
30 30
31 if ((unsigned)channel < NUM_ADC_CHANNELS) 31 if ((unsigned)channel < NUM_ADC_CHANNELS)
32 { 32 {
33 i2c_lock(); 33 ascodec_lock();
34 34
35 /* Select channel */ 35 /* Select channel */
36 if (pp_i2c_send( AS3514_I2C_ADDR, AS3514_ADC_0, (channel << 4)) >= 0) 36 if (ascodec_write(AS3514_ADC_0, (channel << 4)) >= 0)
37 { 37 {
38 unsigned char buf[2]; 38 unsigned char buf[2];
39 39
40 /* Read data */ 40 /* Read data */
41 if (i2c_readbytes( AS3514_I2C_ADDR, AS3514_ADC_0, 2, buf) >= 0) 41 if (ascodec_readbytes(AS3514_ADC_0, 2, buf) >= 0)
42 { 42 {
43 data = (((buf[0] & 0x3) << 8) | buf[1]); 43 data = (((buf[0] & 0x3) << 8) | buf[1]);
44 } 44 }
45 } 45 }
46 46
47 i2c_unlock(); 47 ascodec_unlock();
48 } 48 }
49 49
50 return data; 50 return data;