Kconfig 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. menu "Modbus configuration"
  2. config FMB_COMM_MODE_RTU_EN
  3. bool "Enable Modbus stack support for RTU mode"
  4. default y
  5. help
  6. Enable RTU Modbus communication mode option for Modbus serial stack.
  7. config FMB_COMM_MODE_ASCII_EN
  8. bool "Enable Modbus stack support for ASCII mode"
  9. default y
  10. help
  11. Enable ASCII Modbus communication mode option for Modbus serial stack.
  12. config FMB_MASTER_TIMEOUT_MS_RESPOND
  13. int "Slave respond timeout (Milliseconds)"
  14. default 150
  15. range 50 400
  16. help
  17. If master sends a frame which is not broadcast, it has to wait sometime for slave response.
  18. if slave is not respond in this time, the master will process timeout error.
  19. config FMB_MASTER_DELAY_MS_CONVERT
  20. int "Slave conversion delay (Milliseconds)"
  21. default 200
  22. range 50 400
  23. help
  24. If master sends a broadcast frame, it has to wait conversion time to delay,
  25. then master can send next frame.
  26. config FMB_QUEUE_LENGTH
  27. int "Modbus serial task queue length"
  28. range 0 200
  29. default 20
  30. help
  31. Modbus serial driver queue length. It is used by event queue task.
  32. See the serial driver API for more information.
  33. config FMB_SERIAL_TASK_STACK_SIZE
  34. int "Modbus serial task stack size"
  35. range 768 8192
  36. default 2048
  37. help
  38. Modbus serial task stack size for event queue task.
  39. It may be adjusted when debugging is enabled (for example).
  40. config FMB_SERIAL_BUF_SIZE
  41. int "Modbus serial task RX/TX buffer size"
  42. range 0 2048
  43. default 256
  44. help
  45. Modbus serial task RX and TX buffer size for UART driver initialization.
  46. This buffer is used for modbus frame transfer. The Modbus protocol maximum
  47. frame size is 256 bytes. Bigger size can be used for non standard implementations.
  48. config FMB_SERIAL_ASCII_BITS_PER_SYMB
  49. int "Number of data bits per ASCII character"
  50. default 8
  51. range 7 8
  52. depends on FMB_COMM_MODE_ASCII_EN
  53. help
  54. This option defines the number of data bits per ASCII character.
  55. config FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS
  56. int "Response timeout for ASCII communication mode (ms)"
  57. default 1000
  58. range 300 2000
  59. depends on FMB_COMM_MODE_ASCII_EN
  60. help
  61. This option defines response timeout of slave in milliseconds for ASCII communication mode.
  62. Thus the timeout will expire and allow the master’s program to handle the error.
  63. config FMB_SERIAL_TASK_PRIO
  64. int "Modbus serial task priority"
  65. range 3 10
  66. default 10
  67. help
  68. Modbus UART driver event task priority.
  69. The priority of Modbus controller task is equal to (CONFIG_FMB_SERIAL_TASK_PRIO - 1).
  70. config FMB_CONTROLLER_SLAVE_ID_SUPPORT
  71. bool "Modbus controller slave ID support"
  72. default n
  73. help
  74. Modbus slave ID support enable.
  75. When enabled the Modbus <Report Slave ID> command is supported by stack.
  76. config FMB_CONTROLLER_SLAVE_ID
  77. hex "Modbus controller slave ID"
  78. range 0 4294967295
  79. default 0x00112233
  80. depends on FMB_CONTROLLER_SLAVE_ID_SUPPORT
  81. help
  82. Modbus slave ID value to identify modbus device
  83. in the network using <Report Slave ID> command.
  84. Most significant byte of ID is used as short device ID and
  85. other three bytes used as long ID.
  86. config FMB_CONTROLLER_NOTIFY_TIMEOUT
  87. int "Modbus controller notification timeout (ms)"
  88. range 0 200
  89. default 20
  90. help
  91. Modbus controller notification timeout in milliseconds.
  92. This timeout is used to send notification about accessed parameters.
  93. config FMB_CONTROLLER_NOTIFY_QUEUE_SIZE
  94. int "Modbus controller notification queue size"
  95. range 0 200
  96. default 20
  97. help
  98. Modbus controller notification queue size.
  99. The notification queue is used to get information about accessed parameters.
  100. config FMB_CONTROLLER_STACK_SIZE
  101. int "Modbus controller stack size"
  102. range 0 8192
  103. default 4096
  104. help
  105. Modbus controller task stack size. The Stack size may be adjusted when
  106. debug mode is used which requires more stack size (for example).
  107. config FMB_EVENT_QUEUE_TIMEOUT
  108. int "Modbus stack event queue timeout (ms)"
  109. range 0 500
  110. default 20
  111. help
  112. Modbus stack event queue timeout in milliseconds. This may help to optimize
  113. Modbus stack event processing time.
  114. config FMB_TIMER_PORT_ENABLED
  115. bool "Modbus slave stack use timer for 3.5T symbol time measurement"
  116. default y
  117. help
  118. If this option is set the Modbus stack uses timer for T3.5 time measurement.
  119. Else the internal UART TOUT timeout is used for 3.5T symbol time measurement.
  120. config FMB_TIMER_GROUP
  121. int "Modbus Timer group number"
  122. range 0 1
  123. default 0
  124. help
  125. Modbus Timer group number that is used for timeout measurement.
  126. config FMB_TIMER_INDEX
  127. int "Modbus Timer index in the group"
  128. range 0 1
  129. default 0
  130. help
  131. Modbus Timer Index in the group that is used for timeout measurement.
  132. config FMB_TIMER_ISR_IN_IRAM
  133. bool "Place timer interrupt handler into IRAM"
  134. default n
  135. select UART_ISR_IN_IRAM
  136. help
  137. This option places Modbus timer IRQ handler into IRAM.
  138. This allows to avoid delays related to processing of non-IRAM-safe interrupts
  139. during a flash write operation (NVS updating a value, or some other
  140. flash API which has to perform an read/write operation and disable CPU cache).
  141. This option has dependency with the UART_ISR_IN_IRAM option which places UART interrupt
  142. handler into IRAM to prevent delays related to processing of UART events.
  143. endmenu