4
0
mirror of https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.git synced 2025-02-04 07:22:23 +08:00
armink ff438e63fc 1、【增加】转换延迟及响应超时宏定义;
2、【更新】IAR及Keil工程配置适应新的代码文件结构;
3、【修改】所有Slaver字段为Slave

Signed-off-by: armink <armink.ztl@gmail.com>
2013-08-19 11:00:05 +08:00

35 lines
1.6 KiB
C

#ifndef USER_APP
#define USER_APP
/* ----------------------- Modbus includes ----------------------------------*/
#include "mb.h"
#include "mbport.h"
/* ----------------------- Defines ------------------------------------------*/
#define DISCRETE_INPUT_START 1
#define DISCRETE_INPUT_NDISCRETES 16
#define COIL_START 1
#define COIL_NCOILS 64
#define REG_INPUT_START 1
#define REG_INPUT_NREGS 100
#define REG_HOLDING_START 1
#define REG_HOLDING_NREGS 100
//===========================在保持寄存器中,各个地址对应的功能定义========================
#define HD_RESERVE 0 //保留
#define HD_CPU_USAGE_MAJOR 1 //当前CPU利用率的整数位
#define HD_CPU_USAGE_MINOR 2 //当前CPU利用率的小数位
//===========================在输入寄存器中,各个地址对应的功能定义========================
#define IN_RESERVE 0 //保留
//===========================在线圈中,各个地址对应的功能定义============================
#define CO_RESERVE 2 //保留
//===========================在离散输入中,各个地址对应的功能定义=========================
#define DI_RESERVE 1 //保留
/*--------------------------Extern Functions------------------------------------*/
extern UCHAR xMBUtilGetBits( UCHAR * ucByteBuf, USHORT usBitOffset, UCHAR ucNBits );
extern void xMBUtilSetBits( UCHAR * ucByteBuf, USHORT usBitOffset, UCHAR ucNBits,UCHAR ucValue );
#endif