82 lines
2.2 KiB
C
82 lines
2.2 KiB
C
/******************************************************************************
|
|
* @file drv_adbms1818.h
|
|
* @brief LT6820-ADBMS1818 isoSpi
|
|
* @version V1.0
|
|
* @author Gary 2024-11-13
|
|
* @copyright
|
|
******************************************************************************/
|
|
#ifndef BMU_ADBMS1818_H_
|
|
#define BMU_ADBMS1818_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "bsp_adbms1818.h"
|
|
#include "bmu_comm_data.h"
|
|
#include "eeprom_manager.h"
|
|
#include "table_comm.h"
|
|
//2-6
|
|
#include "statistic_manager.h"
|
|
#include "run_status.h"
|
|
#include "logic_ctrl.h"
|
|
#include "bmu_manager.h"
|
|
#include "string.h"
|
|
#include "stdio.h"
|
|
|
|
typedef struct
|
|
{
|
|
bool is_fan_on;
|
|
uint16_t ic_num;
|
|
uint16_t* cell_volt_buf; //mv
|
|
uint16_t* cell_temp_buf;
|
|
uint16_t actual_pos[IC_MAX_CELL_NUM];
|
|
uint16_t balance_temp[8];
|
|
uint32_t balance_status[2];
|
|
uint16_t data[kBmuData_End];
|
|
uint32_t statistic_data[kBmuStatistic_End];
|
|
uint32_t timeout;
|
|
uint32_t comm_fault;
|
|
}BmuUnit;
|
|
|
|
typedef struct
|
|
{
|
|
bool is_reverse_on;
|
|
bool has_pole_temp;
|
|
uint8_t cellntc_nomatch; //cell and ntc numbers no match for cross cfg
|
|
uint8_t bmu_cell_num;
|
|
uint8_t bmu_temp_num;
|
|
uint8_t bmu_num;
|
|
uint8_t bmu_online_num;
|
|
uint8_t bmu_ic_num;
|
|
uint8_t total_ic_adapt_num;
|
|
uint16_t total_cell_num;
|
|
uint16_t total_temp_num;
|
|
uint16_t total_ic_num;
|
|
uint16_t cell_volt_total_buf[BMU_MAX_CELL_NUM];
|
|
uint16_t cell_temp_total_buf[BMU_MAX_TEMP_NUM];
|
|
uint8_t cell_actual_pos[BMU_MAX_IC_NUM * IC_MAX_CELL_NUM * BMU_MAX_NUM]; //recode real position for cell
|
|
uint8_t cell_actual_ic[BMU_MAX_IC_NUM * IC_MAX_CELL_NUM * BMU_MAX_NUM]; //recode real position for cell
|
|
uint8_t ntc_actual_pos[BMU_MAX_IC_NUM * IC_MAX_NTC_NUM * BMU_MAX_NUM]; //recode real position for ntc
|
|
uint8_t ntc_actual_ic[BMU_MAX_IC_NUM * IC_MAX_NTC_NUM * BMU_MAX_NUM]; //recode real position for ntc
|
|
uint8_t bmu_fault_bit[kBmuFaultBit_End];
|
|
uint16_t balance_info[BCU_IC_MAX_NUM];
|
|
cell_asic* ic;
|
|
uint16_t* pole_temp_buf;
|
|
BmuUnit bmu_unit[BMU_MAX_NUM];
|
|
}BmuItem;
|
|
|
|
extern BmuItem bmu_data;
|
|
|
|
void bmu_init(void);
|
|
void bms_bmu_init(void);
|
|
void bmu_init_isoSpi(void);
|
|
|
|
void bms_poll_bmu(uint32_t base_time);
|
|
|
|
#ifdef __cplusplusS
|
|
}
|
|
#endif
|
|
|
|
#endif
|