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!

Revision:
5:ffce4fe12ed1
Parent:
4:e61b2723d2cf
Child:
7:bf6972a21c61
--- a/MAX17048.h	Mon Sep 16 22:02:40 2013 +0000
+++ b/MAX17048.h	Thu Nov 07 17:53:44 2013 +0000
@@ -75,15 +75,15 @@
      *   'true' if the device exists on the bus,
      *   'false' if the device doesn't exist on the bus.
      */
-    bool open(void);
+    bool open();
 
     /** Command the MAX17048 to perform a power-on reset
      */
-    void reset(void);
+    void reset();
 
     /** Command the MAX17048 to perform a QuickStart
      */
-    void quickStart(void);
+    void quickStart();
 
     /** Determine whether sleep mode is enabled on the MAX17048
     *
@@ -91,7 +91,7 @@
     *   'true' if sleep mode is enabled,
     *   'false' if sleep mode is disabled.
     */
-    bool sleepEnabled(void);
+    bool sleepEnabled();
 
     /** Enable or disable sleep mode on the MAX17048
      *
@@ -105,13 +105,13 @@
     *   'true' if hibernating,
     *   'false' if not hibernating.
     */
-    bool hibernating(void);
+    bool hibernating();
 
     /** Get the current hibernate threshold of the MAX17048
     *
     * @returns The current hibernate threshold in \%/hr.
     */
-    float hibernateThreshold(void);
+    float hibernateThreshold();
 
     /** Set the hibernate threshold of the MAX17048
      *
@@ -123,7 +123,7 @@
     *
     * @returns The current active threshold in volts.
     */
-    float activeThreshold(void);
+    float activeThreshold();
 
     /** Set the active threshold of the MAX17048
      *
@@ -135,7 +135,7 @@
     *
     * @returns The 16-bit production version.
     */
-    unsigned short version(void);
+    unsigned short version();
 
     /** Set the cell temperature compensation of the MAX17048
      *
@@ -149,7 +149,7 @@
     *   'true' if in sleep mode,
     *   'false' if not in sleep mode.
     */
-    bool sleeping(void);
+    bool sleeping();
 
     /** Enter or exit sleep mode on the MAX17048 (sleep mode must be enabled first)
      *
@@ -163,7 +163,7 @@
     *   'true' if enabled,
     *   'false' if not enabled.
     */
-    bool socChangeAlertEnabled(void);
+    bool socChangeAlertEnabled();
 
     /** Enable or disable the SOC 1% change alert on the MAX17048
      *
@@ -177,17 +177,17 @@
     *   'true' if alerting,
     *   'false' if not alerting.
     */
-    bool alerting(void);
+    bool alerting();
 
     /** Command the MAX17048 to de-assert the ALRT pin
     */
-    void clearAlert(void);
+    void clearAlert();
 
     /** Get the current SOC empty alert threshold of the MAX17048
     *
     * @returns The current SOC empty alert threshold in %.
     */
-    char emptyAlertThreshold(void);
+    char emptyAlertThreshold();
 
     /** Set the SOC empty alert threshold of the MAX17048
      *
@@ -199,7 +199,7 @@
     *
     * @returns The current low voltage alert threshold in volts.
     */
-    float vAlertMinThreshold(void);
+    float vAlertMinThreshold();
 
     /** Set the low voltage alert threshold of the MAX17048
      *
@@ -211,7 +211,7 @@
     *
     * @returns The current high voltage alert threshold in volts.
     */
-    float vAlertMaxThreshold(void);
+    float vAlertMaxThreshold();
 
     /** Set the high voltage alert threshold of the MAX17048
      *
@@ -223,7 +223,7 @@
     *
     * @returns The current reset voltage threshold in volts.
     */
-    float vResetThreshold(void);
+    float vResetThreshold();
 
     /** Set the reset voltage threshold of the MAX17048
      *
@@ -237,7 +237,7 @@
     *   'true' if enabled,
     *   'false' if not enabled.
     */
-    bool comparatorEnabled(void);
+    bool comparatorEnabled();
 
     /** Enable or disable the reset voltage comparator on the MAX17048
      *
@@ -249,7 +249,7 @@
     *
     * @returns The 8-bit ID.
     */
-    char id(void);
+    char id();
 
     /** Determine whether or not the voltage reset alert is enabled on the MAX17048
     *
@@ -257,7 +257,7 @@
     *   'true' if enabled,
     *   'false' if not enabled.
     */
-    bool vResetAlertEnabled(void);
+    bool vResetAlertEnabled();
 
     /** Enable or disable the voltage reset alert on the MAX17048
      *
@@ -269,7 +269,7 @@
     *
     * @returns The current alert flags as AlertFlags enum values OR'd together.
     */
-    char alertFlags(void);
+    char alertFlags();
 
     /** Clear the specified alert flags on the MAX17048
      *
@@ -281,42 +281,38 @@
     *
     * @returns The cell voltage measurement as a float.
     */
-    float vcell(void);
+    float vcell();
 
     /** Get the current state of charge measurement of the MAX17048 as a float
      *
      * @returns The state of charge measurement as a float.
      */
-    float soc(void);
+    float soc();
 
     /** Get the current state of charge measurement of the MAX17048 as an int
      *
      * @returns The state of charge measurement as an int.
      */
-    int socInt(void);
+    int soc_int();
 
     /** Get the current C rate measurement of the MAX17048
      *
      * @returns The C rate measurement as a float.
      */
-    float crate(void);
+    float crate();
 
 #ifdef MBED_OPERATORS
     /** A shorthand for soc()
      *
      * @returns The state of charge measurement as a float.
      */
-    operator float() {
-        return soc();
-    }
+    operator float();
 
-    /** A shorthand for socInt()
+    /** A shorthand for soc_int()
      *
      * @returns The state of charge measurement as an int.
      */
-    operator int() {
-        return socInt();
-    }
+    operator int();
 #endif
 
 private: