Compare commits
20 Commits
8470d2c41a
...
61d1af0b1d
Author | SHA1 | Date |
---|---|---|
|
61d1af0b1d | |
|
83b4133c68 | |
|
c2cceee9df | |
|
da3aca4948 | |
|
6b4089ed1e | |
|
a6ddf7f43d | |
|
25aaac1080 | |
|
091a70874e | |
|
ed4c22e628 | |
|
b4ce65176d | |
|
f02582475f | |
|
bc90218521 | |
|
5a3b4fc846 | |
|
bf00bc84f8 | |
|
de4f10aaf2 | |
|
0375e81dd6 | |
|
75158d3bf3 | |
|
61a91657bd | |
|
7624dbe183 | |
|
de38f54c76 |
|
@ -5,6 +5,8 @@
|
|||
*.rpt
|
||||
*.plg
|
||||
*.uvgui.*
|
||||
*.uvprojx
|
||||
*.uv*
|
||||
*.crf
|
||||
*.map
|
||||
*.hex
|
||||
|
|
|
@ -102,8 +102,8 @@ void bmu_config_init(void)
|
|||
|
||||
drv_gpio_set_pin_status(kGpioType_SP1_Cs_En2, kGpioStatus_Low);
|
||||
//drv_gpio_set_pin_status(kGpioType_SP1_Cs_En1, kGpioStatus_Low);
|
||||
//bmu_data.bmu_num = get_eeprom_data(kEep_DevAddr_SlaverNum, kEepromDataType_Low);
|
||||
bmu_data.bmu_num = 2;
|
||||
bmu_data.bmu_num = get_eeprom_data(kEep_DevAddr_SlaverNum, kEepromDataType_Low);
|
||||
//bmu_data.bmu_num = 1;
|
||||
if (bmu_data.bmu_num > BMU_MAX_NUM || bmu_data.bmu_num == 0)
|
||||
{
|
||||
bmu_data.bmu_num = BMU_MAX_NUM;
|
||||
|
@ -112,11 +112,11 @@ void bmu_config_init(void)
|
|||
bmu_data.bmu_ic_num = get_eeprom_data(kEep_AfeNum_CellNum, kEepromDataType_High);
|
||||
bmu_data.total_ic_num = bmu_data.bmu_num * bmu_data.bmu_ic_num;
|
||||
bmu_data.ic = bsp_adbms1818_global();
|
||||
//bmu_data.total_cell_num = get_eeprom_data(kEep_CellNum, kEepromDataType_Full);
|
||||
//bmu_data.total_temp_num = get_eeprom_data(kEep_TempNum, kEepromDataType_Full);
|
||||
bmu_data.total_cell_num = get_eeprom_data(kEep_CellNum, kEepromDataType_Full);
|
||||
bmu_data.total_temp_num = get_eeprom_data(kEep_TempNum, kEepromDataType_Full);
|
||||
|
||||
bmu_data.total_cell_num = 32;
|
||||
bmu_data.total_temp_num = 18;
|
||||
//bmu_data.total_cell_num = 16;
|
||||
//bmu_data.total_temp_num = 8;
|
||||
|
||||
//set num from hmi =>adapt num for furture
|
||||
cell_num = bmu_data.total_cell_num / bmu_data.bmu_num;
|
||||
|
@ -240,14 +240,21 @@ void bmu_vlot_breakline_check()
|
|||
|
||||
}
|
||||
|
||||
static int tempJudge_cnt[26][9] = {0};
|
||||
//static int tempCellErr_cnt = 0;
|
||||
//@wkun the here can add temp line break or connect
|
||||
void bmu_temp_breakline_check()
|
||||
void bmu_temp_breakline_check(int value, int bmuIdx, int tempIdx)
|
||||
{
|
||||
//核心逻辑是通过每个bmu中的温度是否大于60000来确定温感排线是否有问题,通过for循环,然后将故障塞入kFaultCode_TempCable对应的故障中
|
||||
//bms_get_bmu_fault_bit(kBmuFaultBit_TempCable),将这个接口中的数据,如果有则置1,否则为0
|
||||
|
||||
|
||||
|
||||
if (value > 6000)
|
||||
{
|
||||
tempJudge_cnt[bmuIdx][tempIdx]++;
|
||||
}
|
||||
if(tempJudge_cnt[bmuIdx][tempIdx] > 1)
|
||||
{
|
||||
//bms_set_bmu_fault_bit(kBmuFaultBit_TempCable, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -361,7 +368,7 @@ static void bmu_statistic_cell_temp(uint16_t bmuIdx)
|
|||
void bmu_data_handler(uint32_t base_time)
|
||||
{
|
||||
uint8_t bmuIdx = 0,cellIdx = 0,_cellIdx = 0,_bmuIdx = 0,_ntcIdx = 0;
|
||||
uint16_t current = 0,load = 0;
|
||||
uint16_t current = 0,load = 0, tempJudge = 0;
|
||||
//calc cell volt
|
||||
for(bmuIdx = 0;bmuIdx < bmu_data.total_ic_num;bmuIdx++)
|
||||
{
|
||||
|
@ -388,7 +395,9 @@ void bmu_data_handler(uint32_t base_time)
|
|||
current = 1;
|
||||
}
|
||||
load = (bmu_data.ic[bmuIdx].aux.a_codes[_ntcIdx] / 10) * 1000 / current; //修订索引错误
|
||||
bmu_data.bmu_unit[bmuIdx].cell_temp_buf[cellIdx] = (bms_get_linear_temp(load, kNtcType_CWFH708_H713) - 500) / 10;
|
||||
tempJudge = (bms_get_linear_temp(load, kNtcType_CWFH708_H713) - 500) / 10;
|
||||
bmu_data.bmu_unit[bmuIdx].cell_temp_buf[cellIdx] = tempJudge;
|
||||
bmu_temp_breakline_check(tempJudge, bmuIdx, _ntcIdx);
|
||||
}
|
||||
//统计温度
|
||||
bmu_statistic_cell_temp(bmuIdx);
|
||||
|
@ -396,7 +405,6 @@ void bmu_data_handler(uint32_t base_time)
|
|||
//alarm monitor
|
||||
//bmu_comm_offline_check(base_time);
|
||||
bmu_vlot_breakline_check();
|
||||
bmu_temp_breakline_check();
|
||||
|
||||
}
|
||||
|
||||
|
@ -418,6 +426,8 @@ void bms_bmu_init()
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void bms_poll_bmu(uint32_t base_time)
|
||||
{
|
||||
//Automatic Recognition
|
||||
|
@ -435,10 +445,15 @@ void bms_poll_bmu(uint32_t base_time)
|
|||
run_command(6,bmu_data.bmu_num*bmu_data.bmu_ic_num);
|
||||
bmu_data_handler(base_time);
|
||||
|
||||
//温感检测是否脱落,加上了防抖,需要两次大于6000,才设置温感排线错误,温感排线错误显示的有点慢
|
||||
//温感的值最开始全是大于6000的,第二次才是采集值
|
||||
memset(tempJudge_cnt, 0, sizeof(tempJudge_cnt));
|
||||
//2-5 @wangk add this line bcu statistic data is show
|
||||
bms_poll_statistic(0);
|
||||
//2-6 @wangk
|
||||
bms_poll_run_status(base_time);
|
||||
//2-10 @wangk
|
||||
task_dido_ctrl_handle(1000);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,10 @@ extern "C" {
|
|||
//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
|
||||
{
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include "kit_debug.h"
|
||||
#include "bsp_hmi.h"
|
||||
#include "drv_w5500.h"
|
||||
#include "drv_eg25gminipice.h"
|
||||
|
||||
#define APP_HMI_BUF_SIZE (1024 * 4)
|
||||
uint8_t hmi_buf[4][APP_HMI_BUF_SIZE] __attribute__((section (".CCM_RAM")));
|
||||
|
||||
|
@ -171,6 +173,7 @@ static void exter_can_rx_it_call(kit_ret_e res, void *data)
|
|||
bsp_queue_push_instance(&exter_can_queue, data);
|
||||
OS_TRACE_ISR_EXIT();
|
||||
}
|
||||
|
||||
/*********************************************MODBUS实例***************************************************/
|
||||
extern EEpromItem eeprom_item;
|
||||
GATE_STATIC_INIT2_CCM(modbus_gate, 200, (kEep_GateDataEnd - kEep_GateDataStart));
|
||||
|
@ -235,6 +238,13 @@ static void inter_uart_rx_it_call(kit_ret_e res, void *data)
|
|||
OS_TRACE_ISR_EXIT();
|
||||
}
|
||||
|
||||
static void sim_uart_rx_it_call(kit_ret_e res, void *data)
|
||||
{
|
||||
OS_TRACE_ISR_ENTER();
|
||||
drv_sim_push_data(&sim_item, data, 1);
|
||||
OS_TRACE_ISR_EXIT();
|
||||
}
|
||||
|
||||
static void exter_uart1_rx_it_call(kit_ret_e res, void *data)
|
||||
{
|
||||
OS_TRACE_ISR_ENTER();
|
||||
|
@ -249,6 +259,7 @@ static void exter_uart2_rx_it_call(kit_ret_e res, void *data)
|
|||
OS_TRACE_ISR_EXIT();
|
||||
}
|
||||
|
||||
|
||||
static void uart_tx_it_call(kit_ret_e res, void *data)
|
||||
{
|
||||
uint8_t dev = *(uint8_t *)data;
|
||||
|
@ -300,6 +311,9 @@ void bms_init_comm(void)
|
|||
drv_uart_set_interrupt(INTER_UART_PORT, kUartInterrupt_Rx, APP_CFG_INT_PRIO_UART2_RX, inter_uart_rx_it_call);
|
||||
drv_uart_set_interrupt(EXTER_UART1_PORT, kUartInterrupt_Rx, APP_CFG_INT_PRIO_UART2_RX, exter_uart1_rx_it_call);
|
||||
drv_uart_set_interrupt(EXTER_UART2_PORT, kUartInterrupt_Rx, APP_CFG_INT_PRIO_UART2_RX, exter_uart2_rx_it_call);
|
||||
|
||||
drv_uart_set_interrupt(SIM_UART_PORT, kUartInterrupt_Rx, APP_CFG_INT_PRIO_UART2_RX, sim_uart_rx_it_call);//#define SIM_UART_PORT kUartDev_2
|
||||
|
||||
|
||||
drv_can_init(INTER_CAN_PORT, 250, kGpioType_Can_Ch1_Rx, kGpioType_Can_Ch1_Tx);
|
||||
drv_can_set_interrupt(INTER_CAN_PORT, kcan_interrupt_e_Rx, APP_CFG_INT_PRIO_CAN1_RX, inter_can_rx_it_call);
|
||||
|
|
|
@ -14,9 +14,13 @@ extern "C" {
|
|||
//gary @update 调整顺序
|
||||
#define INTER_CAN_PORT kcan_dev_e_1
|
||||
#define EXTER_CAN_PORT kcan_dev_e_2
|
||||
|
||||
#define INTER_UART_PORT kUartDev_1
|
||||
#define EXTER_UART1_PORT kUartDev_3
|
||||
#define EXTER_UART2_PORT kUartDev_4
|
||||
#define SIM_UART_PORT kUartDev_2
|
||||
|
||||
|
||||
#define BMS_485_CHANNEL (3u)
|
||||
|
||||
#define W5500_MODBUS_NUM (8u)
|
||||
|
|
|
@ -195,7 +195,8 @@ void bms_force_crtl_do_status(uint8_t idx, DoCtrlStatus status)
|
|||
if(status < kDoCtrlStatus_None)
|
||||
{
|
||||
do_item.tick[idx] = RELAY_CTRL_NO_DLY;
|
||||
do_item.ctrl_status[idx] = (DoStatus)(status + 2);
|
||||
//@wagnk,2-17,这里原本的status加了2,取消了
|
||||
do_item.ctrl_status[idx] = (DoStatus)(status);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -225,7 +226,7 @@ const GpioStatus relay_status_to_ctrl[kDoStatus_End] ={kGpioStatus_Low, kGpioSta
|
|||
|
||||
void bms_poll_di_do(uint32_t base_time)
|
||||
{
|
||||
uint32_t i;
|
||||
uint32_t i,j = 0;
|
||||
DoStatus rly_st;
|
||||
|
||||
if(do_item.bmsCircuitCtrl != NULL)
|
||||
|
@ -247,6 +248,10 @@ void bms_poll_di_do(uint32_t base_time)
|
|||
do_item.tick[i] = 0;
|
||||
rly_st = do_item.ctrl_status[i];
|
||||
do_item.actual_status[i] = rly_st;
|
||||
if((relay_status_to_ctrl[rly_st] == kGpioStatus_Low) && (i == 1))
|
||||
{
|
||||
j = 1;
|
||||
}
|
||||
drv_gpio_set_pin_status(do_item.relay_start_io + i, relay_status_to_ctrl[rly_st]);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -37,9 +37,9 @@ typedef enum
|
|||
{
|
||||
kDoType_Start = 0,
|
||||
kDoType_Unused = kDoType_Start,
|
||||
kDoType_Chg,
|
||||
kDoType_Dis,
|
||||
kDoType_PreChg, //3
|
||||
kDoType_PreChg,
|
||||
kDoType_Chg,
|
||||
kDoType_Dis,//3
|
||||
kDoType_Positive, //4
|
||||
kDoType_Negative,//5
|
||||
kDoType_Cool,
|
||||
|
@ -84,6 +84,8 @@ typedef enum
|
|||
kDiType_Start = 0,
|
||||
kDiType_Unused= kDiType_Start,
|
||||
kDiType_FireAlarm1, //消防1
|
||||
kDiType_FireAlarm2,
|
||||
kDiType_FireAlarm3,
|
||||
kDiType_EmergStop1, //急停
|
||||
kDiType_Do1Feedback,
|
||||
kDiType_Do2Feedback,
|
||||
|
|
|
@ -44,11 +44,14 @@ const GpioArray io_array[kGpioType_End] =
|
|||
kGpioMode_Comm_Rx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 10), kGpioPort_A, kGpioPin_10 , //rs485C Rx(mcu uart1)
|
||||
kGpioMode_Comm_Tx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 9), kGpioPort_A, kGpioPin_9 , //rs485C Tx(mcu uart1)
|
||||
|
||||
kGpioMode_Comm_Rx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_D, 9), kGpioPort_D, kGpioPin_9 , //rs485B Rx(mcu uart1)
|
||||
kGpioMode_Comm_Tx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_D, 8), kGpioPort_D, kGpioPin_8 , //rs485B Tx(mcu uart1)
|
||||
kGpioMode_Comm_Rx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_D, 9), kGpioPort_D, kGpioPin_9 , //rs485B Rx(mcu uart3)
|
||||
kGpioMode_Comm_Tx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_D, 8), kGpioPort_D, kGpioPin_8 , //rs485B Tx(mcu uart3)
|
||||
|
||||
kGpioMode_Comm_Rx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 1), kGpioPort_A, kGpioPin_1 , //rs485A Rx(mcu uart1)
|
||||
kGpioMode_Comm_Tx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 0), kGpioPort_A, kGpioPin_0 , //rs485A Tx(mcu uart1)
|
||||
kGpioMode_Comm_Rx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 1), kGpioPort_A, kGpioPin_1 , //rs485A Rx(mcu uart4)
|
||||
kGpioMode_Comm_Tx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 0), kGpioPort_A, kGpioPin_0 , //rs485A Tx(mcu uart4)
|
||||
|
||||
kGpioMode_Comm_Rx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 2), kGpioPort_A, kGpioPin_2 , //SIM UART Rx(mcu uart2)
|
||||
kGpioMode_Comm_Tx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 3), kGpioPort_A, kGpioPin_3 , //SIM UART Tx(mcu uart2)
|
||||
|
||||
/*CAN枚举*/
|
||||
kGpioMode_Comm_Rx, kGpioStatus_Low, GPIO_PORT_PIN(kGpioPort_A, 11), kGpioPort_A, kGpioPin_11 , //can1 rx
|
||||
|
|
|
@ -56,6 +56,9 @@ typedef enum
|
|||
kGpioType_Rs485_Ch2_Tx,
|
||||
kGpioType_Rs485_Ch3_Rx,
|
||||
kGpioType_Rs485_Ch3_Tx,
|
||||
|
||||
kGpioType_SIMUart_Rx, //Sim卡
|
||||
kGpioType_SIMUart_Tx, //Sim卡
|
||||
|
||||
/*CAN枚举*/
|
||||
kGpioType_Can_Ch1_Rx,
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
#include "drv_ads8688.h"
|
||||
|
||||
#define CUR_FILTER_ENABLE (0u)
|
||||
#define ADCIC_SAMPLE_CNT (4u)
|
||||
#define ADCIC_SAMPLE_CNT (20u)
|
||||
#define MCP3208_SAMPLE_CNT (10u)
|
||||
|
||||
ADS8688_STATIC_INIT(ads8688, kSpiDev_2, kGpioType_ADC_Cs);
|
||||
|
||||
|
@ -83,7 +84,7 @@ void bms_init_current(void)
|
|||
cur_item.shunt_volt = get_eeprom_data(kEep_ChgCurDir_ShuntRatedVolt, kEepromDataType_Low);
|
||||
|
||||
cur_item.prop[0].filter = cur_item.prop[1].filter = 0;
|
||||
// 上位机下发时缩小10倍
|
||||
// 上位机下发时缩小10倍,分流器量程 乘了 10
|
||||
cur_item.prop[0].scale = get_eeprom_data(kEep_CurSensor2_1Range, kEepromDataType_Low) * 10;
|
||||
cur_item.prop[1].scale = get_eeprom_data(kEep_CurSensor2_1Range, kEepromDataType_High) * 10;
|
||||
|
||||
|
@ -191,12 +192,12 @@ int16_t bms_caculate_current(uint32_t base_time)
|
|||
if (cur_item.channel < kCurChannel_End)
|
||||
{
|
||||
prop = &cur_item.prop[cur_item.channel];
|
||||
switch (prop->type)
|
||||
switch (prop->type)
|
||||
{
|
||||
case kCurSensor_Shunt:
|
||||
// 分流器 cur_hv_item.cur_volt_avg / cur_prop.shunt_volt * cur_prop.cur_scale;
|
||||
//current = (int32_t)cur_hv_item.value[kAdIc_Cur] * prop->scale / cur_item.shunt_volt;
|
||||
current = HighResCurTrans(cur_hv_item.value[kAdIc_Cur]);
|
||||
current = (int32_t)cur_hv_item.value[kAdIc_Cur] * prop->scale / cur_item.shunt_volt;
|
||||
//current = HighResCurTrans(cur_hv_item.value[kAdIc_Cur]);
|
||||
break;
|
||||
case kCurSensor_SigHall:
|
||||
// 霍尔电流
|
||||
|
@ -229,8 +230,8 @@ int16_t bms_caculate_current(uint32_t base_time)
|
|||
break;
|
||||
}
|
||||
}
|
||||
//测试用 SFJ 7.30
|
||||
current = volval * 100 / 10;
|
||||
//测试用 SFJ 7.30,2-18,注释
|
||||
//current = volval * 100 / 10;
|
||||
|
||||
// 电流方向
|
||||
current *= prop->dir;
|
||||
|
@ -282,26 +283,70 @@ uint32_t HighVolTrans(uint16_t voldata)
|
|||
AdjustValue adIc_adjust_value[kAdIc_End];
|
||||
uint16_t adIc_reg_map[kAdIc_End] = {MAN_Ch_0, MAN_Ch_1, MAN_Ch_2, MAN_Ch_3, MAN_Ch_4};
|
||||
|
||||
uint16_t zero_calc(uint16_t value)
|
||||
{
|
||||
if(value > 32700 && value < 32788)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if(value < 20)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
void get_ad_sample(void)
|
||||
{
|
||||
static uint16_t outputdata[16] = {0};
|
||||
int32_t i =0;
|
||||
uint16_t ad =0;
|
||||
int32_t i =0,dir = 1;
|
||||
//uint16_t ad =0;
|
||||
uint16_t ad = 0,value = 0;
|
||||
#if ADC_AUTO_MODE
|
||||
//auto scan mode
|
||||
drv_enter_auto_rst_mode_Data(outputdata, 6);
|
||||
#else
|
||||
|
||||
//auto scan mode
|
||||
drv_enter_auto_rst_mode_Data(outputdata, 6);
|
||||
outputdata[i] = drv_get_ads8688_ch_data(MAN_Ch_0);
|
||||
i += 1;
|
||||
outputdata[i] = drv_get_ads8688_ch_data(MAN_Ch_1);
|
||||
i += 1;
|
||||
outputdata[i] = drv_get_ads8688_ch_data(MAN_Ch_2);
|
||||
i += 1;
|
||||
outputdata[i] = drv_get_ads8688_ch_data(MAN_Ch_3);
|
||||
i += 1;
|
||||
outputdata[i] = drv_get_ads8688_ch_data(MAN_Ch_4);
|
||||
i += 1;
|
||||
outputdata[i] = drv_get_ads8688_ch_data(MAN_Ch_5);
|
||||
i += 1;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < kAdIc_End; i++)
|
||||
{
|
||||
//ad = drv_get_ads8688_ch_data(adIc_reg_map[i]);
|
||||
//0漂处理
|
||||
if(i == kAdIc_Cur)
|
||||
{
|
||||
outputdata[i] = zero_calc(outputdata[i]);
|
||||
}
|
||||
|
||||
cur_hv_item.ad_buf[i][cur_hv_item.ad_buf_pos[i]++] = drv_ads8688_value(outputdata[i]);
|
||||
ad = cur_hv_item.ad_avg[i] = kit_get_int32_avg_filter_max_min(cur_hv_item.ad_buf[i], ADCIC_SAMPLE_CNT);
|
||||
cur_hv_item.ad_avg[i] = kit_get_int32_avg_filter_max_min(cur_hv_item.ad_buf[i], ADCIC_SAMPLE_CNT);
|
||||
|
||||
if(cur_hv_item.ad_avg[i] < 0)
|
||||
{
|
||||
dir = -1;
|
||||
}
|
||||
|
||||
ad = KIT_ABS(cur_hv_item.ad_avg[i]);
|
||||
|
||||
if (i == kAdIc_HvIso)
|
||||
{
|
||||
//cur_hv_item.value[i] = HighVolTrans2(ad)/100;
|
||||
bms_set_iso_volt_ad(kIsoVolt_Other, ad);
|
||||
bms_set_iso_volt_ad(kIsoVolt_Other, dir * ad);
|
||||
}
|
||||
if(i == kAdIc_HvIsoNagtive)
|
||||
{
|
||||
|
@ -309,24 +354,26 @@ void get_ad_sample(void)
|
|||
}
|
||||
if (i == kAdIc_HvBat)
|
||||
{
|
||||
cur_hv_item.value[i] = (ad / 100) * 512 * 10 / (0x01 << 16); //单位是mv
|
||||
cur_hv_item.value[i] = dir * (376 * ad * 512 * 10 / (0x01 << 15)) / 100; //单位是mv
|
||||
bms_set_iso_volt_ad(kIsoVolt_TotalVolt, cur_hv_item.value[i]);
|
||||
}
|
||||
if(i == kAdIc_Hv1)
|
||||
{
|
||||
cur_hv_item.value[i] = (ad / 100) * 512 * 10 / (0x01 << 16); //单位是mv
|
||||
cur_hv_item.value[i] = dir * (376 * ad * 512 * 10 / (0x01 << 15)) / 100; //单位是mv
|
||||
}
|
||||
if(i == kAdIc_Cur)
|
||||
{
|
||||
ad = ad - adIc_adjust_value[i].zero;
|
||||
ad = (10 * ad / 82000) * 512 * 1000/ (0x01 << 16); //单位是mv
|
||||
//ad = ad - adIc_adjust_value[i].zero;
|
||||
|
||||
//ad = (ad * 5120 * 10 / (0x01 << 15)) / 82; //单位是mv
|
||||
ad = (ad * 2560 * 10 * 100 / (0x01 << 15)) / 82; //单位是0.1 mv
|
||||
|
||||
// 防止eeprom中没有设置电压校准系数
|
||||
if (get_eeprom_data(kEep_Volt1CalFactor, kEepromDataType_Full) <= 900 || get_eeprom_data(kEep_Volt1CalFactor, kEepromDataType_Full) >= 1100)
|
||||
{
|
||||
bsp_eeprom_save_data(kEep_Volt1CalFactor, 1000, kEepromDataType_Full);
|
||||
}
|
||||
cur_hv_item.value[i] = ad / 1000 * adIc_adjust_value[i].rate *get_eeprom_data(kEep_Volt1CalFactor, kEepromDataType_Full) / 1000;//转为V
|
||||
cur_hv_item.value[i] = ad * dir;/// 1000 * adIc_adjust_value[i].rate *get_eeprom_data(kEep_Volt1CalFactor, kEepromDataType_Full) / 1000;//转为V
|
||||
}
|
||||
|
||||
if (cur_hv_item.ad_buf_pos[i] >= ADCIC_SAMPLE_CNT)
|
||||
|
@ -432,10 +479,12 @@ const uint32_t adIc_default_rate[kAdIc_End] = {1, 1, 1, 1, 1};
|
|||
//
|
||||
void bms_init_cur_hv(void)
|
||||
{
|
||||
static uint8_t errcnt = 0;
|
||||
uint32_t i = 0, cnt = 30;
|
||||
#ifdef ADS_8688_EN
|
||||
while(drv_ads8688_Init())
|
||||
while(drv_ads8688_Init() && errcnt < 30)
|
||||
{
|
||||
errcnt++;
|
||||
OSTimeDly(20);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,8 @@ extern "C" {
|
|||
|
||||
typedef enum
|
||||
{
|
||||
kHvType_Iso,
|
||||
kHvType_Bat,
|
||||
kHvType_Hv1,
|
||||
kHvType_Hv2,
|
||||
kHvType_Bat,
|
||||
kHvType_End,
|
||||
}HvType;
|
||||
|
||||
|
|
|
@ -17,15 +17,18 @@ DiParamItem di_param_item[kDiType_End];
|
|||
|
||||
|
||||
//辅助触点1
|
||||
//di_signal->di_item.status, di->di_iteml.type
|
||||
void ord_di_do_feedback_func(uint32_t base_time, DiStatus di_signal, DiType di)
|
||||
{
|
||||
if(di < kDiType_End)
|
||||
{
|
||||
if(bms_get_do_status_by_idx(di - kDiType_Do1Feedback) != di_signal)
|
||||
{
|
||||
di_param_item[di].dly += base_time;
|
||||
//I don't know what's the meaning of this line.Whatever I change the 5000 to what , it is always enter the " if " and set the fault level.
|
||||
//di_param_item[di].dly += base_time;
|
||||
if(di_param_item[di].dly >= 5000)
|
||||
{
|
||||
//这里会写进错误--反馈异常,这里的一级代表三级错误
|
||||
bms_set_fault_level(kFaultCode_Feedback, kFaultLevel_First, kFaultHandle_AlarmIdx);
|
||||
}
|
||||
}
|
||||
|
@ -93,8 +96,9 @@ void ord_di_breaker1_fun(uint32_t base_time, DiStatus di_signal, DiType di)
|
|||
{
|
||||
if((di < kDiType_End) && (di_signal == kDiStatus_Trigger))
|
||||
{
|
||||
//这里会写进错误--反馈异常,这里的三级代表一级错误
|
||||
di_param_item[di].dly += base_time;
|
||||
bms_set_fault_level(kFaultCode_Feedback, kFaultLevel_Third, kFaultHandle_CutNoRelIdx);
|
||||
bms_set_fault_level(kFaultCode_Feedback, kFaultLevel_Third, kFaultHandle_CutNoRelIdx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ bool logic_adhesion_check(uint32_t base_time, DoType type)
|
|||
void logic_open_check(uint32_t base_time)
|
||||
{
|
||||
uint16_t tv, hv, rate;
|
||||
DoErrSrc do_err_src = bms_get_do_err_src(kDoType_Positive);
|
||||
DoErrSrc do_err_src = bms_get_do_err_src(kDoType_Chg);
|
||||
FaultLevel fault = kFaultLevel_Normal;
|
||||
static uint16_t dly;
|
||||
|
||||
|
@ -161,8 +161,8 @@ void logic_same_circuit_ctrl(uint32_t base_time)
|
|||
//kEep_IsSoftReset高低只能清楚一个,否则断电下带无法保存0
|
||||
if(((bms_get_run_status() != kRunStatus_Init) && (bms_get_circuit_cmd_status() == kCircuitStatus_On)) || (dly >= 10000))
|
||||
{
|
||||
bms_crtl_do_status(kDoType_Positive, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY);
|
||||
bms_crtl_do_status(kDoType_Negative, kDoCtrlStatus_On, 100);
|
||||
bms_crtl_do_status(kDoType_Chg, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY);
|
||||
bms_crtl_do_status(kDoType_Dis, kDoCtrlStatus_On, 100);
|
||||
dly = 0;
|
||||
status = kDoLogicStatus_On;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ void logic_same_circuit_ctrl(uint32_t base_time)
|
|||
//增加init状态,防止预充中反复检测粘连 建议增加多次检测
|
||||
//Gary 2024-07-25 连续粘连3秒才报粘连故障
|
||||
dly += base_time;
|
||||
if(logic_adhesion_check(base_time, kDoType_Positive) == true)
|
||||
if(logic_adhesion_check(base_time, kDoType_Chg) == true)
|
||||
{
|
||||
dly = 0;
|
||||
status = kDoLogicStatus_Off;
|
||||
|
@ -189,22 +189,22 @@ void logic_same_circuit_ctrl(uint32_t base_time)
|
|||
if (prechg_max_cnt == 0) //读取配置:不预充
|
||||
{
|
||||
status = kDoLogicStatus_On;
|
||||
bms_crtl_do_status(kDoType_Negative, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY);
|
||||
bms_crtl_do_status(kDoType_Positive, kDoCtrlStatus_On, 100);
|
||||
bms_crtl_do_status(kDoType_Dis, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY);
|
||||
bms_crtl_do_status(kDoType_Chg, kDoCtrlStatus_On, 100);
|
||||
}
|
||||
else //读取配置:预充
|
||||
{
|
||||
if (prechg_cnt++ < prechg_max_cnt) //判断预充次数
|
||||
{
|
||||
status = kDoLogicStatus_Prechg;
|
||||
//bms_crtl_do_status(kDoType_Positive, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY); //闭合总正继电器
|
||||
bms_crtl_do_status(kDoType_Negative, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY);
|
||||
//bms_crtl_do_status(kDoType_Chg, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY); //闭合总正继电器
|
||||
bms_crtl_do_status(kDoType_Dis, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY);
|
||||
bms_crtl_do_status(kDoType_PreChg, kDoCtrlStatus_On, 100);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
bms_crtl_do_status(kDoType_Negative, kDoCtrlStatus_Off, 100);
|
||||
bms_crtl_do_status(kDoType_Dis, kDoCtrlStatus_Off, 100);
|
||||
bms_set_fault_level(kFaultCode_PreChg, kFaultLevel_Third, kFaultHandle_CutNoRelIdx);
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ void logic_same_circuit_ctrl(uint32_t base_time)
|
|||
prechg_cnt = 0;
|
||||
status = kDoLogicStatus_Off;
|
||||
bms_crtl_do_status(kDoType_PreChg, kDoCtrlStatus_Off, RELAY_CTRL_NO_DLY);
|
||||
bms_crtl_do_status(kDoType_Negative, kDoCtrlStatus_Off, 100);
|
||||
bms_crtl_do_status(kDoType_Dis, kDoCtrlStatus_Off, 100);
|
||||
}
|
||||
else if (dly >= prechg_time)//预充超时
|
||||
{
|
||||
|
@ -237,7 +237,7 @@ void logic_same_circuit_ctrl(uint32_t base_time)
|
|||
dly = 0;
|
||||
prechg_cnt = 0;
|
||||
status = kDoLogicStatus_On;
|
||||
bms_crtl_do_status(kDoType_Positive, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY); //闭合总正继电器
|
||||
bms_crtl_do_status(kDoType_Chg, kDoCtrlStatus_On, RELAY_CTRL_NO_DLY); //闭合总正继电器
|
||||
bms_crtl_do_status(kDoType_PreChg, kDoCtrlStatus_Off, 500); //延时500ms断开预充继电器
|
||||
}
|
||||
}
|
||||
|
@ -271,8 +271,8 @@ void logic_same_circuit_ctrl(uint32_t base_time)
|
|||
{
|
||||
dly = 0;
|
||||
status = kDoLogicStatus_WaitAdhesion;
|
||||
bms_crtl_do_status(kDoType_Positive, kDoCtrlStatus_Off, RELAY_CTRL_NO_DLY);
|
||||
bms_crtl_do_status(kDoType_Negative, kDoCtrlStatus_Off, 100);
|
||||
bms_crtl_do_status(kDoType_Chg, kDoCtrlStatus_Off, RELAY_CTRL_NO_DLY);
|
||||
bms_crtl_do_status(kDoType_Dis, kDoCtrlStatus_Off, 100);
|
||||
}
|
||||
break;
|
||||
case kDoLogicStatus_WaitAdhesion:
|
||||
|
@ -296,8 +296,8 @@ void logic_same_circuit_poll(uint32_t base_time, uint8_t idx)
|
|||
CircuitStatus circuit_st = kCircuitStatus_On;
|
||||
|
||||
logic_same_circuit_ctrl(base_time);
|
||||
pos_rly_st = bms_get_do_status_by_type(kDoType_Positive);
|
||||
neg_rly_st = (bms_is_do_config(kDoType_Negative) == true) ? bms_get_do_status_by_type(kDoType_Negative) : kDoStatus_On;
|
||||
pos_rly_st = bms_get_do_status_by_type(kDoType_Chg);
|
||||
neg_rly_st = (bms_is_do_config(kDoType_Dis) == true) ? bms_get_do_status_by_type(kDoType_Dis) : kDoStatus_On;
|
||||
//neg_rly_st = kDoStatus_On;
|
||||
|
||||
if(((pos_rly_st != kDoStatus_On) && (pos_rly_st != kDoStatus_ForceOn))
|
||||
|
|
|
@ -149,7 +149,7 @@ bool bms_is_chg_circuit_allow(void)
|
|||
res = (bms_get_main_ctrl_strategy() == kDoCtrlStrategy_DiffCircuit) ? (run_item.run_status == kRunStatus_Chg) : (run_item.run_status != kRunStatus_Init);
|
||||
if((res != true) || (bms_get_fault_relay_off_bit_by_status(kRunStatus_Chg) != 0)
|
||||
|| (bms_get_signal(kSignalIdx_LowVoltSleep) == kSignalStatus_High)|| (bms_get_signal(kSignalIdx_StandbySleep) == kSignalStatus_High))
|
||||
{
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
return res;
|
||||
|
|
|
@ -146,8 +146,8 @@ uint16_t soh_init(uint16_t cycle, uint32_t dis_cap, uint32_t charge_cap)
|
|||
{
|
||||
uint16_t soh_loss1 = 0; //充放电次数计算出的SOH损耗百分比
|
||||
uint16_t soh_loss2 = 0; //累计放电安时计算出的SOH损耗百分比
|
||||
uint32_t rated_cap = get_eeprom_data(kEep_RatedCapacity, kEepromDataType_Full);
|
||||
uint16_t cycle_70 = get_eeprom_data(kEep_SOHSeventyCycle, kEepromDataType_Full);
|
||||
uint32_t rated_cap = get_eeprom_data(kEep_RatedCapacity, kEepromDataType_Full); //2800
|
||||
uint16_t cycle_70 = get_eeprom_data(kEep_SOHSeventyCycle, kEepromDataType_Full);//3000
|
||||
|
||||
if(cycle <= 10)
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ void cap_data_update(uint16_t base_time)
|
|||
if (run_status == kRunStatus_Chg)
|
||||
{
|
||||
chg_dly += KIT_SECOND_CONVERT(1);
|
||||
if(chg_dly >= KIT_MINUTE_CONVERT(6))
|
||||
if(chg_dly >= KIT_MINUTE_CONVERT(6))//
|
||||
{
|
||||
chg_dly -= KIT_MINUTE_CONVERT(6);
|
||||
|
||||
|
@ -303,7 +303,7 @@ void soc_run_calibrate(int16_t current, uint16_t base_time)
|
|||
static uint16_t dis_dly = 0;
|
||||
static uint16_t chg_dly = 0;
|
||||
uint8_t temp = 0;
|
||||
|
||||
|
||||
//放电
|
||||
if((current < 0) && (sox_item.dis_adjust_flag == false) &&
|
||||
(bms_get_statistic_data(kStatisticData_MinVolt) <= 3000) &&
|
||||
|
@ -368,11 +368,11 @@ void soc_exterme_calibrate(int16_t current, uint16_t base_time)
|
|||
{
|
||||
case kSocAdjustStep_Wait:
|
||||
avg_volt = bms_get_statistic_data(kStatisticData_AvgVolt);
|
||||
total_volt = bms_get_statistic_data(kStatisticData_AccVolt) / 100;
|
||||
total_volt = bms_get_statistic_data(kStatisticData_AccVolt)/ 100;
|
||||
if (((bms_get_statistic_data(kStatisticData_MinVolt) <= get_eeprom_data(kEep_FullDisVolt, kEepromDataType_Full))
|
||||
&& (avg_volt <= get_eeprom_data(kEep_FullDisAvgVolt, kEepromDataType_Full))
|
||||
&& (bms_get_ex_data(kExType_CellVolt) == kExStatus_None))
|
||||
|| (total_volt <= get_eeprom_data(kEep_FullDisTotalVolt, kEepromDataType_Full))
|
||||
|| (total_volt <= get_eeprom_data(kEep_FullDisTotalVolt, kEepromDataType_Full)/100)
|
||||
|| ((sox_item.soc_req_st == kSocStatus_Empty) && (sox_item.is_bsu_adjust == false)))
|
||||
{
|
||||
full_dly = 0;
|
||||
|
@ -463,15 +463,16 @@ void bms_init_soc(void)
|
|||
{
|
||||
uint32_t soc;
|
||||
uint64_t tmp_64u;
|
||||
int32_t year, mon, day;
|
||||
int32_t year, mon, day;
|
||||
|
||||
soc = get_eeprom_data(kEep_SOC, kEepromDataType_Full);
|
||||
//soc = bms_check_pwr_on_ocv(soc);
|
||||
sox_item.soc_kEep_99 = true;
|
||||
sox_item.soc_kEep_1 = true;
|
||||
|
||||
if (soc == 0)
|
||||
{
|
||||
sox_item.soc_kEep_1 = false;
|
||||
sox_item.soc_kEep_1 = false;
|
||||
}
|
||||
else if (soc == SOX_MAX_SOC_VALUE)
|
||||
{
|
||||
|
@ -504,6 +505,7 @@ void bms_init_soc(void)
|
|||
sox_item.rated_cap = tmp_64u;
|
||||
sox_item.soc_1_cap = (SOX_DIS_kEep_SOC * tmp_64u) / SOX_MAX_SOC_VALUE;
|
||||
sox_item.soc_99_cap = (SOX_CHG_kEep_SOC * tmp_64u) / SOX_MAX_SOC_VALUE;
|
||||
|
||||
sox_item.calculate_cap = (soc * tmp_64u) / SOX_MAX_SOC_VALUE;
|
||||
|
||||
sox_item.cycle = get_eeprom_data(kEep_CycleTimes, kEepromDataType_Full);
|
||||
|
@ -553,12 +555,16 @@ void bms_integral_soc(int32_t current, uint16_t base_time)
|
|||
uint16_t soc = sox_item.soc;
|
||||
uint16_t integral_time = 0, total_volt;
|
||||
uint32_t tmp_32u = 0;
|
||||
|
||||
|
||||
cap_data_update(base_time);
|
||||
soc_exterme_calibrate(current, base_time);
|
||||
if(sox_item.adjust_step != kSocAdjustStep_Wait)
|
||||
return;
|
||||
|
||||
// /*soc test add 2-19
|
||||
// current = 168;
|
||||
// soc_run_calibrate(168, base_time);
|
||||
// */
|
||||
tmp_32u = kit_time_get_tick();
|
||||
integral_time = kit_time_get_interval(sox_item.last_tick, tmp_32u);
|
||||
sox_item.last_tick = tmp_32u;
|
||||
|
@ -586,13 +592,15 @@ void bms_integral_soc(int32_t current, uint16_t base_time)
|
|||
{
|
||||
//单位Ams
|
||||
//公式 (current / 100 * integral_time) * (sox_item.chg_adjust_rate / 100)
|
||||
tmp_32u = current * integral_time * sox_item.chg_adjust_rate / 10000;
|
||||
//tmp_32u = current * integral_time * sox_item.chg_adjust_rate / 10000;
|
||||
tmp_32u = current * integral_time * sox_item.chg_adjust_rate / 100;
|
||||
if (tmp_32u > SOX_MAX_SIGNAL_INTEGRAL)
|
||||
tmp_32u = SOX_MAX_SIGNAL_INTEGRAL;
|
||||
|
||||
sox_item.tmp_chg_cap += tmp_32u;
|
||||
//单位 kWms
|
||||
sox_item.tmp_chg_energy += tmp_32u * total_volt / 10000;
|
||||
//tmp_32少除了100,这里应该多除个100--2.20
|
||||
sox_item.tmp_chg_energy += tmp_32u * total_volt / 1000000;
|
||||
|
||||
if(sox_item.calculate_cap < sox_item.rated_cap)
|
||||
{
|
||||
|
@ -632,13 +640,13 @@ void bms_integral_soc(int32_t current, uint16_t base_time)
|
|||
//放电积分
|
||||
if(current < 0)
|
||||
{
|
||||
tmp_32u = KIT_ABS(current) * integral_time * sox_item.dis_adjust_rate / 10000;
|
||||
tmp_32u = KIT_ABS(current) * integral_time * sox_item.dis_adjust_rate / 100;
|
||||
if (tmp_32u > SOX_MAX_SIGNAL_INTEGRAL)
|
||||
tmp_32u = SOX_MAX_SIGNAL_INTEGRAL;
|
||||
|
||||
sox_item.tmp_dis_cap += tmp_32u;
|
||||
//单位 kWms
|
||||
sox_item.tmp_dis_energy += tmp_32u * total_volt / 10000;
|
||||
sox_item.tmp_dis_energy += tmp_32u * total_volt / 1000000;
|
||||
|
||||
if(sox_item.calculate_cap > 0)
|
||||
{
|
||||
|
|
|
@ -23,26 +23,26 @@ typedef enum
|
|||
|
||||
typedef enum
|
||||
{
|
||||
kCumulateData_DayDisTime,
|
||||
kCumulateData_DayDisTime, //0
|
||||
kCumulateData_DayChgTime,
|
||||
|
||||
kCumulateData_SigDisTime,
|
||||
kCumulateData_SigDisCap,
|
||||
kCumulateData_SigDisEnergy,
|
||||
kCumulateData_SigChgTime,
|
||||
kCumulateData_SigChgTime, //5
|
||||
kCumulateData_SigChgCap,
|
||||
kCumulateData_SigChgEnergy,
|
||||
|
||||
kCumulateData_DayDisCap,
|
||||
kCumulateData_DayDisEnergy,
|
||||
kCumulateData_DayChgCap,
|
||||
kCumulateData_DayChgCap, //10
|
||||
kCumulateData_DayChgEnergy,
|
||||
|
||||
kCumulateData_AccDisTime,
|
||||
kCumulateData_AccDisCap,
|
||||
kCumulateData_AccDisEnergy,
|
||||
kCumulateData_AccChgTime,
|
||||
kCumulateData_AccChgCap,
|
||||
kCumulateData_AccChgCap, //16
|
||||
kCumulateData_AccChgEnergy,
|
||||
kCumulateData_End,
|
||||
}CumulateData;
|
||||
|
|
|
@ -53,7 +53,7 @@ typedef enum
|
|||
void bms_analyse_chg_sop(uint32_t base_time)
|
||||
{
|
||||
static uint16_t dly = 0;
|
||||
bool is_forbid_chg;
|
||||
bool is_forbid_chg;// 充电禁止标志
|
||||
uint16_t fault_cur, end_cur, fault_power, end_power, req_volt, total_volt;
|
||||
uint16_t soc, min_temp, max_temp;
|
||||
int32_t min_temp_cur, max_temp_cur;
|
||||
|
@ -61,7 +61,7 @@ void bms_analyse_chg_sop(uint32_t base_time)
|
|||
soc = bms_get_soc() / 100;
|
||||
min_temp = (int32_t)bms_get_statistic_data(kStatisticData_MinTemp) /10 - 50;
|
||||
max_temp = (int32_t)bms_get_statistic_data(kStatisticData_MaxTemp) /10 - 50;
|
||||
total_volt = bms_get_statistic_data(kStatisticData_TotalVolt) > 300 ? bms_get_statistic_data(kStatisticData_TotalVolt):300;
|
||||
total_volt = bms_get_statistic_data(kStatisticData_TotalVolt) > 300 ? bms_get_statistic_data(kStatisticData_TotalVolt):300;//534
|
||||
|
||||
if(get_eeprom_data(kEep_ChgDisMode_HighVoltStrategy, kEepromDataType_High) == kChgMode_CP)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ void bms_analyse_chg_sop(uint32_t base_time)
|
|||
}
|
||||
else
|
||||
{
|
||||
end_power = sop_item.rate_data[kSopData_ChgPower];
|
||||
end_power = sop_item.rate_data[kSopData_ChgPower];//50
|
||||
end_cur = (uint32_t)sop_item.rate_data[kSopData_ChgPower] * 10000/total_volt;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,8 @@ void task_100ms_handler(uint32_t base_time)
|
|||
static uint32_t cout100ms = 0;
|
||||
cout100ms++;
|
||||
bms_poll_iso(base_time);
|
||||
//bms_poll_adc(base_time);
|
||||
//bms_poll_adc(); THis was originally commented.
|
||||
bms_poll_adc(base_time);
|
||||
bms_poll_statistic(base_time);
|
||||
bms_poll_run_status(base_time);
|
||||
bms_poll_sop(base_time);
|
||||
|
@ -68,7 +69,7 @@ void task_100ms_handler(uint32_t base_time)
|
|||
}
|
||||
|
||||
|
||||
GLOBAL_TASK_VARS_CCM(poll_1ms_task, 4, 10, 5000, 400, poll_1ms_task_init, task_1ms_handler, NULL);
|
||||
GLOBAL_TASK_VARS_CCM(poll_1ms_task, 4, 100, 5000, 400, poll_1ms_task_init, task_1ms_handler, NULL);
|
||||
GLOBAL_TASK_VARS_CCM(poll_100ms_task, 1, 100, 2000, 400, NULL, task_100ms_handler, NULL);
|
||||
|
||||
GLOBAL_TASK_VARS_CCM(poll_10ms_task, 3, 100, 2000, 400, poll_10ms_task_init, task_10ms_handler, NULL);
|
||||
|
@ -99,35 +100,42 @@ void poll_1ms_task_init(void)
|
|||
|
||||
bms_init_gpio();
|
||||
bms_init_eeprom();
|
||||
//bms_init_adc(); THis was originally commented.
|
||||
//bms_init_adc();
|
||||
bms_init_tag();
|
||||
bms_init_run();
|
||||
bms_init_comm();
|
||||
|
||||
//2-17 new add
|
||||
//task_dido_ctrl_handle(1000);
|
||||
|
||||
bms_init_di_do(bmsCircuitCtrl, kDoCtrlStrategy_End, doLogicArray);
|
||||
bsp_create_task(&poll_10ms_task, (uint8_t *)"10ms");
|
||||
|
||||
KIT_DEBUG_PRINTF("cur_hv init start \r\n");
|
||||
//KIT_DEBUG_PRINTF("cur_hv init start \r\n");
|
||||
|
||||
//debug here is no more run
|
||||
bms_init_cur_hv();
|
||||
bms_init_cur_hv();
|
||||
|
||||
KIT_DEBUG_PRINTF("cur_hv init ok \r\n");
|
||||
//KIT_DEBUG_PRINTF("cur_hv init ok \r\n");
|
||||
|
||||
while(KIT_GET_BIT_32(is_data_ok, BMU_FINISH_BIT) == 0)
|
||||
{
|
||||
bsp_task_delay_ms(10);
|
||||
}
|
||||
//耗时初始化 ≈300ms 确保信号正常
|
||||
KIT_DEBUG_PRINTF("signal init start \r\n");
|
||||
//KIT_DEBUG_PRINTF("signal init start \r\n");
|
||||
|
||||
bms_poll_statistic(0);
|
||||
|
||||
bms_init_signal();
|
||||
//刷新信号策略 确保例如常闭等需要立即闭合do输出
|
||||
task_dido_ctrl_handle(1000);
|
||||
KIT_DEBUG_PRINTF("signal init ok \r\n");
|
||||
//KIT_DEBUG_PRINTF("signal init ok \r\n");
|
||||
KIT_SET_BIT_MASK_32(is_data_ok, SIGNAL_FINISH_BIT);
|
||||
bsp_create_task(&ord_ctrl_task, (uint8_t *)"ctrl");
|
||||
|
||||
|
||||
}
|
||||
|
||||
void poll_10ms_task_init(void)
|
||||
|
@ -146,7 +154,8 @@ void poll_10ms_task_init(void)
|
|||
drv_misc_cfg_pwr_off_interrupt(APP_CFG_INT_PRIO_PWR_OFF, kPwrOffVolt_2_9, bms_pwr_off_save);
|
||||
|
||||
KIT_SET_BIT_MASK_32(is_data_ok, BMU_FINISH_BIT);
|
||||
//while(KIT_GET_BIT_32(is_data_ok, SIGNAL_FINISH_BIT) == 0)
|
||||
//next line is originally commented.
|
||||
while(KIT_GET_BIT_32(is_data_ok, SIGNAL_FINISH_BIT) == 0)
|
||||
{
|
||||
bsp_task_delay_ms(10);
|
||||
}
|
||||
|
@ -156,7 +165,8 @@ void poll_10ms_task_init(void)
|
|||
|
||||
bms_init_sop();
|
||||
bms_init_iso();
|
||||
//bsp_create_task(&poll_100ms_task, (uint8_t *)"100ms");
|
||||
//bsp_create_task(&poll_100ms_task, (uint8_t *)"100ms");,THis was originally commented.
|
||||
bsp_create_task(&poll_100ms_task, (uint8_t *)"100ms");
|
||||
bsp_create_task(&bms_poll_bmu_task, (uint8_t *)"100ms");
|
||||
bsp_create_task(&ord_comm_can_task, (uint8_t *)"100ms");
|
||||
bsp_create_task(&modbus_rtu_task1, (uint8_t *)"inter_modbus");
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -10,8 +10,8 @@
|
|||
<TargetName>stm32f407</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pArmCC>5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7</pArmCC>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7</pCCUsed>
|
||||
<pArmCC>5060960::V5.06 update 7 (build 960)::.\ARMCC</pArmCC>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
|
@ -50,7 +50,7 @@
|
|||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\Objects\</OutputDirectory>
|
||||
<OutputName>BCU_APP</OutputName>
|
||||
<OutputName>BCU_APP2</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
|
@ -83,7 +83,7 @@
|
|||
<AfterMake>
|
||||
<RunUserProg1>1</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name>fromelf --m32combined --output=@L.s19 .\Objects\@L.axf</UserProg1Name>
|
||||
<UserProg1Name>D:\Soft\Setup\Keil\ARM\ARM_Compiler_5.06u7\bin\fromelf.exe --bin -o D:\Code\BMS\BCU\app/BCU_APP2.bin D:\Code\BMS\BCU\app/BCU_APP2.axf"</UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
|
@ -187,7 +187,6 @@
|
|||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<nBranchProt>0</nBranchProt>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
|
@ -634,6 +633,11 @@
|
|||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\library\drv_peripheral\drv_w5500.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>drv_eg25gminipice.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\library\drv_peripheral\drv_eg25gminipice.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
|
@ -643,57 +647,6 @@
|
|||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\main.c</FilePath>
|
||||
<FileOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>2</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>2</AlwaysBuild>
|
||||
<GenerateAssemblyFile>2</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>2</AssembleAssemblyFile>
|
||||
<PublicsOnly>2</PublicsOnly>
|
||||
<StopOnExitCode>11</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<FileArmAds>
|
||||
<Cads>
|
||||
<interw>2</interw>
|
||||
<Optim>0</Optim>
|
||||
<oTime>2</oTime>
|
||||
<SplitLS>2</SplitLS>
|
||||
<OneElfS>2</OneElfS>
|
||||
<Strict>2</Strict>
|
||||
<EnumInt>2</EnumInt>
|
||||
<PlainCh>2</PlainCh>
|
||||
<Ropi>2</Ropi>
|
||||
<Rwpi>2</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>2</uThumb>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<uC99>2</uC99>
|
||||
<uGnu>2</uGnu>
|
||||
<useXO>2</useXO>
|
||||
<v6Lang>0</v6Lang>
|
||||
<v6LangP>0</v6LangP>
|
||||
<vShortEn>2</vShortEn>
|
||||
<vShortWch>2</vShortWch>
|
||||
<v6Lto>2</v6Lto>
|
||||
<v6WtE>2</v6WtE>
|
||||
<v6Rtti>2</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
</FileArmAds>
|
||||
</FileOption>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>task_register.c</FileName>
|
||||
|
@ -709,57 +662,6 @@
|
|||
<FileName>bmu_manager.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\bmu_manager.c</FilePath>
|
||||
<FileOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>2</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>2</AlwaysBuild>
|
||||
<GenerateAssemblyFile>2</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>2</AssembleAssemblyFile>
|
||||
<PublicsOnly>2</PublicsOnly>
|
||||
<StopOnExitCode>11</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<FileArmAds>
|
||||
<Cads>
|
||||
<interw>2</interw>
|
||||
<Optim>0</Optim>
|
||||
<oTime>2</oTime>
|
||||
<SplitLS>2</SplitLS>
|
||||
<OneElfS>2</OneElfS>
|
||||
<Strict>2</Strict>
|
||||
<EnumInt>2</EnumInt>
|
||||
<PlainCh>2</PlainCh>
|
||||
<Ropi>2</Ropi>
|
||||
<Rwpi>2</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>2</uThumb>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<uC99>2</uC99>
|
||||
<uGnu>2</uGnu>
|
||||
<useXO>2</useXO>
|
||||
<v6Lang>0</v6Lang>
|
||||
<v6LangP>0</v6LangP>
|
||||
<vShortEn>2</vShortEn>
|
||||
<vShortWch>2</vShortWch>
|
||||
<v6Lto>2</v6Lto>
|
||||
<v6WtE>2</v6WtE>
|
||||
<v6Rtti>2</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
</FileArmAds>
|
||||
</FileOption>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>comm_manager.c</FileName>
|
||||
|
@ -786,6 +688,11 @@
|
|||
<FileType>1</FileType>
|
||||
<FilePath>..\app\fault_manager.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ocv_tables.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\ocv_tables.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>fault_register.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
|
@ -831,11 +738,6 @@
|
|||
<FileType>1</FileType>
|
||||
<FilePath>..\app\logic_same_circuit_ctrl.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ocv_tables.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\ocv_tables.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>run_status.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
|
@ -861,16 +763,16 @@
|
|||
<FileType>1</FileType>
|
||||
<FilePath>..\app\statistic_manager.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>version_manager.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\version_manager.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>bmu_adbms1818.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\bmu_adbms1818.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>version_manager.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\version_manager.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
|
@ -1315,7 +1217,6 @@
|
|||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<nBranchProt>0</nBranchProt>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
|
@ -1693,6 +1594,11 @@
|
|||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\library\drv_peripheral\drv_w5500.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>drv_eg25gminipice.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\library\drv_peripheral\drv_eg25gminipice.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
|
@ -1743,6 +1649,11 @@
|
|||
<FileType>1</FileType>
|
||||
<FilePath>..\app\fault_manager.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ocv_tables.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\ocv_tables.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>fault_register.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
|
@ -1788,11 +1699,6 @@
|
|||
<FileType>1</FileType>
|
||||
<FilePath>..\app\logic_same_circuit_ctrl.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ocv_tables.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\ocv_tables.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>run_status.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
|
@ -1818,16 +1724,16 @@
|
|||
<FileType>1</FileType>
|
||||
<FilePath>..\app\statistic_manager.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>version_manager.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\version_manager.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>bmu_adbms1818.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\bmu_adbms1818.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>version_manager.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\app\version_manager.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
|
@ -2037,4 +1943,13 @@
|
|||
</files>
|
||||
</RTE>
|
||||
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName>BCU_APP</LayName>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
</Layers>
|
||||
</LayerInfo>
|
||||
|
||||
</Project>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -106,7 +106,7 @@ uint16_t bcu_total_msg_fill(uint16_t start_addr, uint8_t reg_num, uint8_t *buf)
|
|||
|
||||
//READ_FC03_F04_ITEM(1, test99+=10);
|
||||
//2 动力电池组总电流
|
||||
READ_FC03_F04_ITEM(2, bms_get_show_current() + 211);
|
||||
READ_FC03_F04_ITEM(2, bms_get_show_current());
|
||||
//3 SOC
|
||||
//READ_FC03_F04_ITEM(3,get_eeprom_data(kEep_SOC,kEepromDataType_Full) / 100);
|
||||
READ_FC03_F04_ITEM(3, bms_get_soc() / 100);
|
||||
|
@ -117,7 +117,7 @@ uint16_t bcu_total_msg_fill(uint16_t start_addr, uint8_t reg_num, uint8_t *buf)
|
|||
//6 额定总压
|
||||
READ_FC03_F04_ITEM(6, get_eeprom_data(kEep_RatedTotalVolt,kEepromDataType_Full));
|
||||
//7 额定容量
|
||||
READ_FC03_F04_ITEM(7, get_eeprom_data(kEep_RatedCapacity,kEepromDataType_Full));
|
||||
READ_FC03_F04_ITEM(7, get_eeprom_data(kEep_RatedCapacity,kEepromDataType_Full) );
|
||||
//8 剩余容量
|
||||
READ_FC03_F04_ITEM(8, (uint32_t)bms_get_soc()*get_eeprom_data(kEep_RatedCapacity, kEepromDataType_Full)/10000);
|
||||
//9 额定电量
|
||||
|
@ -714,8 +714,8 @@ uint16_t bcu_total_cfg_fill(uint16_t start_addr, uint8_t reg_num, uint8_t *buf)
|
|||
case 3146: // 预充超时时间(s)
|
||||
data = get_eeprom_data(kEep_PreChgTimeout_Count , (EepromDataType)(1 - (address % 2)));
|
||||
break;
|
||||
case 3147: // HV电压比例(%)
|
||||
case 3148: // 预充电压比例(%)
|
||||
case 3147: // 预充电压比例(%)
|
||||
case 3148: // 预充类型
|
||||
data = get_eeprom_data(kEep_PreChgVoltType_Rate , (EepromDataType)(1 - (address % 2)));
|
||||
break;
|
||||
case 3149: // 系统时间(s)
|
||||
|
@ -1271,9 +1271,21 @@ BspMdExCode bcu_modbus_485_0x10_fun(uint16_t start_addr, uint16_t reg_num, uint8
|
|||
bcu_data_set_0x06_msg(start_addr + i, data);
|
||||
}
|
||||
}
|
||||
//@wangk , 2-25, add 0x10function(4000~4449)
|
||||
else if((start_addr >= 4000) && (start_addr <= 4449))
|
||||
{
|
||||
uint16_t *reg_data = (uint16_t *)buf;
|
||||
for (uint16_t i = 0; i < reg_num; i++)
|
||||
{
|
||||
uint16_t reg_value = (reg_data[i] >> 8) | (reg_data[i] << 8);
|
||||
uint16_t offset_addr = start_addr - 4000 + i;
|
||||
|
||||
hmi_write_modbus_cfg(offset_addr, reg_value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
err = kBspMdEx_InvalidAddr;
|
||||
err = kBspMdEx_InvalidAddr;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
<TargetName>stm32f407</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pArmCC>5060960::V5.06 update 7 (build 960)::.\ARMCC</pArmCC>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<pArmCC>5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7</pArmCC>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32F407ZGTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<PackID>Keil.STM32F4xx_DFP.3.0.0</PackID>
|
||||
<PackURL>https://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x00020000) IRAM2(0x10000000,0x00010000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
|
@ -139,7 +139,7 @@
|
|||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3></Flash3>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
|
@ -187,6 +187,7 @@
|
|||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<nBranchProt>0</nBranchProt>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -588,8 +588,8 @@ void SystemInit(void)
|
|||
|
||||
/* Configure the System clock source, PLL Multiplier and Divider factors,
|
||||
AHB/APBx prescalers and Flash settings ----------------------------------*/
|
||||
SetSysClock();
|
||||
//SystemClock_Config();
|
||||
//SetSysClock();
|
||||
SystemClock_Config();
|
||||
/* Configure the Vector Table location add offset address ------------------*/
|
||||
#ifdef VECT_TAB_SRAM
|
||||
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -86,7 +86,7 @@ typedef struct
|
|||
uint16_t * data_buf;
|
||||
const EepromDataFormat * format;
|
||||
flash_Item_t *flash;
|
||||
|
||||
|
||||
AreaItem static_area;
|
||||
AreaItem dynamic_area;
|
||||
}EEpromItem;
|
||||
|
|
|
@ -519,7 +519,7 @@ void SystemInit(void)
|
|||
/* Configure the System clock source, PLL Multiplier and Divider factors,
|
||||
AHB/APBx prescalers and Flash settings ----------------------------------*/
|
||||
//SetSysClock();
|
||||
SystemClock_Config();
|
||||
SystemClock_Config();
|
||||
|
||||
/* Configure the Vector Table location add offset address ------------------*/
|
||||
#ifdef VECT_TAB_SRAM
|
||||
|
@ -573,6 +573,7 @@ void SystemCoreClockUpdate(void)
|
|||
#endif /* STM32F412xG || STM32F413_423xx || STM32F446xx */
|
||||
/* Get SYSCLK source -------------------------------------------------------*/
|
||||
tmp = RCC->CFGR & RCC_CFGR_SWS;
|
||||
//tmp = RCC_CFGR_SWS_HSE;
|
||||
|
||||
switch (tmp)
|
||||
{
|
||||
|
@ -711,7 +712,7 @@ void SystemClock_Config(void)
|
|||
RCC->CFGR |= RCC_CFGR_PPRE2_DIV2;
|
||||
|
||||
/* PCLK1 = HCLK / 4 */
|
||||
RCC->CFGR |= RCC_CFGR_PPRE1_DIV4;
|
||||
RCC->CFGR |= RCC_CFGR_PPRE1_DIV8;
|
||||
|
||||
/* Configure the main PLL for 168 MHz using HSI */
|
||||
RCC->PLLCFGR = (16 << 0) // PLL_M = 16 (HSI = 16 MHz input for PLL)
|
||||
|
|
|
@ -611,6 +611,72 @@ int8_t parse_cells(uint8_t current_ic, // Current IC
|
|||
return (pec_error);
|
||||
}
|
||||
|
||||
/* Helper function that parses voltage measurement registers */
|
||||
int8_t drv_parse_temp_data(uint8_t current_ic, // Current IC
|
||||
uint8_t cell_reg, // Type of register
|
||||
uint8_t cell_data[], // Unparsed data
|
||||
uint16_t *cell_codes, // Parsed data
|
||||
uint8_t *ic_pec // PEC error
|
||||
)
|
||||
{
|
||||
uint8_t BYT_IN_REG = 6;
|
||||
uint8_t CELL_IN_REG = 3;
|
||||
int8_t pec_error = 0;
|
||||
uint16_t parsed_cell;
|
||||
uint16_t received_pec;
|
||||
uint16_t data_pec;
|
||||
uint8_t data_counter = current_ic * NUM_RX_BYT; // data counter
|
||||
|
||||
for (uint8_t current_cell = 0; current_cell < CELL_IN_REG; current_cell++) // This loop parses the read back data into the register codes, it
|
||||
{ // loops once for each of the 3 codes in the register
|
||||
|
||||
parsed_cell = cell_data[data_counter] + (cell_data[data_counter + 1] << 8); // Each code is received as two bytes and is combined to
|
||||
// create the parsed code
|
||||
|
||||
if(cell_reg == 1)
|
||||
{
|
||||
cell_codes[current_cell + ((cell_reg - 1) * CELL_IN_REG)] = parsed_cell;
|
||||
}
|
||||
else if(cell_reg == 2)
|
||||
{
|
||||
if(current_cell < 2)
|
||||
{
|
||||
cell_codes[current_cell + 3] = parsed_cell;
|
||||
}
|
||||
}
|
||||
else if(cell_reg == 3)
|
||||
{
|
||||
cell_codes[current_cell + 5] = parsed_cell;
|
||||
}
|
||||
else if(cell_reg == 4)
|
||||
{
|
||||
if(current_cell < 1)
|
||||
{
|
||||
cell_codes[current_cell + 8] = parsed_cell;
|
||||
}
|
||||
}
|
||||
|
||||
data_counter = data_counter + 2; // Because the codes are two bytes, the data counter
|
||||
// must increment by two for each parsed code
|
||||
}
|
||||
received_pec = (cell_data[data_counter] << 8) | cell_data[data_counter + 1]; // The received PEC for the current_ic is transmitted as the 7th and 8th
|
||||
// after the 6 cell voltage data bytes
|
||||
data_pec = pec15_calc(BYT_IN_REG, &cell_data[(current_ic)*NUM_RX_BYT]);
|
||||
|
||||
if (received_pec != data_pec)
|
||||
{
|
||||
pec_error = 1; // The pec_error variable is simply set negative if any PEC errors
|
||||
ic_pec[cell_reg - 1] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ic_pec[cell_reg - 1] = 0;
|
||||
}
|
||||
data_counter = data_counter + 2;
|
||||
|
||||
return (pec_error);
|
||||
}
|
||||
|
||||
/*Reads and parses the ADBMS181x cell voltage registers.
|
||||
The function is used to read the parsed Cell voltages codes of the ADBMS181x.
|
||||
This function will send the requested read commands parse the data
|
||||
|
@ -767,7 +833,7 @@ int8_t ADBMS1818_rdaux(uint8_t reg, // Determines which GPIO voltage register
|
|||
{
|
||||
c_ic = total_ic - current_ic - 1;
|
||||
}
|
||||
pec_error = parse_cells(current_ic, gpio_reg, data,
|
||||
pec_error = drv_parse_temp_data(current_ic, gpio_reg, data,
|
||||
&ic[c_ic].aux.a_codes[0],
|
||||
&ic[c_ic].aux.pec_match[0]);
|
||||
}
|
||||
|
@ -787,7 +853,7 @@ int8_t ADBMS1818_rdaux(uint8_t reg, // Determines which GPIO voltage register
|
|||
{
|
||||
c_ic = total_ic - current_ic - 1;
|
||||
}
|
||||
pec_error = parse_cells(current_ic, reg, data,
|
||||
pec_error = drv_parse_temp_data(current_ic, reg, data,
|
||||
&ic[c_ic].aux.a_codes[0],
|
||||
&ic[c_ic].aux.pec_match[0]);
|
||||
}
|
||||
|
|
|
@ -28,40 +28,67 @@ uint8_t drv_ads8688_spi_send_rev(uint8_t data)
|
|||
// 返回TURE则说明初始化正常,否则错误
|
||||
bool drv_ads8688_Init(void)
|
||||
{
|
||||
uint8_t i = 0;
|
||||
uint8_t i = 0, value = 0;
|
||||
drv_spi_init(kSpiDev_2, kSpiFreq_Div256, kSpiMode_C0E1, SpiFrame_MSBFirst, kGpioType_ADC_Clk, kGpioType_ADC_Miso, kGpioType_ADC_Mosi);
|
||||
//drv_ads8688_Reset();// hardware reset
|
||||
|
||||
drv_enter_pwrdn_mode();
|
||||
OSTimeDly(20);
|
||||
|
||||
drv_reset_ads8688();
|
||||
kit_time_dly_ms(20);
|
||||
|
||||
drv_enter_standby_mode();
|
||||
OSTimeDly(20);
|
||||
drv_reset_ads8688();
|
||||
OSTimeDly(20);
|
||||
drv_set_ch_range(Channel_0_Input_Range,VREF_25_25);
|
||||
drv_set_ch_range(Channel_1_Input_Range,VREF_25_25);
|
||||
drv_set_ch_range(Channel_2_Input_Range,VREF_25_25);
|
||||
drv_set_ch_range(Channel_3_Input_Range,VREF_25_25);
|
||||
drv_set_ch_range(Channel_4_Input_Range,VREF_25_25);
|
||||
drv_set_ch_range(Channel_5_Input_Range,VREF_25_25);
|
||||
kit_time_dly_ms(20);
|
||||
|
||||
drv_set_ch_pwrdn(Channel_6_Input_Range);
|
||||
drv_set_ch_pwrdn(Channel_7_Input_Range);
|
||||
//drv_enter_pwrdn_mode();
|
||||
//OSTimeDly(20);
|
||||
|
||||
drv_ads8688_write_reg(AUTO_SEQ_EN, 0x3F);
|
||||
drv_ads8688_write_reg(AUTO_SEQ_EN, 0xFF);
|
||||
kit_time_dly_ms(10);
|
||||
|
||||
i = drv_ads8688_read_reg(AUTO_SEQ_EN);
|
||||
drv_ads8688_write_reg(Feature_Select, 0x28);
|
||||
kit_time_dly_ms(20);
|
||||
|
||||
if (i != 0x3F)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
drv_enter_auto_rst_mode(); // ½øÈë×Ô¶¯É¨Ãèģʽ
|
||||
OSTimeDly(20);
|
||||
return false;
|
||||
}
|
||||
drv_set_ch_range(Channel_0_Input_Range,VREF_125_125);
|
||||
drv_set_ch_range(Channel_1_Input_Range,VREF_125_125);
|
||||
drv_set_ch_range(Channel_2_Input_Range,VREF_0625_0625);
|
||||
drv_set_ch_range(Channel_3_Input_Range,VREF_125_125);
|
||||
drv_set_ch_range(Channel_4_Input_Range,VREF_125_125);
|
||||
drv_set_ch_range(Channel_5_Input_Range,VREF_125_125);
|
||||
drv_set_ch_range(Channel_6_Input_Range,VREF_125_125);
|
||||
drv_set_ch_range(Channel_7_Input_Range,VREF_125_125);
|
||||
|
||||
//value = drv_ads8688_read_reg(Channel_0_Input_Range);
|
||||
|
||||
drv_set_ch_pwrdn(0xC0);
|
||||
|
||||
//
|
||||
|
||||
#if ADC_AUTO_MODE
|
||||
{
|
||||
drv_ads8688_write_reg(AUTO_SEQ_EN, 0x3F);
|
||||
i = drv_ads8688_read_reg(AUTO_SEQ_EN);
|
||||
|
||||
if (i != 0x3F)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
drv_enter_auto_rst_mode(); // ½øÈë×Ô¶¯É¨Ãèģʽ
|
||||
OSTimeDly(20);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
drv_manual_chn_mode(MAN_Ch_0);
|
||||
drv_manual_chn_mode(MAN_Ch_1);
|
||||
drv_manual_chn_mode(MAN_Ch_2);
|
||||
drv_manual_chn_mode(MAN_Ch_3);
|
||||
drv_manual_chn_mode(MAN_Ch_4);
|
||||
drv_manual_chn_mode(MAN_Ch_5);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void drv_ads8688_Reset(void) // hardware reset
|
||||
|
@ -107,7 +134,8 @@ void drv_reset_ads8688(void) //
|
|||
// 退出此模式需执行AUTO_RST或者MAN_CH_n命令,且需要等待至少20us以保证正常数据的AD转换
|
||||
void drv_enter_standby_mode(void)
|
||||
{
|
||||
drv_ads8688_write_cmd_reg(STDBY);
|
||||
//drv_ads8688_write_cmd_reg(STDBY);
|
||||
drv_ads8688_write_cmd_reg(NO_OP);
|
||||
}
|
||||
|
||||
// 进入PWR_DN模式,且命令发送后CS立刻置高,不读数据帧;
|
||||
|
@ -156,7 +184,7 @@ uint16_t drv_manual_chn_mode_Data(void)
|
|||
datah = drv_ads8688_spi_send_rev(0xFF);
|
||||
datal = drv_ads8688_spi_send_rev(0xFF);
|
||||
drv_set_ads8688_cs(kGpioStatus_High);
|
||||
|
||||
kit_time_dly_ms(10);
|
||||
return (datah << 8 | datal);
|
||||
}
|
||||
|
||||
|
@ -177,17 +205,16 @@ void drv_ads8688_write_reg(uint8_t Addr, uint8_t data)
|
|||
}
|
||||
|
||||
// Program Register读操作
|
||||
uint8_t drv_ads8688_read_reg(uint8_t Addr)
|
||||
uint16_t drv_ads8688_read_reg(uint8_t Addr)
|
||||
{
|
||||
uint8_t data = 0;
|
||||
|
||||
uint8_t datah = 0,datal = 0;
|
||||
drv_set_ads8688_cs(kGpioStatus_Low);
|
||||
drv_ads8688_spi_send_rev(Addr << 1 | READ);
|
||||
data = drv_ads8688_spi_send_rev(0xFF);
|
||||
data = drv_ads8688_spi_send_rev(0xFF);
|
||||
datah = drv_ads8688_spi_send_rev(0xFF);
|
||||
datal = drv_ads8688_spi_send_rev(0xFF);
|
||||
drv_set_ads8688_cs(kGpioStatus_High);
|
||||
|
||||
return data;
|
||||
return datal + (datah << 8);
|
||||
}
|
||||
|
||||
void drv_set_auto_scan_sequence(uint8_t seq) // 设置自动扫描序列通道
|
||||
|
@ -198,11 +225,13 @@ void drv_set_auto_scan_sequence(uint8_t seq) //
|
|||
void drv_set_ch_pwrdn(uint8_t chn) // 设置通道n为Power Down
|
||||
{
|
||||
drv_ads8688_write_reg(0X02, chn);
|
||||
|
||||
}
|
||||
|
||||
void drv_set_ch_range(uint8_t ch, uint8_t range) // 设置各个通道的范围
|
||||
{
|
||||
drv_ads8688_write_reg(ch, range);
|
||||
kit_time_dly_ms(20);
|
||||
}
|
||||
|
||||
int16_t drv_ads8688_value(uint16_t value)
|
||||
|
|
|
@ -84,7 +84,8 @@ kGpioType_ADC_Cs
|
|||
#define VREF_0_25 0X05
|
||||
#define VREF_0_125 0X06
|
||||
|
||||
typedef struct
|
||||
#define ADC_AUTO_MODE 0
|
||||
typedef struct
|
||||
{
|
||||
uint8_t cs;
|
||||
SpiDev spi;
|
||||
|
@ -112,7 +113,7 @@ void drv_enter_auto_rst_mode(void);
|
|||
void drv_enter_auto_rst_mode_Data(uint16_t* outputdata, uint8_t chnum);
|
||||
|
||||
void drv_ads8688_write_reg(uint8_t Addr,uint8_t data);
|
||||
uint8_t drv_ads8688_read_reg(uint8_t Addr);
|
||||
uint16_t drv_ads8688_read_reg(uint8_t Addr);
|
||||
void drv_set_auto_scan_sequence(uint8_t seq);
|
||||
void drv_set_ch_pwrdn(uint8_t chn);
|
||||
void drv_set_ch_range(uint8_t ch,uint8_t range);
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
/******************************************************************************
|
||||
* @file drv_eg25gminipice.c
|
||||
* @brief drv_eg25gminipice.c drivers
|
||||
* @version V1.0
|
||||
* @author Gary
|
||||
* @copyright
|
||||
******************************************************************************/
|
||||
|
||||
#include "drv_eg25gminipice.h"
|
||||
|
||||
#define UART2_BAUDRATE 115200
|
||||
#define MAX_RETRY 3
|
||||
|
||||
//4G实例化
|
||||
static uint8_t sim_rec_buf[MAX_RECV_LEN] = {0};
|
||||
LTE4G_STATIC_INIT(sim_item, 1, 0, 0, 1024,sim_rec_buf);
|
||||
|
||||
|
||||
void drv_sim_push_data(Lte4GItem* item, uint8_t *buf, uint16_t len)
|
||||
{
|
||||
uint16_t i = 0;
|
||||
|
||||
if((item != NULL) && (item->buf_pos + len < item->buf_size))
|
||||
{
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
item->buf[item->buf_pos++] = buf[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void drv_uart2_Init(void)
|
||||
{
|
||||
RCC->APB1ENR |= RCC_APB1ENR_USART2EN; // 使能 USART2 时钟
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN; // 使能 GPIOA 时钟
|
||||
|
||||
GPIOA->MODER |= (2 << (2 * 2)) | (2 << (3 * 2)); // PA2(TX), PA3(RX) 复用模式
|
||||
GPIOA->AFR[0] |= (7 << (2 * 4)) | (7 << (3 * 4)); // 复用 AF7 (USART2)
|
||||
|
||||
USART2->BRR = SystemCoreClock / UART2_BAUDRATE;
|
||||
USART2->CR1 = USART_CR1_TE | USART_CR1_RE | USART_CR1_UE; // 使能串口、发送和接收
|
||||
}
|
||||
|
||||
void drv_uart2_sendbyte(char c)
|
||||
{
|
||||
while (!(USART2->SR & USART_SR_TXE)); // 等待发送完成
|
||||
USART2->DR = c;
|
||||
}
|
||||
|
||||
void drv_uart2_sendString(const char *str)
|
||||
{
|
||||
while (*str) {
|
||||
drv_uart2_sendbyte(*str++);
|
||||
}
|
||||
}
|
||||
|
||||
void drv_send_at_cmd(const char *cmd, int delay_ms)
|
||||
{
|
||||
drv_uart2_sendString(cmd);
|
||||
drv_uart2_sendString("\r\n"); // AT 指令以 "\r\n" 结尾
|
||||
kit_time_dly_ms(30);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void drv_eg25g_init(void)
|
||||
{
|
||||
drv_send_at_cmd("AT", 500); // 1. 测试 AT 指令
|
||||
drv_send_at_cmd("AT+CPIN?", 500); // 2. 查询 SIM 卡状态
|
||||
drv_send_at_cmd("AT+COPS=0", 500); // 3. 让模块自动选择运营商
|
||||
drv_send_at_cmd("AT+CEREG?", 1000); // 4. 查询 4G 注册状态
|
||||
// drv_send_at_cmd("AT+CGDCONT=1,\"IP\",\"your_apn\"", 500); // 5. 设置 APN 如果支持自动识别则不需要设置apn
|
||||
drv_send_at_cmd("AT+CGACT=1,1", 1000); // 6. 激活 PDP(获取 IP)
|
||||
drv_send_at_cmd("AT+CGPADDR=1", 500); // 7. 查询分配的 IP 地址
|
||||
}
|
||||
|
||||
// 发送 AT 指令并等待返回值,可用于此优化初始化函数
|
||||
int drv_send_at_cmd2(const char *cmd, int delay_ms)
|
||||
{
|
||||
for (int i = 0; i < MAX_RETRY; i++) // 失败最多重试 MAX_RETRY 次
|
||||
{
|
||||
drv_uart2_sendString(cmd);
|
||||
drv_uart2_sendString("\r\n"); // AT 指令以 "\r\n" 结尾
|
||||
kit_time_dly_ms(30);
|
||||
|
||||
if (sim_item.buf_pos > 0 && strstr((const char*)sim_item.buf, "OK")) // 解析返回值
|
||||
{
|
||||
return 1; // 成功
|
||||
}
|
||||
}
|
||||
return 0; // 失败
|
||||
}
|
||||
|
||||
void drv_eg25g_init2(void)
|
||||
{
|
||||
if (!drv_send_at_cmd2("AT", 500)) return; // 1. 测试 AT 指令
|
||||
if (!drv_send_at_cmd2("AT+CPIN?", 500)) return; // 2. 查询 SIM 卡状态
|
||||
if (!drv_send_at_cmd2("AT+COPS=0", 500)) return; // 3. 让模块自动选择运营商
|
||||
if (!drv_send_at_cmd2("AT+CEREG?", 1000)) return; // 4. 查询 4G 注册状态
|
||||
if (!drv_send_at_cmd2("AT+CGDCONT=1,\"IP\",\"your_apn\"", 500)) return; // 5. 设置 APN
|
||||
if (!drv_send_at_cmd2("AT+CGACT=1,1", 1000)) return; // 6. 激活 PDP(获取 IP)
|
||||
if (!drv_send_at_cmd2("AT+CGPADDR=1", 500)) return; // 7. 查询分配的 IP 地址
|
||||
}
|
||||
|
||||
void drv_mqtt_connect(void)
|
||||
{
|
||||
drv_send_at_cmd("AT+QMTCFG=\"recv/mode\",0,0,1", 500);
|
||||
drv_send_at_cmd("AT+QMTOPEN=0,\"mqtt.example.com\",1883", 5000);
|
||||
drv_send_at_cmd("AT+QMTCONN=0,\"client_id\",\"username\",\"password\"", 5000);
|
||||
}
|
||||
|
||||
void drv_mqtt_publish(const char *topic, const char *message)
|
||||
{
|
||||
char cmd[128];
|
||||
sprintf(cmd, "AT+QMTPUB=0,0,0,0,\"%s\",\"%s\"", topic, message);
|
||||
drv_send_at_cmd(cmd, 500);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
int main(void) {
|
||||
SystemInit();
|
||||
drv_uart2_Init();
|
||||
drv_eg25g_init();
|
||||
drv_mqtt_connect();
|
||||
|
||||
while (1)
|
||||
{
|
||||
drv_mqtt_publish("sensor/data", "{\"temperature\":25.3}");
|
||||
for (volatile int i = 0; i < 10000000; i++); // 发送间隔
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
/******************************************************************************
|
||||
* @file drv_eg25gminipice.h
|
||||
* @brief drv_eg25gminipice drivers
|
||||
* @version V1.0
|
||||
* @author Gary
|
||||
* @copyright
|
||||
******************************************************************************/
|
||||
#ifndef DRV_EG25GMINIPICE_H_
|
||||
#define DRV_EG25GMINIPICE_H_
|
||||
|
||||
#include "drv_gpio.h"
|
||||
#include "stm32f4xx.h"
|
||||
#include "bsp_task.h"
|
||||
|
||||
#include "kit_time.h"
|
||||
#include "kit_data.h"
|
||||
#include "kit_debug.h"
|
||||
|
||||
#include "ucos_ii.h"
|
||||
#include "string.h"
|
||||
|
||||
#define MAX_RECV_LEN 1024
|
||||
|
||||
|
||||
//¶¨ÒåÄ£×é4G½á¹¹
|
||||
typedef struct _Lte4GItem
|
||||
{
|
||||
uint8_t addr;
|
||||
uint8_t comm_dev;
|
||||
uint16_t buf_pos;
|
||||
uint16_t buf_size;
|
||||
uint8_t *buf;
|
||||
} Lte4GItem;
|
||||
|
||||
#define LTE4G_STATIC_INIT(_name, _addr, _comm_dev, _buf_pos, _buf_size,_recv) \
|
||||
Lte4GItem _name = \
|
||||
{ \
|
||||
(_addr), \
|
||||
(_comm_dev), \
|
||||
(_buf_pos),\
|
||||
(_buf_size),\
|
||||
(_recv),\
|
||||
}
|
||||
|
||||
extern Lte4GItem sim_item;
|
||||
|
||||
void drv_uart2_Init(void);
|
||||
void drv_uart2_sendbyte(char c);
|
||||
void drv_uart2_sendString(const char *str);
|
||||
void drv_send_at_cmd(const char *cmd, int delay_ms);
|
||||
void drv_eg25g_init(void);
|
||||
void drv_mqtt_connect(void);
|
||||
void drv_mqtt_publish(const char *topic, const char *message);
|
||||
void drv_sim_push_data(Lte4GItem* item, uint8_t *buf, uint16_t len);
|
||||
|
||||
|
||||
|
||||
#endif //DRV_EG25GMINIPICE_H_
|
||||
|
||||
|
Loading…
Reference in New Issue