Document byte order of I2CInterface read/write
Update the doxygen comments for the following two I2CInterface methods:
* void read(uint8_t addr, uint16_t& data);
* void write(uint8_t addr, uint16_t data);
Document that the two bytes are transmitted with the low order byte
first.
The I2CInterface methods call the following two i2c-dev functions:
* i2c_smbus_read_word_data()
* i2c_smbus_write_word_data()
The SMBus Read Word and Write Word protocols require the low order byte
to be sent first.
Testing:
* Tested on Witherspoon using i2cget and i2cset. These command line
tools call the same two i2c-dev functions. Verified that the low
order byte is read/written first.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I83ba69f8cde08ee719d34802afed691a61fe3e84
diff --git a/tools/i2c/i2c_interface.hpp b/tools/i2c/i2c_interface.hpp
index eaaf9f1..10ee00a 100644
--- a/tools/i2c/i2c_interface.hpp
+++ b/tools/i2c/i2c_interface.hpp
@@ -111,6 +111,9 @@
/** @brief Read word data from i2c
*
+ * Uses the SMBus Read Word protocol. Reads two bytes from the device, and
+ * the first byte read is the low-order byte.
+ *
* @param[in] addr - The register address of the i2c device
* @param[out] data - The data read from the i2c device
*
@@ -157,6 +160,9 @@
/** @brief Write word data to i2c
*
+ * Uses the SMBus Write Word protocol. Writes two bytes to the device, and
+ * the first byte written is the low-order byte.
+ *
* @param[in] addr - The register address of the i2c device
* @param[in] data - The data to write to the i2c device
*