Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MAX32630HSP3_IMU_HelloWorld MAX32630HSP3_IMU_HelloWorld max32630fthr max4146x_comp ... more
Fork of MAX14690 by
Revision 15:264f38840873, committed 2017-10-16
- Comitter:
- switches
- Date:
- Mon Oct 16 19:41:16 2017 +0000
- Parent:
- 14:cbd2a00ff28f
- Commit message:
- Changed I2C to pointer
Changed in this revision
| MAX14690.cpp | Show annotated file Show diff for this revision Revisions of this file |
| MAX14690.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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;
}
--- a/MAX14690.h Tue Jul 11 18:27:54 2017 +0000
+++ b/MAX14690.h Mon Oct 16 19:41:16 2017 +0000
@@ -352,7 +352,7 @@
*
* @param i2c I2C object to use.
*/
- MAX14690(I2C &i2c);
+ MAX14690(I2C *i2c);
/**
* MAX14690 destructor.
@@ -552,7 +552,7 @@
private:
// Internal Resources
- I2C &_i2c;
+ I2C *_i2c;
/**
* @brief Converts mV to register bits
