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"
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
|
|
|
|
#define softVer "SV01_24101501"
|
|
|
|
|
|
2024-12-07 09:52:46 +00:00
|
|
|
|
// #pragma pack(push,1)
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
|
|
|
|
/* 主要有配置文件读取出来的数据 */
|
|
|
|
|
typedef struct _config_parameter{
|
|
|
|
|
float constantVoltageV; /* 电压高于ConstantVoltageV且电流大于(FloatI + 0.1)进行恒压充电
|
|
|
|
|
电压低于该(ConstantVoltageV - 0.2) 进行恒流充电 (V) */
|
|
|
|
|
float floatI; /* 电压高于该ConstantVoltageV且电流低于FloatI进行浮充充电 (A) */
|
|
|
|
|
float startSolarOpenCircuitV; /* 太阳能板开路电压高于该电压开始充电 (V) */
|
|
|
|
|
float stopSolarOpenCircuitV; /* 太阳能板开路电压高于该电压停止充电 (V) */
|
|
|
|
|
float constantVoltageChargeV; /* 恒压充电时的输出电压 (V) */
|
|
|
|
|
float FloatV; /* 浮充充电时的输出电压 (V) */
|
|
|
|
|
float loopImpedance; /* 回路阻抗大小 (mΩ) */
|
|
|
|
|
float HighSideMosTemperature_stop; /* 当上桥温度达到该值时,停止输出 (°C) */
|
|
|
|
|
float HighSideMosTemperature_end; /* 当上桥温度上升到该值时,降低功率运行 (°C) */
|
|
|
|
|
float HighSideMosTemperature_start; /* 当上桥温度降低到该值时,按照正常情况输出 (°C) */
|
|
|
|
|
|
2024-12-24 06:43:20 +00:00
|
|
|
|
// uint16_t sensorEnableBroadcastTime; /* 传感器运行再次注册的间隔 (S) */
|
|
|
|
|
// uint16_t checkSolarOpenCircuitVTime; /* 启动任务中太阳能板开路电压检测间隔时间 (S) */
|
2024-12-06 09:38:25 +00:00
|
|
|
|
uint16_t outputAgainFlagTime; /* 出现短路保护后延长该段时间再次检测是否短路,仍然短路则关闭输出 (S) */
|
|
|
|
|
uint16_t excessiveLoadFlagTime; /* 出现过载后,在该间隔时间中多次(2次)出现过载,则关闭输出 (S) */
|
|
|
|
|
uint16_t eLAgainTime; /* 出现过载过载保护后,在该间隔段时间后,再次尝试输出 (S) */
|
2024-12-24 06:43:20 +00:00
|
|
|
|
// uint16_t softShortTime; /* 软件短路保护延时 时间(100uS) */
|
|
|
|
|
|
2024-12-14 09:52:26 +00:00
|
|
|
|
uint32_t collectOpenCircuitVoltageTime; /* 充电时开路电压采集时间间隔 */
|
2024-12-24 06:43:20 +00:00
|
|
|
|
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
|
|
|
|
/* SL */
|
|
|
|
|
uint16_t Access_Node_Type; /* 接入节点类型 */
|
|
|
|
|
uint16_t Communication_Methods; /* 通信方式 */
|
|
|
|
|
uint16_t Registration_Status; /* 注册状态 */
|
2024-12-07 09:52:46 +00:00
|
|
|
|
uint8_t address[7]; /* 地址 */
|
2024-12-06 09:38:25 +00:00
|
|
|
|
uint8_t startFlagSL[2]; /* 起始标志 */
|
|
|
|
|
uint8_t endFlagSL; /* 结束标志 */
|
|
|
|
|
|
|
|
|
|
/* HY */
|
|
|
|
|
uint8_t hardwareID[6]; /* 硬件ID */
|
|
|
|
|
uint8_t communicationID[4]; /* 通信ID */
|
|
|
|
|
uint8_t protocolType; /* 协议类型; 0x01表示:汇源协议(波特率9600) 0x02表示:南瑞协议(波特率115200)*/
|
|
|
|
|
uint8_t startFlagHY; /* 起始码 */
|
|
|
|
|
uint8_t endFlagHY; /* 结束码 */
|
|
|
|
|
|
|
|
|
|
uint8_t onlyPower; /* 是否只充当电源板:0x00:不是
|
|
|
|
|
0x01:是*/
|
|
|
|
|
|
|
|
|
|
uint32_t gw485_Baud; /* 串口波特率 */
|
|
|
|
|
uint32_t bat485_Baud; /* 串口波特率,为0代表bms不支持通信 */
|
|
|
|
|
} 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
|
|
|
|
|
2024-12-07 09:52:46 +00:00
|
|
|
|
uint8_t versionInformation[13]; /* 软件版本信息 */
|
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);
|
|
|
|
|
uint8_t *getVersionInformation(void);
|
2024-12-06 09:38:25 +00:00
|
|
|
|
|
|
|
|
|
|
2024-12-06 13:23:28 +00:00
|
|
|
|
|
|
|
|
|
#endif
|