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	imply UART_USE_RUNTIME_CONFIGURE
48	help
49	  Enable Modbus over serial line support.
50
51config MODBUS_SERIAL_ASYNC_API
52	depends on MODBUS_SERIAL && UART_ASYNC_API
53	bool "Modbus over serial line UART ASYNC API support"
54	help
55	  Use UART ASYNC API for Modbus over serial line.
56
57config MODBUS_ASCII_MODE
58	depends on MODBUS_SERIAL
59	bool "Modbus transmission mode ASCII"
60	help
61	  Enable ASCII transmission mode.
62
63config MODBUS_RAW_ADU
64	bool "Modbus raw ADU support"
65	help
66	  Enable Modbus raw ADU support.
67
68config MODBUS_NUMOF_RAW_ADU
69	int "Number of raw ADU instances"
70	depends on MODBUS_RAW_ADU
71	range 1 4
72	help
73	  Number of raw ADU instances.
74
75config MODBUS_FP_EXTENSIONS
76	bool "Floating-Point extensions"
77	default y
78	help
79	  Enable Floating-Point extensions
80
81config MODBUS_FC08_DIAGNOSTIC
82	bool "FC08 Diagnostic support"
83	depends on MODBUS_SERVER
84	default y
85	help
86	  Enable function code 08 Diagnostic support
87
88config MODBUS_NONCOMPLIANT_SERIAL_MODE
89	bool "Non-compliant serial mode"
90	depends on MODBUS_SERIAL
91	help
92	  Allow non-compliant stop and parity bit settings.
93
94module = MODBUS
95module-str = Modbus Support
96module-help = Sets log level for Modbus support
97source "subsys/logging/Kconfig.template.log_config"
98
99endif
100