summaryrefslogtreecommitdiff
path: root/apps/modbus/Kconfig
blob: c62ff5c880acaf61ac6463ffd66bdfb3c984c4b8 (plain) (blame)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#
# For a description of the syntax of this configuration file,
# see misc/tools/kconfig-language.txt.
#

config MODBUS
	bool "Modbus support via FreeModBus"
	default n

if MODBUS

config MB_ASCII_ENABLED
	bool "Modbus ASCII support"
	default y

config MB_RTU_ENABLED
	bool "Modbus RTU support"
	default y

config MB_TCP_ENABLED
	bool "Modbus TCP support"
	default y

config MB_HAVE_CLOSE
	bool "Platform close callbacks"
	default n
	depends on MB_TCP_ENABLED
	---help---
		A port which wants to get an callback must select
		CONFIG_MB_HAVE_CLOSE and provide vMBPortClose() as
		as vMBTCPPortClose() (if CONFIG_MB_TCP_ENABLED)

config MB_ASCII_TIMEOUT_SEC
	int "Character timeout"
	depends on MB_ASCII_ENABLED
	default 1
	---help---
		Character timeout value for Modbus ASCII

		The character timeout value is not fixed for Modbus ASCII and is therefore
		a configuration option. It should be set to the maximum expected delay
		time of the network.

config MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS
	int "Timeout to wait before sending"
	depends on MB_ASCII_ENABLED
	default 0
	---help---
		Timeout to wait in ASCII prior to enabling transmitter

		If defined the function calls vMBPortSerialDelay with the argument
		MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS to allow for a delay before
		the serial transmitter is enabled. This is required because some
		targets are so fast that there is no time between receiving and
		transmitting the frame. If the master is to slow with enabling its
		receiver then he will not receive the response correctly.

config MB_FUNC_HANDLERS_MAX
	int "Maximum number of Modbus functions"
	default 16
	---help---
		Maximum number of Modbus functions codes the protocol stack should support.

		The maximum number of supported Modbus functions must be greater than
		the sum of all enabled functions in this file and custom function
		handlers. If set to small adding more functions will fail.

config MB_FUNC_OTHER_REP_SLAVEID_BUF
	int "Size of Slave ID report buffer"
	depends on MB_FUNC_OTHER_REP_SLAVEID_ENABLED
	default 32
	---help---
		Number of bytes which should be allocated for the Report Slave ID command.

		This number limits the maximum size of the additional segment in the
		report slave id function. See eMBSetSlaveID() for more information on
		how to set this value. It is only used if MB_FUNC_OTHER_REP_SLAVEID_ENABLED
		is set to 1.

config MB_FUNC_OTHER_REP_SLAVEID_ENABLED
	bool "Report Slave ID function"
	default y
	---help---
		If the Report Slave ID function should be enabled.

config MB_FUNC_READ_INPUT_ENABLED
	bool "Read Input Registers function"
	default y
	---help---
		If the Read Input Registers function should be enabled.

config MB_FUNC_READ_HOLDING_ENABLED
	bool "Read Holding Registers function"
	default y
	---help---
		If the Read Holding Registers function should be enabled.

config MB_FUNC_WRITE_HOLDING_ENABLED
	bool "Write Single Register function"
	default y
	---help---
		If the Write Single Register function should be enabled.

config MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED
	bool "Write Multiple registers function"
	default y
	---help---
		If the Write Multiple registers function should be enabled.

config MB_FUNC_READ_COILS_ENABLED
	bool "Read Coils function"
	default y
	---help---
		If the Read Coils function should be enabled.

config MB_FUNC_WRITE_COIL_ENABLED
	bool "Write Coils function"
	default y
	---help---
		If the Write Coils function should be enabled.

config MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED
	bool "Write Multiple Coils function"
	default y
	---help---
		If the Write Multiple Coils function should be enabled.

config MB_FUNC_READ_DISCRETE_INPUTS_ENABLED
	bool "Read Discrete Inputs function"
	default y
	---help---
		If the Read Discrete Inputs function should be enabled.

config MB_FUNC_READWRITE_HOLDING_ENABLED
	bool "Read/Write Multiple Registers function"
	default y
	---help---
		If the Read/Write Multiple Registers function should be enabled.

endif # MODBUS