summaryrefslogtreecommitdiff
path: root/include/i2c.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2016-10-04 13:54:48 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-05 20:58:17 -0700
commitc0c66cdd12c79fc0d11a505b12b25fc8c1860dfd (patch)
treedf1037f794409bc162c7a075f37521017f2eec19 /include/i2c.h
parent9b57c61ff7525b2ec6e0ca855663319d7e480889 (diff)
downloadchrome-ec-c0c66cdd12c79fc0d11a505b12b25fc8c1860dfd.tar.gz
stm32l4: Add i2c driver
This patch adds master and slave drivers for stm32l4 family. Only slave functionality is tested. BUG=none BRANCH=none TEST=Run cts.py -m i2c. Make buildall. Change-Id: Ied77081ca0333ab3fec055cd4f0fcbdf8a79d388 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/393329 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/i2c.h')
-rw-r--r--include/i2c.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h
index 3af738201b..ddb0508828 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -301,4 +301,21 @@ int i2c_port_to_controller(int port);
*/
int i2c_get_protocol_info(struct host_cmd_handler_args *args);
+/**
+ * Callbacks processing received data and response
+ *
+ * i2c_data_recived will be called when a slave finishes receiving data and
+ * i2c_set_response will be called when a slave is expected to send response.
+ *
+ * Using these, Chrome OS host command protocol should be separated from
+ * i2c slave drivers (e.g. i2c-stm32f0.c, i2c-stm32f3.c).
+ *
+ * @param port: I2C port number
+ * @param buf: Buffer containing received data on call and response on return
+ * @param len: Size of received data
+ * @return Size of response data
+ */
+void i2c_data_received(int port, uint8_t *buf, int len);
+int i2c_set_response(int port, uint8_t *buf, int len);
+
#endif /* __CROS_EC_I2C_H */