2024-12-06 09:38:25 +00:00
|
|
|
|
#ifndef BL_PARAMETER_H_
|
|
|
|
|
#define BL_PARAMETER_H_
|
|
|
|
|
|
|
|
|
|
#include "main.h"
|
2024-12-07 09:52:46 +00:00
|
|
|
|
#include "comm_types.h"
|
2024-12-24 06:43:20 +00:00
|
|
|
|
#include "chargControlTypes.h"
|
2025-01-04 09:50:05 +00:00
|
|
|
|
#include "configParameter.h"
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
2024-12-07 09:52:46 +00:00
|
|
|
|
// #pragma pack(push,1)
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
|
|
|
|
/* 主要有配置文件读取出来的数据 */
|
|
|
|
|
typedef struct _config_parameter{
|
2025-01-08 09:50:37 +00:00
|
|
|
|
uint8_t uniqueDeviceID[7]; /* 设备唯一ID */
|
|
|
|
|
|
|
|
|
|
uint32_t gw485_Baud; /* 串口波特率 */
|
|
|
|
|
uint32_t bat485_Baud; /* 串口波特率,为0代表bms不支持通信 */
|
2025-01-21 10:02:52 +00:00
|
|
|
|
uint8_t powerBoxType; /* 是否只充当电源板:0x00:不是;0xFF:是*/
|
2025-01-08 09:50:37 +00:00
|
|
|
|
float constantVoltageV; /* 恒压充电阈值电压(V) */
|
|
|
|
|
float floatI; /* 浮充充电阈值电流(A) */
|
|
|
|
|
float startSolarOpenCircuitV; /* 启动充电太阳能板开路电压(V) */
|
|
|
|
|
float stopSolarOutputCircuitV; /* 停止充电太阳能板输出电压(V) */
|
|
|
|
|
uint16_t checkCanStartTime; /* 检测能否启动间隔时间(S) */
|
|
|
|
|
uint16_t shortCircuitJudgmentDelay; /* 短路判断延时(S) */
|
|
|
|
|
uint16_t inputPowerLowJudgmentDelay; /* 前端输入功率不足判断延时(S) */
|
|
|
|
|
uint16_t inputPowerLowAgainOutputDelay; /* 前端输入功率不足再次输出延时(S) */
|
|
|
|
|
uint16_t firstStageProtectionDelay; /* 第一段保护延时(10uS) */
|
|
|
|
|
float firstStageProtectionCurr; /* 第一段保护电流(A) */
|
|
|
|
|
uint16_t firstStageProtectionValue; /* 第一段保护ADC值 */
|
|
|
|
|
uint16_t secondStageProtectionDelay; /* 第二段保护延时(100uS) */
|
|
|
|
|
float secondStageProtectionCurr; /* 第二段保护电流(A) */
|
2025-01-21 10:02:52 +00:00
|
|
|
|
uint32_t thirdStageProtectionDelay; /* 第三段保护延时(100uS) */
|
2025-01-08 09:50:37 +00:00
|
|
|
|
float thirdStageProtectionCurr; /* 第三段保护电流(A) */
|
|
|
|
|
uint16_t inputPowerLowDetectionDelay; /* 前端输入功率不足检测延时(100uS) */
|
|
|
|
|
float inputPowerLowDetectionVolt; /* 前端输入功率不足检测电压(V) */
|
|
|
|
|
float maxOpenSolarOutputCircuitV; /* 最大太阳能板输出电压(V) */
|
|
|
|
|
float maxChargCurr; /* 最大充电电流(A) */
|
|
|
|
|
float minCheckLoopImpedanceChargCurr; /* 检测回路阻抗时的最小充电电流(A) */
|
|
|
|
|
float fullPowerOutputTemperature; /* 满功率输出温度(℃) */
|
|
|
|
|
float reducePowerOutputTemperature; /* 降功率输出温度(℃) */
|
|
|
|
|
float stopPowerOutputTemperature; /* 停止输出温度(℃) */
|
|
|
|
|
float constantVoltageChargeV; /* 恒压充电时的输出电压(V) */
|
|
|
|
|
float FloatChargeV; /* 浮充充电时的输出电压(V) */
|
|
|
|
|
uint16_t collectOpenCircuitVoltageTime; /* 充电时采集开路电压的间隔时间 */
|
2025-01-21 10:02:52 +00:00
|
|
|
|
float reverseChargProtectionCurr; /* 反向充电保护电流 */
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
|
|
|
|
/* SL */
|
|
|
|
|
uint16_t Access_Node_Type; /* 接入节点类型 */
|
|
|
|
|
uint16_t Communication_Methods; /* 通信方式 */
|
|
|
|
|
uint8_t startFlagSL[2]; /* 起始标志 */
|
|
|
|
|
uint8_t endFlagSL; /* 结束标志 */
|
|
|
|
|
} config_parameter;
|
|
|
|
|
extern config_parameter g_cfgParameter;
|
|
|
|
|
typedef struct _otherParameter{
|
|
|
|
|
float Battery_Voltage; /* 电池电压 (V) */
|
|
|
|
|
float Output_Voltage; /* 输出电压 */
|
|
|
|
|
float Charg_Current; /* 充电电流(流向电池+负载) (A) */
|
|
|
|
|
float Discharg_Current; /* 放电电流(流向负载) (A) */
|
|
|
|
|
float Input_Voltage; /* 系统输入电压 (V) */
|
|
|
|
|
float Solar_Open_Circuit_Voltage; /* 太阳能板开路电压 (V) */
|
|
|
|
|
float HighSideMos_Temperature; /* 高端mos的温度 (°C) */
|
|
|
|
|
float Solar_In_Circuit_Voltage; /* 太阳能板输入电压 (V) */
|
|
|
|
|
|
|
|
|
|
float totalElectricityConsumption; /* 总电量消耗(W*H) */
|
|
|
|
|
float totalChargCapacity; /* 总充电电量(W*H) */
|
|
|
|
|
float SOC; /* 剩余电量 */
|
|
|
|
|
|
2024-12-09 09:53:43 +00:00
|
|
|
|
int MPPT_Mode; /* 工作模式 */
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
2025-01-08 09:50:37 +00:00
|
|
|
|
uint8_t versionInformation[13]; /* 软件版本信息 */
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
2025-01-08 09:50:37 +00:00
|
|
|
|
float loopImpedance; /* 回路阻抗大小 (Ω) */
|
|
|
|
|
|
|
|
|
|
uint16_t Registration_Status; /* 注册状态 */
|
2024-12-06 09:38:25 +00:00
|
|
|
|
}otherParameter;
|
2024-12-07 09:52:46 +00:00
|
|
|
|
|
|
|
|
|
// #pragma pack(pop)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL getBatteryState(void);
|
|
|
|
|
void setBatteryState(BOOL state);
|
|
|
|
|
float getDutyRatio(void);
|
|
|
|
|
void setDutyRatio(float DutyRatio);
|
|
|
|
|
void setDutyRatioToZero(void);
|
2024-12-11 09:51:48 +00:00
|
|
|
|
uint8_t getMosTemperState(void);
|
|
|
|
|
void setMosTemperState(uint8_t state);
|
|
|
|
|
BOOL getCheckImpedanceState(void);
|
|
|
|
|
void setCheckImpedanceState(void);
|
2024-12-24 06:43:20 +00:00
|
|
|
|
void setLastTime(timeInfo time);
|
|
|
|
|
timeInfo getLastTime(void);
|
2024-12-07 09:52:46 +00:00
|
|
|
|
|
|
|
|
|
float getBatteryVoltage(void);
|
|
|
|
|
void setBatteryVoltage(void);
|
|
|
|
|
float getOutputVoltage(void);
|
|
|
|
|
void setOutputVoltage(void);
|
|
|
|
|
float getChargCurrent(void);
|
|
|
|
|
void setChargCurrent(void);
|
|
|
|
|
float getDischargCurrent(void);
|
|
|
|
|
void setDischargCurrent(void);
|
|
|
|
|
float getInputVoltage(void);
|
|
|
|
|
void setInputVoltage(void);
|
|
|
|
|
float getSolarOpenCircuitVoltage(void);
|
|
|
|
|
void setSolarOpenCircuitVoltage(void);
|
|
|
|
|
float getHighSideMosTemperature(void);
|
|
|
|
|
void setHighSideMosTemperature(void);
|
|
|
|
|
float getSolarInCircuitVoltage(void);
|
|
|
|
|
void setSolarInCircuitVoltage(void);
|
|
|
|
|
float getTotalElectricityConsumption(void);
|
|
|
|
|
void setTotalElectricityConsumption(void);
|
|
|
|
|
void totalElectricityConsumptionInt(float totalPower);
|
|
|
|
|
float getTotalChargCapacity(void);
|
|
|
|
|
void setTotalChargCapacity(void);
|
|
|
|
|
void totalChargCapacityInt(float totalPower);
|
|
|
|
|
float getSOC(void);
|
|
|
|
|
void setSOC(void);
|
|
|
|
|
int getMPPT_Mode(void);
|
|
|
|
|
void setMPPT_Mode(int MPPT_Mode);
|
|
|
|
|
float getChargBatteryCurrent(void);
|
|
|
|
|
BOOL getChargMosState(void);
|
|
|
|
|
void setChargMosState(BOOL state);
|
|
|
|
|
BOOL getDischargMosState(void);
|
2025-01-08 09:50:37 +00:00
|
|
|
|
uint8_t *getVersionnInformation(void);
|
|
|
|
|
float getLoopImpedance(void);
|
|
|
|
|
BOOL setLoopImpedance(float loopImpedance);
|
|
|
|
|
uint16_t getRegistrationStatus(void);
|
|
|
|
|
void setRegistrationStatus(uint16_t status);
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
2025-01-21 10:02:52 +00:00
|
|
|
|
void setExChargeCurr(void);
|
|
|
|
|
float getExChargeCurr(void);
|
2024-12-06 13:23:28 +00:00
|
|
|
|
|
|
|
|
|
#endif
|