Setting Stop bits in Modbus Serial
Posted: Thu Dec 03, 2020 12:06 pm
Hello,
The init driver initializes Modbus using the above parameters. I am using Modbus RTU and I wanted to know if the number of stop bits can be configured or not. Is the driver written in such a way that when either odd/even parity is selected number of stop bits are automatically initialized to 1 and when the parity is none, number of stop bits is set to 2. Is there anyway to configure it on an user level like the other elements of mb_communication_info_t .
Code: Select all
* @brief Device communication structure to setup Modbus controller
*/
typedef union {
// Serial communication structure
struct {
mb_mode_type_t mode; /*!< Modbus communication mode */
uint8_t slave_addr; /*!< Modbus slave address field (dummy for master) */
uart_port_t port; /*!< Modbus communication port (UART) number */
uint32_t baudrate; /*!< Modbus baudrate */
uart_parity_t parity; /*!< Modbus UART parity settings */
uint16_t dummy_port; /*!< Dummy field, unused */
};
// TCP/UDP communication structure
struct {
mb_mode_type_t ip_mode; /*!< Modbus communication mode */
uint16_t ip_port; /*!< Modbus port */
mb_tcp_addr_type_t ip_addr_type; /*!< Modbus address type */
void* ip_addr; /*!< Modbus address table for connection */
void* ip_netif_ptr; /*!< Modbus network interface */
};
} mb_communication_info_t;