MAX14690 Library

Dependents:   MAX32630HSP3_IMU_HelloWorld MAX32630HSP3_IMU_HelloWorld max32630fthr max4146x_comp ... more

Fork of MAX14690 by Greg Steiert

Revision:
15:264f38840873
Parent:
13:666b6c505289
--- a/MAX14690.cpp	Tue Jul 11 18:27:54 2017 +0000
+++ b/MAX14690.cpp	Mon Oct 16 19:41:16 2017 +0000
@@ -34,7 +34,7 @@
 #include "MAX14690.h"
 
 //******************************************************************************
-MAX14690::MAX14690(I2C &i2c): _i2c(i2c)
+MAX14690::MAX14690(I2C *i2c): _i2c(i2c)
 {
     resetToDefaults();
 }
@@ -310,7 +310,7 @@
 {
     char cmdData[2] = { (char)reg, value };
 
-    if (_i2c.write(MAX14690_I2C_ADDR, cmdData, sizeof(cmdData)) != 0) {
+    if ((*_i2c).write(MAX14690_I2C_ADDR, cmdData, sizeof(cmdData)) != 0) {
         return MAX14690_ERROR;
     }
 
@@ -322,11 +322,11 @@
 {
     char cmdData[1] = { (char)reg };
 
-    if (_i2c.write(MAX14690_I2C_ADDR, cmdData, sizeof(cmdData)) != 0) {
+    if ((*_i2c).write(MAX14690_I2C_ADDR, cmdData, sizeof(cmdData)) != 0) {
         return MAX14690_ERROR;
     }
 
-    if (_i2c.read(MAX14690_I2C_ADDR, value, 1) != 0) {
+    if ((*_i2c).read(MAX14690_I2C_ADDR, value, 1) != 0) {
         return MAX14690_ERROR;
     }