From 5e765b2ea2962b86c460a67968d4977f3aa55ca3 Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Sat, 27 Jan 2007 14:22:24 +0000 Subject: Clean up PP5020 I2C code (no functional changes): Move into target tree. Use #defines instead of inb/outb. Whitespace cleanup. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12123 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/i2c-pp5020.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'firmware/export/i2c-pp5020.h') diff --git a/firmware/export/i2c-pp5020.h b/firmware/export/i2c-pp5020.h index b8b10d6388..c52d07d24f 100644 --- a/firmware/export/i2c-pp5020.h +++ b/firmware/export/i2c-pp5020.h @@ -25,6 +25,17 @@ #ifndef _I2C_PP5020_H #define _I2C_PP5020_H +#define I2C_CTRL (*(volatile unsigned char*)(I2C_BASE+0x00)) +#define I2C_ADDR (*(volatile unsigned char*)(I2C_BASE+0x04)) +#define I2C_DATA(X) (*(volatile unsigned char*)(I2C_BASE+0xc+(4*X))) +#define I2C_STATUS (*(volatile unsigned char*)(I2C_BASE+0x1c)) + +/* I2C_CTRL bit definitions */ +#define I2C_SEND 0x80 + +/* I2C_STATUS bit definitions */ +#define I2C_BUSY (1<<6) + /* TODO: Fully implement i2c driver */ void i2c_init(void); -- cgit v1.2.3