1# Copyright (c) 2020 PHYTEC Messtechnik GmbH
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig MODBUS
5	bool "Modbus support"
6	select CRC
7
8if MODBUS
9
10config MODBUS_BUFFER_SIZE
11	int "Modbus buffer size"
12	default 256
13	range 64 256
14	help
15	  Modbus buffer size.
16
17choice
18	prompt "Supported node roles"
19	default MODBUS_ROLE_CLIENT_SERVER
20	help
21	  Specify the type of supported node roles.
22
23config MODBUS_ROLE_CLIENT
24	bool "Client support"
25
26config MODBUS_ROLE_SERVER
27	bool "Server support"
28
29config MODBUS_ROLE_CLIENT_SERVER
30	bool "Client and server support"
31
32endchoice
33
34config MODBUS_SERVER
35	bool
36	default y if MODBUS_ROLE_SERVER || MODBUS_ROLE_CLIENT_SERVER
37
38config MODBUS_CLIENT
39	bool
40	default y if MODBUS_ROLE_CLIENT || MODBUS_ROLE_CLIENT_SERVER
41
42config MODBUS_SERIAL
43	bool "Modbus over serial line support"
44	default y
45	depends on SERIAL && SERIAL_HAS_DRIVER
46	depends on DT_HAS_ZEPHYR_MODBUS_SERIAL_ENABLED
47	help
48	  Enable Modbus over serial line support.
49
50config MODBUS_ASCII_MODE
51	depends on MODBUS_SERIAL
52	bool "Modbus transmission mode ASCII"
53	help
54	  Enable ASCII transmission mode.
55
56config MODBUS_RAW_ADU
57	bool "Modbus raw ADU support"
58	help
59	  Enable Modbus raw ADU support.
60
61config MODBUS_NUMOF_RAW_ADU
62	int "Number of raw ADU instances"
63	depends on MODBUS_RAW_ADU
64	range 1 4
65	help
66	  Number of raw ADU instances.
67
68config MODBUS_FP_EXTENSIONS
69	bool "Floating-Point extensions"
70	default y
71	help
72	  Enable Floating-Point extensions
73
74config MODBUS_FC08_DIAGNOSTIC
75	bool "FC08 Diagnostic support"
76	depends on MODBUS_SERVER
77	default y
78	help
79	  Enable function code 08 Diagnostic support
80
81module = MODBUS
82module-str = Modbus Support
83module-help = Sets log level for Modbus support
84source "subsys/logging/Kconfig.template.log_config"
85
86endif
87