summaryrefslogtreecommitdiff
path: root/firmware/export/i2c-pp.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/i2c-pp.h')
-rw-r--r--firmware/export/i2c-pp.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/firmware/export/i2c-pp.h b/firmware/export/i2c-pp.h
new file mode 100644
index 0000000000..1dc5bc358a
--- /dev/null
+++ b/firmware/export/i2c-pp.h
@@ -0,0 +1,46 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20/*
21 * PortalPlayer i2c driver
22 *
23 */
24
25#ifndef _I2C_PP_H
26#define _I2C_PP_H
27
28#define I2C_CTRL (*(volatile unsigned char*)(I2C_BASE+0x00))
29#define I2C_ADDR (*(volatile unsigned char*)(I2C_BASE+0x04))
30#define I2C_DATA(X) (*(volatile unsigned char*)(I2C_BASE+0xc+(4*X)))
31#define I2C_STATUS (*(volatile unsigned char*)(I2C_BASE+0x1c))
32
33/* I2C_CTRL bit definitions */
34#define I2C_SEND 0x80
35
36/* I2C_STATUS bit definitions */
37#define I2C_BUSY (1<<6)
38
39/* TODO: Fully implement i2c driver */
40
41void i2c_init(void);
42int i2c_readbyte(unsigned int dev_addr, int addr);
43int pp_i2c_send(unsigned int addr, int data0, int data1);
44int i2c_readbytes(unsigned int dev_addr, int addr, int len, unsigned char *data);
45
46#endif