A feature complete driver for the MAX17048 lithium fuel gauge from Maxim.

Dependents:   MAX17048_HelloWorld ECGAFE_copy MAX17048_HelloWorld Orion_newPCB_test_LV ... more

Now fully tested!

Committer:
neilt6
Date:
Tue Nov 12 17:48:11 2013 +0000
Revision:
7:bf6972a21c61
Parent:
5:ffce4fe12ed1
Child:
8:65c889800b3a
open() no longer loads the default compensation value

Who changed what in which revision?

UserRevisionLine numberNew contents of line
neilt6 0:abc480f8eeab 1 /* MAX17048 Driver Library
neilt6 0:abc480f8eeab 2 * Copyright (c) 2013 Neil Thiessen
neilt6 0:abc480f8eeab 3 *
neilt6 0:abc480f8eeab 4 * Licensed under the Apache License, Version 2.0 (the "License");
neilt6 0:abc480f8eeab 5 * you may not use this file except in compliance with the License.
neilt6 0:abc480f8eeab 6 * You may obtain a copy of the License at
neilt6 0:abc480f8eeab 7 *
neilt6 0:abc480f8eeab 8 * http://www.apache.org/licenses/LICENSE-2.0
neilt6 0:abc480f8eeab 9 *
neilt6 0:abc480f8eeab 10 * Unless required by applicable law or agreed to in writing, software
neilt6 0:abc480f8eeab 11 * distributed under the License is distributed on an "AS IS" BASIS,
neilt6 0:abc480f8eeab 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
neilt6 0:abc480f8eeab 13 * See the License for the specific language governing permissions and
neilt6 0:abc480f8eeab 14 * limitations under the License.
neilt6 0:abc480f8eeab 15 */
neilt6 0:abc480f8eeab 16
neilt6 0:abc480f8eeab 17 #ifndef MAX17048_H
neilt6 0:abc480f8eeab 18 #define MAX17048_H
neilt6 0:abc480f8eeab 19
neilt6 0:abc480f8eeab 20 #include "mbed.h"
neilt6 0:abc480f8eeab 21
neilt6 0:abc480f8eeab 22 /** MAX17048 class.
neilt6 0:abc480f8eeab 23 * Used for controlling a MAX17048 fuel gauge connected via I2C.
neilt6 0:abc480f8eeab 24 *
neilt6 0:abc480f8eeab 25 * Example:
neilt6 0:abc480f8eeab 26 * @code
neilt6 0:abc480f8eeab 27 * #include "mbed.h"
neilt6 0:abc480f8eeab 28 * #include "MAX17048.h"
neilt6 0:abc480f8eeab 29 *
neilt6 0:abc480f8eeab 30 * MAX17048 gauge(p28, p27);
neilt6 0:abc480f8eeab 31 *
neilt6 3:32087cca331f 32 * int main()
neilt6 3:32087cca331f 33 * {
neilt6 3:32087cca331f 34 * //Try to open the MAX17048
neilt6 3:32087cca331f 35 * if (gauge.open()) {
neilt6 3:32087cca331f 36 * printf("Device detected!\n");
neilt6 0:abc480f8eeab 37 *
neilt6 7:bf6972a21c61 38 * //Load the default compensation value
neilt6 7:bf6972a21c61 39 * gauge.compensation(MAX17048::RCOMP0);
neilt6 7:bf6972a21c61 40 *
neilt6 3:32087cca331f 41 * while (1) {
neilt6 4:e61b2723d2cf 42 * //Print the current state of charge
neilt6 4:e61b2723d2cf 43 * printf("SOC = %f%%\n", (float)gauge);
neilt6 3:32087cca331f 44 *
neilt6 3:32087cca331f 45 * //Sleep for 0.5 seconds
neilt6 3:32087cca331f 46 * wait(0.5);
neilt6 3:32087cca331f 47 * }
neilt6 3:32087cca331f 48 * } else {
neilt6 4:e61b2723d2cf 49 * error("Device not detected!\n");
neilt6 0:abc480f8eeab 50 * }
neilt6 0:abc480f8eeab 51 * }
neilt6 0:abc480f8eeab 52 * @endcode
neilt6 0:abc480f8eeab 53 */
neilt6 0:abc480f8eeab 54 class MAX17048
neilt6 0:abc480f8eeab 55 {
neilt6 0:abc480f8eeab 56 public:
neilt6 7:bf6972a21c61 57 /** The default compensation value for the MAX17048
neilt6 7:bf6972a21c61 58 */
neilt6 7:bf6972a21c61 59 static const int RCOMP0 = 0x97;
neilt6 7:bf6972a21c61 60
neilt6 0:abc480f8eeab 61 /** Represents the different alert flags for the MAX17048
neilt6 0:abc480f8eeab 62 */
neilt6 0:abc480f8eeab 63 enum AlertFlags {
neilt6 0:abc480f8eeab 64 ALERT_RI = (1 << 0), /**< Reset indicator */
neilt6 0:abc480f8eeab 65 ALERT_VH = (1 << 1), /**< Voltage high alert */
neilt6 0:abc480f8eeab 66 ALERT_VL = (1 << 2), /**< Voltage low alert */
neilt6 0:abc480f8eeab 67 ALERT_VR = (1 << 3), /**< Voltage reset alert */
neilt6 0:abc480f8eeab 68 ALERT_HD = (1 << 4), /**< SOC low alert */
neilt6 0:abc480f8eeab 69 ALERT_SC = (1 << 5) /**< SOC change alert */
neilt6 0:abc480f8eeab 70 };
neilt6 0:abc480f8eeab 71
neilt6 0:abc480f8eeab 72 /** Create a MAX17048 object connected to the specified I2C pins
neilt6 0:abc480f8eeab 73 *
neilt6 1:734b1a089a9c 74 * @param sda The I2C data pin.
neilt6 1:734b1a089a9c 75 * @param scl The I2C clock pin.
neilt6 0:abc480f8eeab 76 */
neilt6 0:abc480f8eeab 77 MAX17048(PinName sda, PinName scl);
neilt6 0:abc480f8eeab 78
neilt6 7:bf6972a21c61 79 /** Probe for the MAX17048 and indicate if it's present on the bus
neilt6 3:32087cca331f 80 *
neilt6 3:32087cca331f 81 * @returns
neilt6 3:32087cca331f 82 * 'true' if the device exists on the bus,
neilt6 3:32087cca331f 83 * 'false' if the device doesn't exist on the bus.
neilt6 3:32087cca331f 84 */
neilt6 5:ffce4fe12ed1 85 bool open();
neilt6 3:32087cca331f 86
neilt6 0:abc480f8eeab 87 /** Command the MAX17048 to perform a power-on reset
neilt6 0:abc480f8eeab 88 */
neilt6 5:ffce4fe12ed1 89 void reset();
neilt6 0:abc480f8eeab 90
neilt6 0:abc480f8eeab 91 /** Command the MAX17048 to perform a QuickStart
neilt6 0:abc480f8eeab 92 */
neilt6 5:ffce4fe12ed1 93 void quickStart();
neilt6 0:abc480f8eeab 94
neilt6 0:abc480f8eeab 95 /** Determine whether sleep mode is enabled on the MAX17048
neilt6 0:abc480f8eeab 96 *
neilt6 0:abc480f8eeab 97 * @returns
neilt6 0:abc480f8eeab 98 * 'true' if sleep mode is enabled,
neilt6 0:abc480f8eeab 99 * 'false' if sleep mode is disabled.
neilt6 0:abc480f8eeab 100 */
neilt6 5:ffce4fe12ed1 101 bool sleepEnabled();
neilt6 0:abc480f8eeab 102
neilt6 0:abc480f8eeab 103 /** Enable or disable sleep mode on the MAX17048
neilt6 0:abc480f8eeab 104 *
neilt6 0:abc480f8eeab 105 * @param enabled Whether or not sleep mode is enabled.
neilt6 0:abc480f8eeab 106 */
neilt6 2:0a98e081b48c 107 void sleepEnabled(bool enabled);
neilt6 2:0a98e081b48c 108
neilt6 0:abc480f8eeab 109 /** Determine whether or not the MAX17048 is hibernating
neilt6 0:abc480f8eeab 110 *
neilt6 0:abc480f8eeab 111 * @returns
neilt6 0:abc480f8eeab 112 * 'true' if hibernating,
neilt6 0:abc480f8eeab 113 * 'false' if not hibernating.
neilt6 0:abc480f8eeab 114 */
neilt6 5:ffce4fe12ed1 115 bool hibernating();
neilt6 2:0a98e081b48c 116
neilt6 0:abc480f8eeab 117 /** Get the current hibernate threshold of the MAX17048
neilt6 0:abc480f8eeab 118 *
neilt6 0:abc480f8eeab 119 * @returns The current hibernate threshold in \%/hr.
neilt6 0:abc480f8eeab 120 */
neilt6 5:ffce4fe12ed1 121 float hibernateThreshold();
neilt6 2:0a98e081b48c 122
neilt6 0:abc480f8eeab 123 /** Set the hibernate threshold of the MAX17048
neilt6 0:abc480f8eeab 124 *
neilt6 0:abc480f8eeab 125 * @param threshold The new hibernate threshold in \%/hr.
neilt6 0:abc480f8eeab 126 */
neilt6 2:0a98e081b48c 127 void hibernateThreshold(float threshold);
neilt6 2:0a98e081b48c 128
neilt6 0:abc480f8eeab 129 /** Get the current active threshold of the MAX17048
neilt6 0:abc480f8eeab 130 *
neilt6 0:abc480f8eeab 131 * @returns The current active threshold in volts.
neilt6 0:abc480f8eeab 132 */
neilt6 5:ffce4fe12ed1 133 float activeThreshold();
neilt6 2:0a98e081b48c 134
neilt6 0:abc480f8eeab 135 /** Set the active threshold of the MAX17048
neilt6 0:abc480f8eeab 136 *
neilt6 0:abc480f8eeab 137 * @param threshold The new active threshold in volts.
neilt6 0:abc480f8eeab 138 */
neilt6 2:0a98e081b48c 139 void activeThreshold(float threshold);
neilt6 2:0a98e081b48c 140
neilt6 0:abc480f8eeab 141 /** Get the production version of the MAX17048
neilt6 0:abc480f8eeab 142 *
neilt6 0:abc480f8eeab 143 * @returns The 16-bit production version.
neilt6 0:abc480f8eeab 144 */
neilt6 5:ffce4fe12ed1 145 unsigned short version();
neilt6 2:0a98e081b48c 146
neilt6 7:bf6972a21c61 147 /** Get the current compensation value of the MAX17048
neilt6 7:bf6972a21c61 148 *
neilt6 7:bf6972a21c61 149 * @returns The current compensation value as an unsigned char (0 to 255).
neilt6 7:bf6972a21c61 150 */
neilt6 7:bf6972a21c61 151 char compensation();
neilt6 7:bf6972a21c61 152
neilt6 7:bf6972a21c61 153 /** Set the compensation value of the MAX17048
neilt6 7:bf6972a21c61 154 *
neilt6 7:bf6972a21c61 155 * @param rcomp The new compensation value as an unsigned char (0 to 255).
neilt6 7:bf6972a21c61 156 */
neilt6 7:bf6972a21c61 157 void compensation(char rcomp);
neilt6 7:bf6972a21c61 158
neilt6 7:bf6972a21c61 159 /** Set the compensation value of the MAX17048 from the current cell temperature
neilt6 0:abc480f8eeab 160 *
neilt6 0:abc480f8eeab 161 * @param temp The current cell temperature in °C.
neilt6 0:abc480f8eeab 162 */
neilt6 2:0a98e081b48c 163 void tempCompensation(float temp);
neilt6 2:0a98e081b48c 164
neilt6 0:abc480f8eeab 165 /** Determine whether or not the MAX17048 is in sleep mode
neilt6 0:abc480f8eeab 166 *
neilt6 0:abc480f8eeab 167 * @returns
neilt6 0:abc480f8eeab 168 * 'true' if in sleep mode,
neilt6 0:abc480f8eeab 169 * 'false' if not in sleep mode.
neilt6 0:abc480f8eeab 170 */
neilt6 5:ffce4fe12ed1 171 bool sleeping();
neilt6 2:0a98e081b48c 172
neilt6 0:abc480f8eeab 173 /** Enter or exit sleep mode on the MAX17048 (sleep mode must be enabled first)
neilt6 0:abc480f8eeab 174 *
neilt6 0:abc480f8eeab 175 * @param sleep Whether or not to sleep.
neilt6 0:abc480f8eeab 176 */
neilt6 2:0a98e081b48c 177 void sleep(bool sleep);
neilt6 2:0a98e081b48c 178
neilt6 0:abc480f8eeab 179 /** Determine whether or not the SOC 1% change alert is enabled on the MAX17048
neilt6 0:abc480f8eeab 180 *
neilt6 0:abc480f8eeab 181 * @returns
neilt6 0:abc480f8eeab 182 * 'true' if enabled,
neilt6 0:abc480f8eeab 183 * 'false' if not enabled.
neilt6 0:abc480f8eeab 184 */
neilt6 5:ffce4fe12ed1 185 bool socChangeAlertEnabled();
neilt6 2:0a98e081b48c 186
neilt6 0:abc480f8eeab 187 /** Enable or disable the SOC 1% change alert on the MAX17048
neilt6 0:abc480f8eeab 188 *
neilt6 0:abc480f8eeab 189 * @param enabled Whether or the SOC 1% change alert is enabled.
neilt6 0:abc480f8eeab 190 */
neilt6 2:0a98e081b48c 191 void socChangeAlertEnabled(bool enabled);
neilt6 2:0a98e081b48c 192
neilt6 0:abc480f8eeab 193 /** Determine whether or not the MAX17048 is asserting the ALRT pin
neilt6 0:abc480f8eeab 194 *
neilt6 0:abc480f8eeab 195 * @returns
neilt6 0:abc480f8eeab 196 * 'true' if alerting,
neilt6 0:abc480f8eeab 197 * 'false' if not alerting.
neilt6 0:abc480f8eeab 198 */
neilt6 5:ffce4fe12ed1 199 bool alerting();
neilt6 2:0a98e081b48c 200
neilt6 0:abc480f8eeab 201 /** Command the MAX17048 to de-assert the ALRT pin
neilt6 0:abc480f8eeab 202 */
neilt6 5:ffce4fe12ed1 203 void clearAlert();
neilt6 2:0a98e081b48c 204
neilt6 0:abc480f8eeab 205 /** Get the current SOC empty alert threshold of the MAX17048
neilt6 0:abc480f8eeab 206 *
neilt6 0:abc480f8eeab 207 * @returns The current SOC empty alert threshold in %.
neilt6 0:abc480f8eeab 208 */
neilt6 5:ffce4fe12ed1 209 char emptyAlertThreshold();
neilt6 2:0a98e081b48c 210
neilt6 0:abc480f8eeab 211 /** Set the SOC empty alert threshold of the MAX17048
neilt6 0:abc480f8eeab 212 *
neilt6 0:abc480f8eeab 213 * @param threshold The new SOC empty alert threshold in %.
neilt6 0:abc480f8eeab 214 */
neilt6 2:0a98e081b48c 215 void emptyAlertThreshold(char threshold);
neilt6 2:0a98e081b48c 216
neilt6 0:abc480f8eeab 217 /** Get the current low voltage alert threshold of the MAX17048
neilt6 0:abc480f8eeab 218 *
neilt6 0:abc480f8eeab 219 * @returns The current low voltage alert threshold in volts.
neilt6 0:abc480f8eeab 220 */
neilt6 5:ffce4fe12ed1 221 float vAlertMinThreshold();
neilt6 2:0a98e081b48c 222
neilt6 0:abc480f8eeab 223 /** Set the low voltage alert threshold of the MAX17048
neilt6 0:abc480f8eeab 224 *
neilt6 0:abc480f8eeab 225 * @param threshold The new low voltage alert threshold in volts.
neilt6 0:abc480f8eeab 226 */
neilt6 2:0a98e081b48c 227 void vAlertMinThreshold(float threshold);
neilt6 2:0a98e081b48c 228
neilt6 0:abc480f8eeab 229 /** Get the current high voltage alert threshold of the MAX17048
neilt6 0:abc480f8eeab 230 *
neilt6 0:abc480f8eeab 231 * @returns The current high voltage alert threshold in volts.
neilt6 0:abc480f8eeab 232 */
neilt6 5:ffce4fe12ed1 233 float vAlertMaxThreshold();
neilt6 2:0a98e081b48c 234
neilt6 0:abc480f8eeab 235 /** Set the high voltage alert threshold of the MAX17048
neilt6 0:abc480f8eeab 236 *
neilt6 0:abc480f8eeab 237 * @param threshold The new high voltage alert threshold in volts.
neilt6 0:abc480f8eeab 238 */
neilt6 2:0a98e081b48c 239 void vAlertMaxThreshold(float threshold);
neilt6 2:0a98e081b48c 240
neilt6 0:abc480f8eeab 241 /** Get the current reset voltage threshold of the MAX17048
neilt6 0:abc480f8eeab 242 *
neilt6 0:abc480f8eeab 243 * @returns The current reset voltage threshold in volts.
neilt6 0:abc480f8eeab 244 */
neilt6 5:ffce4fe12ed1 245 float vResetThreshold();
neilt6 2:0a98e081b48c 246
neilt6 0:abc480f8eeab 247 /** Set the reset voltage threshold of the MAX17048
neilt6 0:abc480f8eeab 248 *
neilt6 0:abc480f8eeab 249 * @param threshold The new reset voltage threshold in volts.
neilt6 0:abc480f8eeab 250 */
neilt6 2:0a98e081b48c 251 void vResetThreshold(float threshold);
neilt6 2:0a98e081b48c 252
neilt6 0:abc480f8eeab 253 /** Determine whether or not the reset voltage comparator is enabled on the MAX17048
neilt6 0:abc480f8eeab 254 *
neilt6 0:abc480f8eeab 255 * @returns
neilt6 0:abc480f8eeab 256 * 'true' if enabled,
neilt6 0:abc480f8eeab 257 * 'false' if not enabled.
neilt6 0:abc480f8eeab 258 */
neilt6 5:ffce4fe12ed1 259 bool comparatorEnabled();
neilt6 2:0a98e081b48c 260
neilt6 0:abc480f8eeab 261 /** Enable or disable the reset voltage comparator on the MAX17048
neilt6 0:abc480f8eeab 262 *
neilt6 0:abc480f8eeab 263 * @param enabled Whether or not the reset voltage comparator is enabled.
neilt6 0:abc480f8eeab 264 */
neilt6 2:0a98e081b48c 265 void comparatorEnabled(bool enabled);
neilt6 2:0a98e081b48c 266
neilt6 0:abc480f8eeab 267 /** Get the factory programmed 8-bit ID of the MAX17048
neilt6 0:abc480f8eeab 268 *
neilt6 0:abc480f8eeab 269 * @returns The 8-bit ID.
neilt6 0:abc480f8eeab 270 */
neilt6 5:ffce4fe12ed1 271 char id();
neilt6 2:0a98e081b48c 272
neilt6 0:abc480f8eeab 273 /** Determine whether or not the voltage reset alert is enabled on the MAX17048
neilt6 0:abc480f8eeab 274 *
neilt6 0:abc480f8eeab 275 * @returns
neilt6 0:abc480f8eeab 276 * 'true' if enabled,
neilt6 0:abc480f8eeab 277 * 'false' if not enabled.
neilt6 0:abc480f8eeab 278 */
neilt6 5:ffce4fe12ed1 279 bool vResetAlertEnabled();
neilt6 2:0a98e081b48c 280
neilt6 0:abc480f8eeab 281 /** Enable or disable the voltage reset alert on the MAX17048
neilt6 0:abc480f8eeab 282 *
neilt6 0:abc480f8eeab 283 * @param enabled Whether or the voltage reset alert is enabled.
neilt6 0:abc480f8eeab 284 */
neilt6 2:0a98e081b48c 285 void vResetAlertEnabled(bool enabled);
neilt6 2:0a98e081b48c 286
neilt6 0:abc480f8eeab 287 /** Get the current alert flags on the MAX17048
neilt6 0:abc480f8eeab 288 *
neilt6 0:abc480f8eeab 289 * @returns The current alert flags as AlertFlags enum values OR'd together.
neilt6 0:abc480f8eeab 290 */
neilt6 5:ffce4fe12ed1 291 char alertFlags();
neilt6 2:0a98e081b48c 292
neilt6 0:abc480f8eeab 293 /** Clear the specified alert flags on the MAX17048
neilt6 0:abc480f8eeab 294 *
neilt6 0:abc480f8eeab 295 * @param flags The alert flags to clear as AlertFlags enum values OR'd together.
neilt6 0:abc480f8eeab 296 */
neilt6 0:abc480f8eeab 297 void clearAlertFlags(char flags);
neilt6 0:abc480f8eeab 298
neilt6 0:abc480f8eeab 299 /** Get the current cell voltage measurement of the MAX17048
neilt6 0:abc480f8eeab 300 *
neilt6 0:abc480f8eeab 301 * @returns The cell voltage measurement as a float.
neilt6 0:abc480f8eeab 302 */
neilt6 5:ffce4fe12ed1 303 float vcell();
neilt6 0:abc480f8eeab 304
neilt6 4:e61b2723d2cf 305 /** Get the current state of charge measurement of the MAX17048 as a float
neilt6 0:abc480f8eeab 306 *
neilt6 0:abc480f8eeab 307 * @returns The state of charge measurement as a float.
neilt6 0:abc480f8eeab 308 */
neilt6 5:ffce4fe12ed1 309 float soc();
neilt6 0:abc480f8eeab 310
neilt6 4:e61b2723d2cf 311 /** Get the current state of charge measurement of the MAX17048 as an int
neilt6 4:e61b2723d2cf 312 *
neilt6 4:e61b2723d2cf 313 * @returns The state of charge measurement as an int.
neilt6 4:e61b2723d2cf 314 */
neilt6 5:ffce4fe12ed1 315 int soc_int();
neilt6 4:e61b2723d2cf 316
neilt6 0:abc480f8eeab 317 /** Get the current C rate measurement of the MAX17048
neilt6 0:abc480f8eeab 318 *
neilt6 0:abc480f8eeab 319 * @returns The C rate measurement as a float.
neilt6 0:abc480f8eeab 320 */
neilt6 5:ffce4fe12ed1 321 float crate();
neilt6 0:abc480f8eeab 322
neilt6 4:e61b2723d2cf 323 #ifdef MBED_OPERATORS
neilt6 4:e61b2723d2cf 324 /** A shorthand for soc()
neilt6 4:e61b2723d2cf 325 *
neilt6 4:e61b2723d2cf 326 * @returns The state of charge measurement as a float.
neilt6 4:e61b2723d2cf 327 */
neilt6 5:ffce4fe12ed1 328 operator float();
neilt6 4:e61b2723d2cf 329
neilt6 5:ffce4fe12ed1 330 /** A shorthand for soc_int()
neilt6 4:e61b2723d2cf 331 *
neilt6 4:e61b2723d2cf 332 * @returns The state of charge measurement as an int.
neilt6 4:e61b2723d2cf 333 */
neilt6 5:ffce4fe12ed1 334 operator int();
neilt6 4:e61b2723d2cf 335 #endif
neilt6 4:e61b2723d2cf 336
neilt6 0:abc480f8eeab 337 private:
neilt6 2:0a98e081b48c 338 //I2C register addresses
neilt6 2:0a98e081b48c 339 enum Register {
neilt6 2:0a98e081b48c 340 REG_VCELL = 0x02,
neilt6 2:0a98e081b48c 341 REG_SOC = 0x04,
neilt6 2:0a98e081b48c 342 REG_MODE = 0x06,
neilt6 2:0a98e081b48c 343 REG_VERSION = 0x08,
neilt6 2:0a98e081b48c 344 REG_HIBRT = 0x0A,
neilt6 2:0a98e081b48c 345 REG_CONFIG = 0x0C,
neilt6 2:0a98e081b48c 346 REG_VALRT = 0x14,
neilt6 2:0a98e081b48c 347 REG_CRATE = 0x16,
neilt6 2:0a98e081b48c 348 REG_VRESET_ID = 0x18,
neilt6 2:0a98e081b48c 349 REG_STATUS = 0x1A,
neilt6 2:0a98e081b48c 350 REG_TABLE = 0x40,
neilt6 2:0a98e081b48c 351 REG_CMD = 0xFE
neilt6 2:0a98e081b48c 352 };
neilt6 2:0a98e081b48c 353
neilt6 2:0a98e081b48c 354 //Member constants
neilt6 7:bf6972a21c61 355 static const int m_ADDR = (0x36 << 1);
neilt6 2:0a98e081b48c 356
neilt6 2:0a98e081b48c 357 //Member variables
neilt6 2:0a98e081b48c 358 I2C m_I2C;
neilt6 2:0a98e081b48c 359
neilt6 2:0a98e081b48c 360 //Internal functions
neilt6 2:0a98e081b48c 361 unsigned short read(char reg);
neilt6 2:0a98e081b48c 362 void write(char reg, unsigned short data);
neilt6 0:abc480f8eeab 363 };
neilt6 0:abc480f8eeab 364
neilt6 0:abc480f8eeab 365 #endif