Private
Public Access
2
0

i2c: fix I2c::read() call

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-11-20 14:10:56 +00:00
parent 19d7dad364
commit 75be9992fd
2 changed files with 3 additions and 3 deletions

View File

@@ -116,7 +116,7 @@ main(int argc, char **argv)
// chosen register
mraa_i2c_address(i2c, HMC5883L_I2C_ADDR);
// this call behaves very similarly to the Wire receive() call
mraa_i2c_read(i2c, rx_tx_buf, HMC5883L_DATA_REG, DATA_REG_SIZE);
mraa_i2c_read(i2c, rx_tx_buf, DATA_REG_SIZE);
x = (rx_tx_buf[HMC5883L_X_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_X_LSB_REG] ;
z = (rx_tx_buf[HMC5883L_Z_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_Z_LSB_REG] ;