Ultra low-power, high performance 3-axis magnetometer.

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Dependents:   HelloWorld_ST_Sensors MOTENV_Mbed mbed-os-mqtt-client DISCO-IOT01_HomeEnv ... more

Revision:
2:b3212ad3c306
Parent:
0:7376fbeb1d4a
Child:
3:a35a16f3da39
--- a/lis3mdl_class.h	Thu Sep 07 12:27:45 2017 +0000
+++ b/lis3mdl_class.h	Wed Sep 27 16:49:10 2017 +0200
@@ -52,7 +52,7 @@
 	/** Constructor
 	 * @param[in] i2c device I2C to be used for communication
 	 */
-        LIS3MDL(DevI2C &i2c) : MagneticSensor(), dev_i2c(i2c) {
+        LIS3MDL(DevI2C *i2c) : MagneticSensor(), dev_i2c(i2c) {
 	}
 	
 	/** Destructor
@@ -111,7 +111,7 @@
 	MAGNETO_StatusTypeDef LIS3MDL_IO_Read(uint8_t* pBuffer, 
 					      uint8_t RegisterAddr, uint16_t NumByteToRead)
 	{
-		int ret = dev_i2c.i2c_read(pBuffer,
+		int ret = dev_i2c->i2c_read(pBuffer,
 					   LIS3MDL_M_MEMS_ADDRESS,
 					   RegisterAddr,
 					   NumByteToRead);
@@ -132,7 +132,7 @@
 	MAGNETO_StatusTypeDef LIS3MDL_IO_Write(uint8_t* pBuffer, 
 					       uint8_t RegisterAddr, uint16_t NumByteToWrite)
 	{
-		int ret = dev_i2c.i2c_write(pBuffer,
+		int ret = dev_i2c->i2c_write(pBuffer,
 					    LIS3MDL_M_MEMS_ADDRESS,
 					    RegisterAddr,
 					    NumByteToWrite);
@@ -144,7 +144,7 @@
 	
 	/*** Instance Variables ***/
 	/* IO Device */
-	DevI2C &dev_i2c;
+	DevI2C *dev_i2c;
 };
 
 #endif // __LIS3MDL_CLASS_H