ModbusConfig.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * ModbusConfig.h
  3. *
  4. * Created on: Apr 28, 2021
  5. * Author: Alejandro Mera
  6. *
  7. * This is a template for the Modbus library configuration.
  8. * Every project needs a tailored copy of this file renamed to ModbusConfig.h, and added to the include path.
  9. */
  10. #ifndef THIRD_PARTY_MODBUS_LIB_CONFIG_MODBUSCONFIG_H_
  11. #define THIRD_PARTY_MODBUS_LIB_CONFIG_MODBUSCONFIG_H_
  12. /* Uncomment the following line to enable support for Modbus RTU over USB CDC profile. Only tested for BluePill f103 board. */
  13. //#define ENABLE_USB_CDC 1
  14. /* Uncomment the following line to enable support for Modbus TCP. Only tested for Nucleo144-F429ZI. */
  15. //#define ENABLE_TCP 1
  16. /* Uncomment the following line to enable support for Modbus RTU USART DMA mode. Only tested for Nucleo144-F429ZI. */
  17. #define ENABLE_USART_DMA 1
  18. #define T35 5 // Timer T35 period (in ticks) for end frame detection.
  19. #define MAX_BUFFER 128 // Maximum size for the communication buffer in bytes.
  20. #define TIMEOUT_MODBUS 1000 // Timeout for master query (in ticks)
  21. #define MAX_M_HANDLERS 2 //Maximum number of modbus handlers that can work concurrently
  22. #define MAX_TELEGRAMS 2 //Max number of Telegrams in master queue
  23. #endif /* THIRD_PARTY_MODBUS_LIB_CONFIG_MODBUSCONFIG_H_ */