mppt/App/inc/inflash.h

78 lines
3.7 KiB
C
Raw Permalink Normal View History

2024-07-11 06:58:55 +00:00
/*
* inflash.h
*
* Created on: 2024<EFBFBD><EFBFBD>6<EFBFBD><EFBFBD>24<EFBFBD><EFBFBD>
* Author: psx
*/
#ifndef APP_INC_INFLASH_H_
#define APP_INC_INFLASH_H_
#include "debug.h"
#pragma pack(push,1)
typedef struct _uint8_config_info{
uint8_t start_Flag[2]; /* <20><>ʼ<EFBFBD><CABC>־ */
uint8_t address[7]; /* <20><>ַ */
uint8_t end_Flag; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־ */
uint8_t Access_Node_Type[2]; /* <20><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> */
uint8_t Communication_Methods[2]; /* ͨ<>ŷ<EFBFBD>ʽ */
uint8_t bat485_Baud[4]; /* <20><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>,Ϊ0<CEAA><30><EFBFBD><EFBFBD>bms<6D><73>֧<EFBFBD><D6A7>ͨ<EFBFBD><CDA8> */
uint8_t gw485_Baud[4]; /* <20><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD> */
uint8_t ConstantCurrentV[2]; /* <20><><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100),С<><D0A1>ConstantVoltageV * 100<30><30>ѹ<EFBFBD><D1B9><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
uint8_t ConstantVoltageV[2]; /* <20><><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100)<29>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FloatI * 100<30><30><EFBFBD>к<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD> */
uint8_t FloatI[2]; /* <20><><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100)<29>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FloatI * 100<30><30><EFBFBD>и<EFBFBD><D0B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
uint8_t startSolarOpenCircuitV[2]; /* <20><><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100)<29><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> */
}uint8_config_info;
2024-08-29 02:50:22 +00:00
//typedef struct _config_info{
// uint8_t start_Flag[2]; /* <20><>ʼ<EFBFBD><CABC>־ */
// uint8_t address[7]; /* <20><>ַ */
// uint8_t end_Flag; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־ */
// uint16_t Access_Node_Type; /* <20><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t Communication_Methods; /* ͨ<>ŷ<EFBFBD>ʽ */
// uint32_t bat485_Baud; /* <20><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD> */
// uint32_t gw485_Baud; /* <20><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t ConstantCurrentV; /* <20><><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100),С<><D0A1>ConstantVoltageV / 100<30><30>ѹ<EFBFBD><D1B9><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t ConstantVoltageV; /* <20><><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100)<29>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FloatI / 100<30><30><EFBFBD>к<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD> */
// uint16_t FloatI; /* <20><><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100)<29>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FloatI / 100<30><30><EFBFBD>и<EFBFBD><D0B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t startSolarOpenCircuitV;/* <20><><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100)<29><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> */
//}config_info;
2024-07-11 06:58:55 +00:00
typedef struct _config_info{
2024-08-29 02:50:22 +00:00
uint8_t start_Flag[2]; /* <20><>ʼ<EFBFBD><CABC>־ */
uint8_t address[7]; /* <20><>ַ */
uint32_t baud_485; /* <20><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD> */
uint16_t constantCurrentV; /* <20><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>(ConstantCurrentV / 100 + 0.4),С<>ڣ<EFBFBD>ConstantVoltageV / 100 - 0.4<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mpptģʽ */
uint16_t constantVoltageV; /* <20><>ѹ<EFBFBD><D1B9><EFBFBD>ڸ<EFBFBD>(ConstantVoltageV / 100)<29>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>FloatI / 100 + 0.1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
uint16_t floatI; /* <20><>ѹ<EFBFBD><D1B9><EFBFBD>ڸ<EFBFBD>(ConstantVoltageV / 100)<29>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>FloatI / 100<30><30><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><D0B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
uint16_t startSolarOpenCircuitV; /* ̫<><CCAB><EFBFBD>ܰ忪·<E5BFAA><C2B7>ѹ<EFBFBD><D1B9><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100)<29><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> */
uint16_t stopSolarOpenCircuitV; /* ̫<><CCAB><EFBFBD>ܰ忪·<E5BFAA><C2B7>ѹ<EFBFBD><D1B9><EFBFBD>ڸ<EFBFBD>(<28><>ѹ / 100)ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD> */
2024-09-18 01:47:44 +00:00
uint16_t constantVoltageChargeV; /* <20><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ */
uint16_t trickleChargeC; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
2024-08-29 02:50:22 +00:00
uint16_t FloatTime; /* <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>(<28><>) */
uint16_t checkSolarOpenCircuitVTime; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫<EFBFBD><CCAB><EFBFBD>ܰ忪·<E5BFAA><C2B7>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> */
uint16_t registerRefreshTime; /* <20>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2>ʱ<EFBFBD><CAB1> */
uint16_t resRefreshTime; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> */
uint16_t sensorEnableBroadcastTime; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD>ע<EFBFBD><D7A2><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD> */
uint16_t HighSideMosTemperature_stop; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶ȴﵽ<C8B4><EFB5BD>ֵʱ<D6B5><CAB1>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD> */
2024-09-18 01:47:44 +00:00
uint16_t HighSideMosTemperature_end; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵʱ<D6B5><CAB1><EFBFBD><EFBFBD><EFBFBD>͹<EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
2024-08-29 02:50:22 +00:00
uint16_t HighSideMosTemperature_start; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶Ƚ<C2B6><C8BD>͵<EFBFBD><CDB5><EFBFBD>ֵʱ<D6B5><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
uint8_t end_Flag; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־ */
2024-07-11 06:58:55 +00:00
}config_info;
#define CONFIG_INFO_SIZE (sizeof(config_info))
#pragma pack(pop)
extern config_info g_slConfigInfo;
#define FLASH_SAVE_ADDR_BEGIN (0x00)
#define FLASH_SAVE_ADDR_END (0x00 + CONFIG_INFO_SIZE)
void save_config_info(config_info save_config_info);
uint8_t read_config_info(void);
#endif /* APP_INC_INFLASH_H_ */