API  2.3.0
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
tsmart_rs485_config_t Struct Reference

Configuration for RS485. More...

#include <tsmart_rs485.h>

Data Fields

uint32_t baud_rate
 
uint16_t flow_control
 
uint16_t parity_bit
 
uint16_t word_length
 
uint16_t stop_bit
 
uint32_t ring_buffer_size
 
uint8_t * ring_buffer
 

Detailed Description

Configuration for RS485.

Examples:
rs485_receiver.c, and rs485_sender.c.

Field Documentation

uint32_t baud_rate

This member configures the UART communication baud rate

Examples:
rs485_receiver.c, and rs485_sender.c.
uint16_t flow_control

Specifies whether the hardware flow control mode is enabled or disabled. This parameter shall be selected amongst the following values:

  • TS_UART_FC_NONE
  • TS_UART_FC_CTS
  • TS_UART_FC_RTS
  • TS_UART_FC_RTS_CTS
Examples:
rs485_receiver.c, and rs485_sender.c.
uint16_t parity_bit
Specifies the parity mode.

This parameter shall be selected amongst the following values:

  • USART_Parity_No - Select without parity
  • USART_Parity_Even - Select parity even
  • USART_Parity_Odd - Select parity odd
Note
When parity is enabled, the computed parity is inserted at the MSB position of the transmitted data (9th bit when the word length is set to 9 data bits; 8th bit when the word length is set to 8 data bits).
Examples:
rs485_receiver.c, and rs485_sender.c.
uint8_t* ring_buffer

Ring buffer to received information

Examples:
rs485_receiver.c, and rs485_sender.c.
uint32_t ring_buffer_size

Ring buffer size to received information, the minimum size for this buffer must be at least the double of the size of the most long user frame. This RS-485 bus uses a ring buffer for receiving information. The reception interruption for this buffer notify to the API function when the ring buffer is half-full or full.

Examples:
rs485_receiver.c, and rs485_sender.c.
uint16_t stop_bit

Specifies the number of stop bits transmitted. This parameter shall be selected amongst the following values:

  • USART_StopBits_1
  • USART_StopBits_0_5
  • USART_StopBits_2
  • USART_StopBits_1_5
Examples:
rs485_receiver.c, and rs485_sender.c.
uint16_t word_length

Specifies the number of data bits to be transmitted or received in a frame. This parameter can be a value of the followings values:

  • USART_WordLength_8b
  • USART_WordLength_9b
Examples:
rs485_receiver.c, and rs485_sender.c.