This is a library for the MAX17055 Li+ Battery Fuel Gauge.
Dependents: Low_Power_Long_Distance_IR_Vision_Robot MAX17055_EZconfig MAX17055_EZconfig_Sample Low_Power_Long_Distance_IR_Vision_Robot
Fork of max17055 by
Diff: max17055.h
- Revision:
- 21:441840cc7423
- Parent:
- 19:20590e00feab
- Child:
- 22:607f6917832a
--- a/max17055.h Tue Oct 23 21:39:55 2018 +0000 +++ b/max17055.h Tue Oct 23 22:50:58 2018 +0000 @@ -102,10 +102,11 @@ * union max17055_u { * struct battery { * uint8_t avg_soc_FG; // in Battery Percent - * float tte_FG; // in seconds + * float tte_FG; // in seconds * float ttf_FG; // in seconds * int avg_vcell_FG; // in 78.125uV per bit * float avg_curr_FG; // in uAmps + * float curr_FG; // in uAmps * int rep_cap; // in mAh * int rep_SOC; // in % * } battery; @@ -122,13 +123,6 @@ * design_param.vcharge = 4200; // Battery Charge Voltage can be obtained from MAX77650 configuration * design_param.rsense = 5; //5mOhms for MAX32620, keep in mind the MAX17055EVKIT has a 10mOhm resistor. This is a design specific value. Used for calculation results. * - * // //This are the parameters for an rsense = 10mOhm similar to the one found in the MAX17055EVKIT and a 350mAh Li+ Cell. - * // design_param.designcap = 0x02BC; //Design Battery Capacity mAh - * // design_param.ichgterm = 0x00E0; // Charge Termination Current for the Battery - * // design_param.vempty = 0x9600; // Battery Empty Voltage - * // design_param.vcharge = 4200; // Battery Charge Voltage (Specified by manufacurer) - * // design_param.rsense = 10; //10mOhms - * * //Saved Parameters * //saved_param.cycles = 0; //This value is used for the save parameters function * @@ -144,16 +138,17 @@ * * max17055_u.battery.avg_vcell_FG = fuelGauge.get_avgVcell(); * max17055_u.battery.avg_curr_FG = fuelGauge.get_AvgCurrent(design_param); - * max17055_u.battery.rep_cap = fuelGauge.get_battCAP(design_param); - * max17055_u.battery.rep_SOC = fuelGauge.get_SOC(); + * max17055_u.battery.curr_FG = fuelGauge.get_Current(design_param); + * max17055_u.battery.rep_cap = fuelGauge.get_battCAP(design_param); + * max17055_u.battery.rep_SOC = fuelGauge.get_SOC(); * * //This code works with Arduino Serial Plotter to visualize data - * printf("%f " ,(max17055_u.battery.avg_vcell_FG/1000000.0)); - * printf("%f " ,max17055_u.battery.avg_curr_FG); - * printf("%d " ,max17055_u.battery.rep_cap); - * printf("%d " ,max17055_u.battery.rep_SOC); + * printf("%f " ,(max17055_u.battery.avg_vcell_FG/1000000.0)); //V + * printf("%f " ,max17055_u.battery.avg_curr_FG); //uA + * printf("%f " ,max17055_u.battery.curr_FG); //uA + * printf("%d " ,max17055_u.battery.rep_cap); //mAh + * printf("%d " ,max17055_u.battery.rep_SOC); //% * printf("\n"); - * //printf(" "); * wait(1); * } * }