You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#ifndef TPC_X_H
|
|
|
|
#define TPC_X_H
|
|
|
|
|
|
|
|
#include "bsp_config.h"
|
|
|
|
//////
|
|
|
|
#include "c_type51.h"///
|
|
|
|
|
|
|
|
#include "msp_uartN.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************
|
|
|
|
|
|
|
|
1,帧头帧尾
|
|
|
|
又分
|
|
|
|
fx 11 22 33 44 ocr
|
|
|
|
77 66 xxxxx 88
|
|
|
|
68 len xxx dat ocr 16
|
|
|
|
2,字符型 odoa结束
|
|
|
|
|
|
|
|
3,纯粹的超时
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*********/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{//8byte
|
|
|
|
vU8 filter;
|
|
|
|
vU8 R1;
|
|
|
|
vU8 R2;
|
|
|
|
vU8 R3;
|
|
|
|
vU8 R4;
|
|
|
|
vU8 R5;
|
|
|
|
vU8 R6;
|
|
|
|
vU8 ocr;
|
|
|
|
}TS_P_debug;
|
|
|
|
|
|
|
|
#define TS_RS485_BUF_MAX_LEN 16
|
|
|
|
|
|
|
|
|
|
|
|
// AA 02 10 00 02 A3 B4 33 查询
|
|
|
|
// AA 02 20 00 03 00 00 00 6C 校准第0个点 00kg
|
|
|
|
// AA 02 20 00 03 01 00 64 6C 校准第1个点 20kg
|
|
|
|
// AA 02 20 00 03 02 02 BC 6C 校准第2个点 40kg
|
|
|
|
// AA 02 30 00 00 33 清零
|
|
|
|
typedef struct
|
|
|
|
{//8byte
|
|
|
|
vU8 filter;
|
|
|
|
vU8 slaveId;
|
|
|
|
vU8 cmd;
|
|
|
|
vU8 num[2];
|
|
|
|
vU8 buf[TS_RS485_BUF_MAX_LEN];
|
|
|
|
vU8 ocr;
|
|
|
|
}TS_P_rs485;
|
|
|
|
|
|
|
|
////#define D_HETU_FX_buf_max 5 //定长协议 长度为5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|