📄 m.h
字号:
/* =================================================================================
File name: Modbus.H (28x version)
Originator: R&D Group
NIE
Description:
Header file containing constants, data type definitions, and
function prototypes for the communication.
=====================================================================================
History:
-------------------------------------------------------------------------------------
03-16-2005 Release Rev 1.0
------------------------------------------------------------------------------*/
#ifndef __M_H__
#define __M_H__
//#include "DSP281x_Device.h"
#define DELAYCOUNT 23 //4.5ms = 23*200us
#define PARANUMMAX 40 //数据缓存的最大个数,防止溢出
#define PARAMETER_MAX_NUMBER 40 //StatusInfo个数,防止溢出
#define MENU_MAX_NUMBER 21 //StatusInfo个数,防止溢出,用于翻页
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
Uint16 CommFlag; //状态标识
Uint16 CommCount; //延时计数
int16 ParaNum; //菜单页编号
int16 FaultNum; //故障编号
Uint16 Slave_Address; //从机地址
Uint16 Index; //参数地址
Uint16 CommData[PARANUMMAX]; //数据缓存
void (*Read_Data_sci)();
void (*Processing_Data_sci)();
void (*Send_Data_sci)();
void (*InitSciPort)(); //初始化函数
void (*SEND_int)();
}MO;
typedef MO *Mo_handle;
/*-----------------------------------------------------------------------------
Default initalizer for the Modbus object.
-----------------------------------------------------------------------------*/
#define Mo_DEFAULTS { 1,\
0,\
0,\
0,\
0,\
0,\
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},\
(void (*)(Uint32))Read_Data_sciA,\
(void (*)(Uint32))Processing_Data_sciA,\
(void (*)(Uint32))Send_Data_sciA,\
(void (*)(Uint32))InitSciPortA,\
(void (*)(Uint32))SEND_intA,\
}
void Read_Data_sciA(Mo_handle);
void Processing_Data_sciA(Mo_handle);
void Send_Data_sciA(Mo_handle);
void InitSciPortA();
void SEND_intA(Mo_handle);
Uint16 CRC_cal(Uint16 *puchMsg,Uint16 usDataLen);
/*------------------------------------------------------------------------------
datatab used in Modbus.C,define in para_tab.asm
------------------------------------------------------------------------------*/
extern int Para_Tab[][16]; //参数页信息表
extern int Fault_Tab[][9]; //故障页信息表
extern int auchCRCHi[]; //crc
extern int auchCRCLo[]; //crc
extern long StatusInfo[];
extern long MenuInfo[];
//故障代码地址
#ifdef __cplusplus
}
#endif /* extern "C" */
//extern volatile struct TABLE Table;
#endif // __Modbus_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -