summaryrefslogtreecommitdiff
path: root/include/i2c.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-02-13 14:45:29 -0800
committerBill Richardson <wfrichar@chromium.org>2012-02-13 16:16:10 -0800
commite5b17f90474f2946cb29aa5828c2642fbfffdfa8 (patch)
tree3924e8929475337e3e7b062c1a7be4835df5c252 /include/i2c.h
parent616c60e70727726f5395cf6730010f4b1a9b6ab5 (diff)
downloadchrome-ec-e5b17f90474f2946cb29aa5828c2642fbfffdfa8.tar.gz
Add 8-bit I2C read/write functions.
These provide 8-bit accesses to registers within an I2C device. BUG=chrome-os-partner:7839 TEST=none Testing will come when I start using them. Change-Id: Ib53d3347253bccee93cb9c5da12db92970155d92 Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/i2c.h')
-rw-r--r--include/i2c.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h
index 34076b1f34..c3301e530d 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -26,4 +26,14 @@ int i2c_read16(int port, int slave_addr, int offset, int* data);
* space. */
int i2c_write16(int port, int slave_addr, int offset, int data);
+/* Reads an 8-bit register from the slave at 8-bit slave address
+ * <slaveaddr>, at the specified 8-bit <offset> in the slave's address
+ * space. */
+int i2c_read8(int port, int slave_addr, int offset, int* data);
+
+/* Writes an 8-bit register to the slave at 8-bit slave address
+ * <slaveaddr>, at the specified 8-bit <offset> in the slave's address
+ * space. */
+int i2c_write8(int port, int slave_addr, int offset, int data);
+
#endif /* __CROS_EC_I2C_H */