add global proxy / cache settings to httpget class. This removes the need of passing...
[Rockbox.git] / firmware / export / i2c-pp.h
blobe789c72d84afa55b30b2374a2ef653c22a739c1f
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * PP502X and PP5002 I2C driver
12 * Based on code from the ipodlinux project - http://ipodlinux.org/
13 * Adapted for Rockbox in November 2005
15 * Original file: linux/arch/armnommu/mach-ipod/hardware.c
17 * Copyright (c) 2003-2005 Bernard Leach (leachbj@bouncycastle.org)
19 * All files in this archive are subject to the GNU General Public License.
20 * See the file COPYING in the source tree root for full license agreement.
22 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
23 * KIND, either express or implied.
25 ****************************************************************************/
28 * PortalPlayer i2c driver
32 #ifndef _I2C_PP_H
33 #define _I2C_PP_H
35 #define I2C_CTRL (*(volatile unsigned char*)(I2C_BASE+0x00))
36 #define I2C_ADDR (*(volatile unsigned char*)(I2C_BASE+0x04))
37 #define I2C_DATA(X) (*(volatile unsigned char*)(I2C_BASE+0xc+(4*X)))
38 #define I2C_STATUS (*(volatile unsigned char*)(I2C_BASE+0x1c))
40 /* I2C_CTRL bit definitions */
41 #define I2C_SEND 0x80
43 /* I2C_STATUS bit definitions */
44 #define I2C_BUSY (1<<6)
46 /* TODO: Fully implement i2c driver */
48 /* To be used by drivers that need to do multiple i2c operations
49 atomically */
50 void i2c_lock(void);
51 void i2c_unlock(void);
53 void i2c_init(void);
54 int i2c_readbyte(unsigned int dev_addr, int addr);
55 int pp_i2c_send(unsigned int addr, int data0, int data1);
56 int i2c_readbytes(unsigned int dev_addr, int addr, int len, unsigned char *data);
58 #endif