Initial commit: my SECS2 project

This commit is contained in:
2026-06-12 14:19:01 +08:00
commit 2c3e2c4dc2
1138 changed files with 603966 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
#ifndef _PROTO_CS200_H_
#define _PROTO_CS200_H_
#include "main.h"
#include "proto_Modbus.h"
#define CS200_STATE_Init 0
#define CS200_STATE_GetCurrentData 1
#define CS200_STATE_SetFlow_1 2
#define CS200_STATE_SetFlow_2 3
#define CS200_READ_STATE_ID_1 0
#define CS200_READ_STATE_ID_2 1
typedef struct
{
u8 ID;
u16 BaudRate;
u16 SetFlow;
u16 Flow;
u16 Range_u16;
u8 ValveCmd;
float SumFlow; //<2F>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>
u8 SumFlow_Mode; //<2F>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD>ģʽ
u8 Parity; //У<><D0A3>λ
u16 Valve_U; //<2F><><EFBFBD><EFBFBD>ѹ
float Range_Float;
float SoftStartValue; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
float RealFlow; //ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
}proto_CS2000_CurrentData_t;
typedef struct
{
proto_CS2000_CurrentData_t CurrentData[2];
u16 ErrorFlag;
u8 SendTime;
u8 TimeCount;
u8 ID_1,ID_2;
u8 State;
u8 ReadState;
u16 SetFlowValue_1;
u16 SetFlowValue_2;
void (*Init)(void);
void (*Tx_Task)(void);
void (*Rx_Task)(u8 *,u16);
void (*SetFlow_1)(float);
void (*SetFlow_2)(float);
}proto_CS200_t;
extern proto_CS200_t CS200;
#endif