nanohub: driver/st_mag40: Add macro to enable the I2C auto-increment feature

This commit introduces a macro to make evident that the I2C subaddress
auto-increment feature gets enabled. This feature is needed to allow the host
to access I2C bus in a more efficient way (i.e. with multiple byte ops).

Change-Id: Iad9ed0d1ac79765ba500ed195294b98787ead355
Signed-off-by: Armando Visconti <armando.visconti@st.com>
diff --git a/firmware/os/drivers/st_mag40/st_mag40.c b/firmware/os/drivers/st_mag40/st_mag40.c
index 3e9ccae..ee8e8fa 100644
--- a/firmware/os/drivers/st_mag40/st_mag40.c
+++ b/firmware/os/drivers/st_mag40/st_mag40.c
@@ -65,6 +65,9 @@
 
 #define ST_MAG40_OUTXL_REG_ADDR    0x68
 
+/* Enable auto-increment of the I2C subaddress (to allow I2C multiple ops) */
+#define ST_MAG40_I2C_AUTO_INCR     0x80
+
 enum st_mag40_SensorEvents
 {
     EVT_COMM_DONE = EVT_APP_START + 1,
@@ -372,7 +375,7 @@
     if (xfer != NULL) {
         xfer->delay = delay;
         xfer->last = last;
-        xfer->txrxBuf[0] = 0x80 | addr;
+        xfer->txrxBuf[0] = ST_MAG40_I2C_AUTO_INCR | addr;
         i2cMasterTxRx(ST_MAG40_I2C_BUS_ID, ST_MAG40_I2C_ADDR, xfer->txrxBuf, 1, xfer->txrxBuf, len, i2cCallback, xfer);
     }
 }