chargeController/APP/businessLogic/Inc/parameter.h

121 lines
5.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef BL_PARAMETER_H_
#define BL_PARAMETER_H_
#include "main.h"
#include "comm_types.h"
#define softVer "SV01_24101501"
// #pragma pack(push,1)
/* 主要有配置文件读取出来的数据 */
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) */
// uint16_t sensorEnableBroadcastTime; /* 传感器运行再次注册的间隔 (S) */
// uint16_t checkSolarOpenCircuitVTime; /* 启动任务中太阳能板开路电压检测间隔时间 (S) */
uint16_t outputAgainFlagTime; /* 出现短路保护后延长该段时间再次检测是否短路,仍然短路则关闭输出 (S) */
uint16_t excessiveLoadFlagTime; /* 出现过载后在该间隔时间中多次2次出现过载则关闭输出 (S) */
uint16_t eLAgainTime; /* 出现过载过载保护后,在该间隔段时间后,再次尝试输出 (S) */
uint32_t collectOpenCircuitVoltageTime; /* 充电时开路电压采集时间间隔 */
/* SL */
uint16_t Access_Node_Type; /* 接入节点类型 */
uint16_t Communication_Methods; /* 通信方式 */
uint16_t Registration_Status; /* 注册状态 */
uint8_t address[7]; /* 地址 */
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; /* 剩余电量 */
int MPPT_Mode; /* 工作模式 */
uint8_t versionInformation[13]; /* 软件版本信息 */
}otherParameter;
// #pragma pack(pop)
BOOL getBatteryState(void);
void setBatteryState(BOOL state);
float getDutyRatio(void);
void setDutyRatio(float DutyRatio);
void setDutyRatioToZero(void);
uint8_t getMosTemperState(void);
void setMosTemperState(uint8_t state);
BOOL getCheckImpedanceState(void);
void setCheckImpedanceState(void);
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);
#endif