aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers/device/i2c.h
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-01-14 00:18:05 -0800
committerpx4dev <px4@purgatory.org>2013-01-14 00:18:05 -0800
commit6e291ddedc8b2d7bfeae8029a37df0b581262796 (patch)
tree0b28019942cd153efd710799be0528783f70bc70 /apps/drivers/device/i2c.h
parent4e38615595abd9d27d0cb000caafb98cc3670abe (diff)
downloadpx4-firmware-6e291ddedc8b2d7bfeae8029a37df0b581262796.tar.gz
px4-firmware-6e291ddedc8b2d7bfeae8029a37df0b581262796.tar.bz2
px4-firmware-6e291ddedc8b2d7bfeae8029a37df0b581262796.zip
Add a mechanism for sending multi-part messages to the I2C driver base class.
Diffstat (limited to 'apps/drivers/device/i2c.h')
-rw-r--r--apps/drivers/device/i2c.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/drivers/device/i2c.h b/apps/drivers/device/i2c.h
index 4d630b8a8..66c34dd7c 100644
--- a/apps/drivers/device/i2c.h
+++ b/apps/drivers/device/i2c.h
@@ -101,6 +101,16 @@ protected:
uint8_t *recv, unsigned recv_len);
/**
+ * Perform a multi-part I2C transaction to the device.
+ *
+ * @param msgv An I2C message vector.
+ * @param msgs The number of entries in the message vector.
+ * @return OK if the transfer was successful, -errno
+ * otherwise.
+ */
+ int transfer(i2c_msg_s *msgv, unsigned msgs);
+
+ /**
* Change the bus address.
*
* Most often useful during probe() when the driver is testing