return 0; /* */
}
+
/* BMS Shut-Down.
* Disable both charge and discharge and turn off BMS by sending shutdown sequence.
* Only way out of sequence is power cycle (battery removal and re-insertion or button).
return 0; /* Configuration change success */
}
+/* Place the bms in continuous CC convertion mode */
+int bq769x0_bms_stop_continuous_conversion(struct bq769x0_bms_conf* conf)
+{
+ int ret = 0;
+ uint8_t tmp = 0;
+
+ /* Read actual config */
+ ret = bq769x0_bms_get_regs(conf, SYS_CTRL_2, &tmp, 1);
+ if (ret != 0) {
+ conf->probe_ok = 15;
+ return ret;
+ }
+ msleep(2);
+ /* Set CC continuous conversion bit and write back */
+ tmp &= ~CC_ENABLE;
+ ret = bq769x0_bms_set_regs(conf, SYS_CTRL_2, &tmp, 1);
+ if (ret != 0) {
+ conf->probe_ok = 16;
+ return ret;
+ }
+ return 0; /* Configuration change success */
+}
+
/* Enable/Disable charge and/or discharge
* Note that it is not possible to keep the old charge/discharge state and modify
* only the other one with this function.
return 0;
}
+
+
int bq769x0_bms_get_and_erase_status(struct bq769x0_bms_conf* conf, uint8_t* status)
{
int ret = 0;
/* Place the bms in continuous CC convertion mode */
int bq769x0_bms_set_continuous_conversion(struct bq769x0_bms_conf* conf);
+/* Place the bms in continuous CC convertion mode */
+int bq769x0_bms_stop_continuous_conversion(struct bq769x0_bms_conf* conf);
+
/* Enable/Disable charge and/or discharge
* Note that it is not possible to keep the old charge/discharge state and modify
* only the other one with this function.