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!
Diff: MAX17048.cpp
- Revision:
- 4:e61b2723d2cf
- Parent:
- 3:32087cca331f
- Child:
- 5:ffce4fe12ed1
diff -r 32087cca331f -r e61b2723d2cf MAX17048.cpp --- a/MAX17048.cpp Wed Aug 28 17:53:53 2013 +0000 +++ b/MAX17048.cpp Mon Sep 16 22:02:40 2013 +0000 @@ -466,6 +466,15 @@ return value * 0.00390625; } +int MAX17048::socInt(void) +{ + //Read the 16-bit raw SOC value + unsigned short value = read(REG_SOC); + + //Return only the top byte + return value >> 8; +} + float MAX17048::crate(void) { //Read the 16-bit raw C/Rate value