1menu "Modbus Example Configuration"
2
3    config MB_UART_PORT_NUM
4        int "UART port number"
5        range 0 2 if IDF_TARGET_ESP32
6        default 2 if IDF_TARGET_ESP32
7        range 0 1 if IDF_TARGET_ESP32S2
8        default 1 if IDF_TARGET_ESP32S2
9        help
10            UART communication port number for Modbus example.
11
12    config MB_UART_BAUD_RATE
13        int "UART communication speed"
14        range 1200 115200
15        default 115200
16        help
17            UART communication speed for Modbus example.
18
19    config MB_UART_RXD
20        int "UART RXD pin number"
21        range 0 34 if IDF_TARGET_ESP32
22        default 22 if IDF_TARGET_ESP32
23        range 0 46 if IDF_TARGET_ESP32S2
24        default 19 if IDF_TARGET_ESP32S2
25        help
26            GPIO number for UART RX pin. See UART documentation for more information
27            about available pin numbers for UART.
28
29    config MB_UART_TXD
30        int "UART TXD pin number"
31        range 0 34 if IDF_TARGET_ESP32
32        default 23 if IDF_TARGET_ESP32
33        range 0 46 if IDF_TARGET_ESP32S2
34        default 20 if IDF_TARGET_ESP32S2
35        help
36            GPIO number for UART TX pin. See UART documentation for more information
37            about available pin numbers for UART.
38
39    config MB_UART_RTS
40        int "UART RTS pin number"
41        range 0 34 if IDF_TARGET_ESP32
42        range 0 46 if IDF_TARGET_ESP32S2
43        default 18
44        help
45            GPIO number for UART RTS pin. This pin is connected to
46            ~RE/DE pin of RS485 transceiver to switch direction.
47            See UART documentation for more information about available pin
48            numbers for UART.
49
50    choice MB_COMM_MODE
51        prompt "Modbus communication mode"
52        default MB_COMM_MODE_RTU if CONFIG_FMB_COMM_MODE_RTU_EN
53        help
54            Selection of Modbus communication mode option for Modbus.
55
56        config MB_COMM_MODE_RTU
57            bool "RTU mode"
58            depends on FMB_COMM_MODE_RTU_EN
59
60        config MB_COMM_MODE_ASCII
61            bool "ASCII mode"
62            depends on FMB_COMM_MODE_ASCII_EN
63
64    endchoice
65
66    config MB_SLAVE_ADDR
67        int "Modbus slave address"
68        range 1 127
69        default 1
70        help
71            This is the Modbus slave address in the network.
72            It is used to organize Modbus network with several slaves connected into the same segment.
73
74
75endmenu
76