Continue balancing on fault

This commit is contained in:
jazzpi 2022-06-23 12:48:06 +02:00
parent 8f0e661e18
commit 839a9a930a
2 changed files with 14 additions and 1 deletions

View File

@ -199,6 +199,18 @@
#define OV_FAULT_SUM (1 << 14)
#define UV_FAULT_SUM (1 << 15)
#define CBCONFIG_BAL_TIME_FOREVER (0 << 4)
#define CBCONFIG_BAL_TIME_1SEC (1 << 4)
#define CBCONFIG_BAL_TIME_1MIN (2 << 4)
#define CBCONFIG_BAL_TIME_2MIN (3 << 4)
#define CBCONFIG_BAL_TIME_5MIN (4 << 4)
#define CBCONFIG_BAL_TIME_10MIN (5 << 4)
#define CBCONFIG_BAL_TIME_15MIN (6 << 4)
#define CBCONFIG_BAL_TIME_20MIN (7 << 4)
#define CBCONFIG_BAL_TIME_30MIN (8 << 4)
#define CBCONFIG_BAL_TIME_60MIN (9 << 4)
#define CBCONFIG_BAL_CONTINUE (1 << 3)
#define DEVCONFIG_REG_DISABLE (1 << 5)
#endif /* INC_BQ_REGISTER_DEFINITIONS_H_ */

View File

@ -204,7 +204,8 @@ void afe_config_power() {
void afe_activate_LED() { BQ_Write_Register(GPIO_OUT, GPIO_OUT_SIZE, 0x01); }
void afe_config_balancing() {
BQ_Write_Register(CBCONFIG, CBCONFIG_SIZE, 0x10);
BQ_Write_Register(CBCONFIG, CBCONFIG_SIZE,
CBCONFIG_BAL_TIME_1SEC | CBCONFIG_BAL_CONTINUE);
}
void afe_balance_channels(uint16_t channelstobalance) {