summaryrefslogtreecommitdiff
path: root/firmware/export/i2c-pp5020.h
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-12-11 10:52:17 +0000
committerDave Chapman <dave@dchapman.com>2005-12-11 10:52:17 +0000
commite066a20b6722fc7a2948e92751a6709706f43525 (patch)
tree036e35bb632ac5608be7791c6702d2fa1a07715a /firmware/export/i2c-pp5020.h
parent060320b95c99d91fd2e72cc1c3aabbad8d99127d (diff)
iPod: Cleanup of i2c code and addition of RTC driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8219 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/i2c-pp5020.h')
-rw-r--r--firmware/export/i2c-pp5020.h43
1 files changed, 6 insertions, 37 deletions
diff --git a/firmware/export/i2c-pp5020.h b/firmware/export/i2c-pp5020.h
index 8487c678cf..c0dc969e8b 100644
--- a/firmware/export/i2c-pp5020.h
+++ b/firmware/export/i2c-pp5020.h
@@ -18,48 +18,17 @@
****************************************************************************/
/*
- * Driver for ARM i2c driver
- *
+ * PP5020 i2c driver
*
*/
-#ifndef _I2C_ARM_H
-#define _I2C_ARM_H
+#ifndef _I2C_PP5020_H
+#define _I2C_PP5020_H
-/* TODO: Implement: i2c-pp5020.h */
+/* TODO: Fully implement i2c driver */
void i2c_init(void);
-int i2c_write(int device, unsigned char *buf, int count);
-void i2c_close(void);
-
-#define MAX_LOOP 0x100 /* TODO: select a better value */
-
-/* PLLCR control */
-#define QSPISEL (1 << 11) /* Selects QSPI or I2C interface */
-
-/* Offsets to I2C registers from base address */
-#define O_MADR 0x00 /* Slave Address */
-#define O_MFDR 0x04 /* Frequency divider */
-#define O_MBCR 0x08 /* Control register */
-#define O_MBSR 0x0c /* Status register */
-#define O_MBDR 0x10 /* Data register */
-
-/* MBSR - Status register */
-#define ICF (1 << 7) /* Transfer Complete */
-#define IAAS (1 << 6) /* Addressed As Alave */
-#define IBB (1 << 5) /* Bus Busy */
-#define IAL (1 << 4) /* Arbitration Lost */
-#define SRW (1 << 2) /* Slave R/W */
-#define IFF (1 << 1) /* I2C Interrupt */
-#define RXAK (1 << 0) /* No Ack bit */
-
-/* MBCR - Control register */
-#define IEN (1 << 7) /* I2C Enable */
-#define IIEN (1 << 6) /* Interrupt Enable */
-#define MSTA (1 << 5) /* Master/Slave select */
-#define MTX (1 << 4) /* Transmit/Receive */
-#define TXAK (1 << 3) /* Transfer ACK */
-#define RSTA (1 << 2) /* Restart.. */
-
+int i2c_readbyte(unsigned int dev_addr, int addr);
+int ipod_i2c_send(unsigned int addr, int data0, int data1);
#endif