CELIS/APPLICATION/CDZ/CDZ_DATA.h

590 lines
15 KiB
C
Raw Normal View History

2024-08-09 06:24:48 +00:00
/*
* @Description:
* @Version:
* @Author: Arnold
* @Date: 2023-12-25 10:37:47
* @LastEditTime: 2023-12-26 11:22:36
*/
#ifndef __CDZ_DATA_H__
#define __CDZ_DATA_H__
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#ifndef __STATIC_INLINE
#define __STATIC_INLINE static __inline
#endif
enum TypeBattery
{
lead_batteries=0x01,/* Ǧ<><C7A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
Hi_MH=0x02,/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
LFP_battery=0x03,/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFAEB5><EFBFBD> */
CM_battery=0x04,/* <20><><EFBFBD><EFBFBD><EFBFBD><EFAEB5><EFBFBD> */
LC_battery=0x05,/* <20><><EFBFBD><EFBFBD><EFBFBD><EFAEB5><EFBFBD> */
TM_battery=0x06,/* <20><>Ԫ﮵<D4AA><EFAEB5><EFBFBD> */
LP_battery=0x07,/* <20>ۺ<EFBFBD><DBBA><EFBFBD><EFBFBD><EFAEB5><EFBFBD> */
LTi_battery=0x08,/* <20><><EFBFBD><EFBFBD><EFBFBD><EFAEB5><EFBFBD> */
Other_batteries,/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
};
enum BMS_ChrgAllow
{
allow = 0X1,
refuse = 0X0
};
enum VCU_ChrgAllowed
{
Reserved2=0x3,
PAUSED=0x2,
ALLOWED =0x1,
NOT_ALLOWED = 0x0
};
enum VCU_Mode
{
Default_mode,
Normal_mode,
AC_charge_mode,
AC_discharge_mode,
DC_charge_mode,
DC_discharge_mode,
Reservation_AC_charge_mode,
charge_Mode_12V,
Remote_control_mode,
charge_battery_heat_mode,
Remote_battery_heat_mode,
Reserved
};
enum BMS_OncConSt
{
No_connect,
Half_connect,
AC_charge_connect,
AC_discharge_connect,
Connect_Fault,
Reserved1
};
enum BMS_WorkStatus
{
HV_finished = 0x3,
HV_shutdown = 0x4
};
struct Car_BMS_message
{
uint32_t IC_Mileage;
uint8_t IVI_TimeInfoSecond;
uint8_t IVI_TimeInfoMinute;
uint8_t IVI_TimeInfoHour;
uint8_t IVI_TimeInfoDay;
uint8_t IVI_TimeInfoMonth;
uint8_t IVI_TimeInfoYear;
};
struct Car_message
{
uint16_t VCU_RevVehicleHVpower;
int16_t Charg_Curr;
struct Car_BMS_message Car_BMS_message;
enum VCU_Mode VCU_Mode;//VCU<43><55><EFBFBD><EFBFBD>ģʽ
enum VCU_ChrgAllowed VCU_ChrgAllowed;//VCU<43><55><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum BMS_ChrgAllow BMS_ChrgAllowed;//BMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum BMS_WorkStatus BMS_WorkStatus;//BMS<4D><53><EFBFBD><EFBFBD>״̬
enum BMS_OncConSt BMS_OncConSt;//BMS<4D><53>ǹ<EFBFBD><C7B9><EFBFBD><EFBFBD>״̬
bool (*Set_BMS_Charging_allowance)(enum BMS_ChrgAllow setting_up);//<2F><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool (*Get_BMS_Charging_allowance)(struct Car_message* self);
bool (*Set_Car_Charging_allowance)(enum VCU_ChrgAllowed setting_up);//<2F><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool (*Get_Car_Charging_allowance)(struct Car_message* self);
bool (*Set_Car_Working_Mode)(enum VCU_Mode setting_up);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽ
enum VCU_Mode (*Get_Car_Working_Mode)(struct Car_message* self);
bool (*Set_Car_Working_Status)(enum BMS_WorkStatus setting_up);//<2F><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD>ģʽ
bool (*Get_Car_Working_Status)(struct Car_message* self);
bool (*Set_Car_OncConSt_Status)(enum BMS_OncConSt setting_up);//BMS<4D><53>ǹ<EFBFBD><C7B9><EFBFBD><EFBFBD>״̬
uint8_t (*Get_Car_OncConSt_Status)(struct Car_message* self);
};
#pragma pack(1)
struct BHM_DATA
{
uint16_t Maximum_allowable_total_charging_voltage;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD>ѹ
};
// struct BRM_DATA
// {
// uint32_t Protocol_version_number:24;
// enum TypeBattery Car_batteryType;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// uint16_t Rated_capacity_of_power_battery_system;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5><EFBFBD><EEB6A8><EFBFBD><EFBFBD>*/
// uint16_t Power_battery_Rated_total_voltage_of_the_battery;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<D8B6>ܵ<EFBFBD>ѹ */
// };
// <20><><EFBFBD><EFBFBD><E5B9B2><EFBFBD><EFBFBD>
union Version_BMScommun {
struct {
uint8_t VersionArr[3];
} fields;
uint32_t value:24; // <20><><EFBFBD><EFBFBD>16λ<36><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
};
union BMSChargeCount { //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
struct {
uint8_t ChargeCount[3];
} fields;
uint32_t value:24; // <20><><EFBFBD><EFBFBD>16λ<36><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
};
struct BRM_DATA
{
union Version_BMScommun VersionNumber; // Э<><D0AD><EFBFBD><EFBFBD><E6B1BE>
enum TypeBattery BatteryType; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint16_t RatedCapacity; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5><EFBFBD><EEB6A8><EFBFBD><EFBFBD>
uint16_t RatedTotalVoltage; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<D8B6>ܵ<EFBFBD>ѹ
char Battery_manufacturer[4];//<2F><><EFBFBD>ұ<EFBFBD><D2B1><EFBFBD>
uint8_t BatterySerialNumber[4];//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t Batteryack_production_dateYesr;//<2F><>
uint8_t Batteryack_production_dateMouth;//<2F><>
uint8_t Batteryack_production_dateData;//<2F><>
union BMSChargeCount Battery_pack_charge_count;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t Battery_pack_property_right_identification;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>ʶ
uint8_t reserve;//<2F><><EFBFBD><EFBFBD>
uint8_t ucCarVin[17];//<2F><><EFBFBD><EFBFBD>VIN
uint8_t BMS_Software_version_number[8];//BMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1BE>
};
// struct BCP_DATA
// {
// uint16_t MaxChargingVoltageSingle;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ */
// uint16_t Maximum_allowable_charging_current;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t Nominal_total_energy_of_power_battery;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t Maximum_allowable_total_charging_voltage;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD>ѹ */
// uint8_t maximum_permissible_temperature;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t Vehicle_power_battery_charge_state;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>״̬ */
// uint16_t Current_battery_voltage_of_vehicle_power_battery;/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ص<EFBFBD>ѹ */
// };
struct BCP_DATA
{
uint16_t MaxChargingVoltageSingle; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ
uint16_t MaxChargingCurrent; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint16_t NominalTotalEnergy; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint16_t MaxTotalChargingVoltage; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD>ѹ
uint8_t MaxTemperature; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint16_t ChargeState; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>״̬
uint16_t CurrentVoltage; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ص<EFBFBD>ѹ
};
struct BRO_DATA
{
uint8_t Whether_the_BMS_is_ready;/* BMS<4D>Ƿ<EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
};
enum ChargingMode
{
ConstantVoltage = 0x01,/* <20><>ѹ */
ConstantCurrent = 0x02,/* <20><><EFBFBD><EFBFBD> */
};
struct BCL_DATA
{
uint16_t VoltageDemand; // <20><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>(V)
uint16_t CurrentDemand; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(V)
enum ChargingMode Mode:8; // <20><><EFBFBD><EFBFBD>ģʽ
};
// <20><><EFBFBD><EFBFBD><E5B9B2><EFBFBD><EFBFBD>
union VoltageAndGroup {
struct {
uint16_t voltage : 12; // ǰ12<31><32>bit<69><74><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><CABE>ѹ
uint16_t group : 4; // <20><>4<EFBFBD><34>bit<69><74><EFBFBD>ڱ<EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
} fields;
uint16_t value; // <20><><EFBFBD><EFBFBD>16λ<36><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
};
struct BCS_DATA
{
uint16_t ChargingVoltage; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>ֵ (2<>ֽ<EFBFBD>, <20><><EFBFBD><EFBFBD>0.1)
uint16_t ChargingCurrent; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ (2<>ֽ<EFBFBD>, <20><><EFBFBD><EFBFBD>0.1)
union VoltageAndGroup MaxSingleCellVoltage; // <20><><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><E5B6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (1<>ֽ<EFBFBD>, <20><><EFBFBD><EFBFBD>0)
uint8_t SOC; // <20><>ǰ<EFBFBD>ɵ<EFBFBD>״̬SOC% (1<>ֽ<EFBFBD>, <20><><EFBFBD><EFBFBD>1%)
uint16_t RemainingChargeTime; // <20><><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> (2<>ֽ<EFBFBD>, <20><><EFBFBD><EFBFBD>1min)
};
// <20><><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
typedef enum
{
Normal = 0,
High = 1,
Low = 2
} StatusEnum;
typedef union
{
uint8_t stats[2];
struct
{
uint8_t high_low_voltage_status:2; // <20><><EFBFBD><EFBFBD><E5B6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>
uint8_t high_low_SOC_status:2; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>״̬SOC<4F><43><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>
uint8_t charging_overcurrent_status:2; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t high_temperature_status:2; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶ȹ<C2B6><C8B9><EFBFBD>
uint8_t insulation_status:2; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD>Ե״̬
uint8_t output_connector_status:2; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
uint8_t charging_permission:2; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}bits;
}BSM_DATA_FAULT;
// <20><><EFBFBD><EFBFBD>Ľṹ<C4BD><E1B9B9>
struct BSM_DATA
{
uint8_t highest_cell_voltage_number; // <20><><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><E5B6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>
uint8_t highest_battery_temperature; // <20><><EFBFBD>߶<EFBFBD><DFB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t highest_temperature_detection_point; // <20><><EFBFBD><EFBFBD><EFBFBD>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t lowest_battery_temperature; // <20><><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t lowest_temperature_detection_point; // <20><><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
StatusEnum high_low_voltage_status; // <20><><EFBFBD><EFBFBD><E5B6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>
StatusEnum high_low_SOC_status; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>״̬SOC<4F><43><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>
StatusEnum charging_overcurrent_status; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
StatusEnum high_temperature_status; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶ȹ<C2B6><C8B9><EFBFBD>
StatusEnum insulation_status; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD>Ե״̬
StatusEnum output_connector_status; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
StatusEnum charging_permission; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BSM_DATA_FAULT BSM_DATA_FAULT;
};
typedef union
{
uint8_t stats[4];
struct
{
uint8_t SOC_Target:2; //<2F><EFBFBD><EFB5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SOCĿ<43><C4BF>ֵ
uint8_t Total_voltage_set_point:2; //<2F><EFBFBD>ܵ<EFBFBD>ѹ<EFBFBD>趨ֵ
uint8_t Cell_voltage_set_point:2; //<2F><EFBFBD><EFB5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD>趨ֵ
uint8_t Charging_pile_stops_actively:2; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ
uint8_t Fault_insulation:2; //<2F><>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD>
uint8_t Overtemperature_fault_output_connector:2; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¹<EFBFBD><C2B9><EFBFBD>
uint8_t BMS_element_Overtemperature_fault_output_connector:2; //BMSԪ<53><D4AA>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t Charging_connector_failure:2; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t High_temperature_fault_battery_pack:2; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶ȹ<C2B6><C8B9>߹<EFBFBD><DFB9><EFBFBD>
uint8_t Fault_high_voltage_relay:2; //<2F><>ѹ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t Check_voltage_fault_point_2:2; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t Other_failures:2; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t Excessive_current:2; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t Abnormal_voltage:2; //<2F><>ѹ<EFBFBD>
}bits;
}BST_DATA_FAULT;
struct BST_DATA
{
uint8_t charge_abort_reason; // BMS<4D><53>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>
uint16_t charge_abort_faults; // BMS<4D><53>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>
uint8_t charge_abort_errors; // BMS<4D><53>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>
BST_DATA_FAULT BST_DATA_FAULT;
};
struct BSD_DATA
{
uint8_t soc_abort; // <20><>ֹ<EFBFBD>ɵ<EFBFBD>״̬SOC
uint16_t min_cell_voltage; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>ѹ (0.01V)
uint16_t max_cell_voltage; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD>ѹ (0.01V)
uint8_t min_battery_temperature; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (-50<35><30>)
uint8_t max_battery_temperature; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (-50<35><30>)
};
#pragma pack()
struct BMD_TO_CDZ
{
struct BHM_DATA BHM;
struct BRM_DATA BRM;
struct BCP_DATA BCP;
struct BRO_DATA BRO;
struct BCL_DATA BCL;
struct BCS_DATA BCS;
struct BSM_DATA BSM;
struct BST_DATA BST;
struct BSD_DATA BSD;
uint8_t uBatCurSOC;//<2F><>ǰSOC״̬
struct Car_message *parenr;
};
void initializeBMS_default_parameters(void);
extern struct BMD_TO_CDZ BMSDefaultParameters;
//<2F><>ȡBHM<48><4D>ѹֵ
__STATIC_INLINE uint16_t GetBHM_Vol(void)
{
return BMSDefaultParameters.BHM.Maximum_allowable_total_charging_voltage;
}
//<2F><>ȡBRM<52>
__STATIC_INLINE uint8_t GetBRM_VersionArr_0(void)
{
return BMSDefaultParameters.BRM.VersionNumber.fields.VersionArr[0];
}
//<2F><>ȡBRM<52>
__STATIC_INLINE uint8_t GetBRM_VersionArr_1(void)
{
return BMSDefaultParameters.BRM.VersionNumber.fields.VersionArr[1];
}
//<2F><>ȡBRM<52>
__STATIC_INLINE uint8_t GetBRM_VersionArr_2(void)
{
return BMSDefaultParameters.BRM.VersionNumber.fields.VersionArr[2];
}
//BRM<52><4D><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
__STATIC_INLINE enum TypeBattery GetBRM_Battery_TYPE(void)
{
return BMSDefaultParameters.BRM.BatteryType;
}
//BRM<52><4D><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ah
__STATIC_INLINE uint16_t GetBRM_RatedCapacity(void)
{
return BMSDefaultParameters.BRM.RatedCapacity;
}
//BRM<52><4D><EFBFBD>õ<EFBFBD><C3B5>ص<EFBFBD>ѹ
__STATIC_INLINE uint16_t GetBRM_RatedTotalVoltage(void)
{
return BMSDefaultParameters.BRM.RatedTotalVoltage;
}
//BCP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3><EFBFBD><EFBFBD><EFBFBD>ѹ
__STATIC_INLINE uint16_t GetBCP_MaxChargingVoltageSingle(void)
{
return BMSDefaultParameters.BCP.MaxChargingVoltageSingle;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
__STATIC_INLINE uint16_t GetBCP_MaxChargingCurrent(void)
{
return BMSDefaultParameters.BCP.MaxChargingCurrent;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
__STATIC_INLINE uint16_t GetBCP_NominalTotalEnergy(void)
{
return BMSDefaultParameters.BCP.NominalTotalEnergy;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD>ѹ
__STATIC_INLINE uint16_t GetBCP_MaxTotalChargingVoltage(void)
{
return BMSDefaultParameters.BCP.MaxTotalChargingVoltage;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
__STATIC_INLINE uint16_t GetBCP_MaxTemperature(void)
{
return BMSDefaultParameters.BCP.MaxTemperature;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>غɵ<D8BA>״̬
__STATIC_INLINE uint16_t GetBCP_ChargeState(void)
{
return BMSDefaultParameters.BCP.ChargeState;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ص<EFBFBD>ѹ
__STATIC_INLINE uint16_t GetBCP_CurrentVoltage(void)
{
return BMSDefaultParameters.BCP.CurrentVoltage;
}
//BCL<43><4C>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ
__STATIC_INLINE uint16_t GetBCL_VoltageDemand(void)
{
return BMSDefaultParameters.BCL.VoltageDemand;
}
//BCP<43><50>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
__STATIC_INLINE uint16_t GetBCL_CurrentDemand(void)
{
return BMSDefaultParameters.BCL.CurrentDemand;
}
//BCP<43><50>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ģʽ
__STATIC_INLINE uint16_t GetBCL_Mode(void)
{
return BMSDefaultParameters.BCL.Mode;
}
//BCS
__STATIC_INLINE uint16_t GetBCS_ChargingVoltage(void)
{
return BMSDefaultParameters.BCS.ChargingVoltage;
}
//BCS
__STATIC_INLINE uint16_t GetBCS_ChargingCurrent(void)
{
return BMSDefaultParameters.BCS.ChargingCurrent;
}
//BCS
__STATIC_INLINE uint16_t GetBCS_MaxSingleCellVoltage(void)
{
return BMSDefaultParameters.BCS.MaxSingleCellVoltage.value;
}
//BCS
__STATIC_INLINE uint16_t GetBCS_RemainingChargeTime(void)
{
return BMSDefaultParameters.BCS.RemainingChargeTime;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_highest_cell_voltage_number(void)
{
return BMSDefaultParameters.BSM.highest_cell_voltage_number;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_highest_battery_temperature(void)
{
return BMSDefaultParameters.BSM.highest_battery_temperature;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_highest_temperature_detection_point(void)
{
return BMSDefaultParameters.BSM.highest_temperature_detection_point;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_lowest_battery_temperature(void)
{
return BMSDefaultParameters.BSM.lowest_battery_temperature;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_lowest_temperature_detection_point(void)
{
return BMSDefaultParameters.BSM.lowest_temperature_detection_point;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_high_low_voltage_status(void)
{
return BMSDefaultParameters.BSM.high_low_voltage_status;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_high_low_SOC_status(void)
{
return BMSDefaultParameters.BSM.high_low_SOC_status;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_charging_overcurrent_status(void)
{
return BMSDefaultParameters.BSM.charging_overcurrent_status;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_high_temperature_status(void)
{
return BMSDefaultParameters.BSM.high_temperature_status;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_insulation_status(void)
{
return BMSDefaultParameters.BSM.insulation_status;
}
//BSM
__STATIC_INLINE uint16_t GetBSM_output_connector_status(void)
{
return BMSDefaultParameters.BSM.output_connector_status;
}//BSM
__STATIC_INLINE uint16_t GetBSM_charging_permission(void)
{
return BMSDefaultParameters.BSM.charging_permission;
}
//BST
__STATIC_INLINE uint16_t GetBST_charge_abort_reason(void)
{
return BMSDefaultParameters.BST.charge_abort_reason;
}
//BST
__STATIC_INLINE uint16_t GetBST_charge_abort_faults(void)
{
return BMSDefaultParameters.BST.charge_abort_faults;
}
//BST
__STATIC_INLINE uint16_t GetBST_charge_abort_errors(void)
{
return BMSDefaultParameters.BST.charge_abort_errors;
}
//BSD
__STATIC_INLINE uint16_t GetBSD_soc_abort(void)
{
return BMSDefaultParameters.BSD.soc_abort;
}
//BSD
__STATIC_INLINE uint16_t GetBSDmin_cell_voltage(void)
{
return BMSDefaultParameters.BSD.min_cell_voltage;
}
//BSD
__STATIC_INLINE uint16_t GetBSDmax_cell_voltage(void)
{
return BMSDefaultParameters.BSD.max_cell_voltage;
}
//BSD
__STATIC_INLINE uint16_t GetBSDmin_battery_temperature(void)
{
return BMSDefaultParameters.BSD.min_battery_temperature;
}
//BSD
__STATIC_INLINE uint16_t GetBSDmax_battery_temperature(void)
{
return BMSDefaultParameters.BSD.max_battery_temperature;
}
#endif