-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmb_cfg.h
110 lines (91 loc) · 5.16 KB
/
mb_cfg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
*********************************************************************************************************
* uC/Modbus
* The Embedded Modbus Stack
*
* Copyright 2003-2020 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* MODBUS CONFIGURATION
*
* Filename : mb_cfg.h
* Version : V2.14.00
*********************************************************************************************************
* Note(s) : (1) This file contains configuration constants for uC/Modbus
*********************************************************************************************************
*/
#include <rtconfig.h>
/*
*********************************************************************************************************
* OS Configuration
*
*********************************************************************************************************
*/
#ifdef PKG_USING_UC_MODBUS_TASK_PRIO
#define MB_OS_CFG_RX_TASK_PRIO PKG_USING_UC_MODBUS_TASK_PRIO
#else
#define MB_OS_CFG_RX_TASK_PRIO 10
#endif
#ifdef PKG_USING_UC_MODBUS_TASK_STK_SIZE
#define MB_OS_CFG_RX_TASK_STK_SIZE PKG_USING_UC_MODBUS_TASK_STK_SIZE
#else
#define MB_OS_CFG_RX_TASK_STK_SIZE 512
#endif
/*
*********************************************************************************************************
* MODBUS MODULES CONFIGURATION
*********************************************************************************************************
*/
#define MODBUS_CFG_SLAVE_EN DEF_ENABLED /* Enable or Disable Modbus Slave */
#define MODBUS_CFG_MASTER_EN DEF_DISABLED /* Enable or Disable Modbus Master */
/*
*********************************************************************************************************
* MODBUS MODES CONFIGURATION
*********************************************************************************************************
*/
#define MODBUS_CFG_ASCII_EN DEF_ENABLED /* Modbus ASCII is supported when DEF_ENABLED */
#define MODBUS_CFG_RTU_EN DEF_ENABLED /* Modbus RTU is supported when DEF_ENABLED */
/*
*********************************************************************************************************
* MODBUS COMMUNICATION CONFIGURATION
*********************************************************************************************************
*/
#define MODBUS_CFG_MAX_CH 10 /* Maximum number of Modbus channels. */
#define MODBUS_CFG_BUF_SIZE 255 /* Maximum outgoing message size. */
/*
*********************************************************************************************************
* MODBUS FLOATING POINT SUPPORT
*********************************************************************************************************
*/
#define MODBUS_CFG_FP_EN DEF_ENABLED /* Enable Floating-Point support. */
#if (MODBUS_CFG_FP_EN == DEF_ENABLED)
#define MODBUS_CFG_FP_START_IX 5000 /* Start address of Floating-Point registers */
#else
#define MODBUS_CFG_FP_START_IX 65500 /* Floating point is disabled, set start of ... */
/* ...FP very high */
#endif
/*
*********************************************************************************************************
* MODBUS FUNCTIONS CONFIGURATION
*********************************************************************************************************
*/
#define MODBUS_CFG_FC01_EN DEF_ENABLED /* Enable or Disable support for Modbus functions */
#define MODBUS_CFG_FC02_EN DEF_ENABLED
#define MODBUS_CFG_FC03_EN DEF_ENABLED
#define MODBUS_CFG_FC04_EN DEF_ENABLED
#define MODBUS_CFG_FC05_EN DEF_ENABLED
#define MODBUS_CFG_FC06_EN DEF_ENABLED
#define MODBUS_CFG_FC08_EN DEF_ENABLED
#define MODBUS_CFG_FC15_EN DEF_ENABLED
#define MODBUS_CFG_FC16_EN DEF_ENABLED
#define MODBUS_CFG_FC20_EN DEF_DISABLED
#define MODBUS_CFG_FC21_EN DEF_DISABLED