API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions

Functions

void TSMART_RS485_InitCfgStruct (tsmart_rs485_config_t *TSMART_RS485_config)
 Set default configuration. More...
 
void TSMART_RS485_Init (tsmart_rs485_t *TSMART_RS485, tsmart_rs485_config_t *TSMART_RS485_config)
 Initialize a selected RS485 bus. More...
 
void TSMART_RS485_EnableRx (tsmart_rs485_t *TSMART_RS485, int32_t TSMART_RS485_enable)
 Enable or disable the receiver. More...
 
void TSMART_RS485_EnableTx (tsmart_rs485_t *TSMART_RS485, int32_t TSMART_RS485_enable)
 Enable or disable the transmitter. More...
 
int32_t TSMART_RS485_Read (tsmart_rs485_t *TSMART_RS485, uint8_t *TSMART_RS485_buf, uint16_t TSMART_RS485_nb, portTickType TSMART_RS485_xticks)
 Read data from RS485. More...
 
int32_t TSMART_RS485_Send (tsmart_rs485_t *TSMART_RS485, uint8_t *TSMART_RS485_buf, uint16_t TSMART_RS485_nb)
 Send data through RS485. More...
 

Detailed Description

Function Documentation

void TSMART_RS485_EnableRx ( tsmart_rs485_t TSMART_RS485,
int32_t  TSMART_RS485_enable 
)

Enable or disable the receiver.

Parameters
TSMART_RS485RS485 structure handler.
TSMART_RS485_enable1 = Enable, 0 = Disable
Examples:
rs485_receiver.c.
void TSMART_RS485_EnableTx ( tsmart_rs485_t TSMART_RS485,
int32_t  TSMART_RS485_enable 
)

Enable or disable the transmitter.

Parameters
TSMART_RS485RS485 structure handler.
TSMART_RS485_enable1 = Enable, 0 = Disable
Examples:
rs485_sender.c.
void TSMART_RS485_Init ( tsmart_rs485_t TSMART_RS485,
tsmart_rs485_config_t TSMART_RS485_config 
)

Initialize a selected RS485 bus.

This functions initializes the hardware configuration of the selected RS485 and the associated OS mechanisms.

Parameters
TSMART_RS485RS485 structure handler.
TSMART_RS485_configIndicates the baud rate, parity bit, word length, stop bit and baud rate for the selected RS485.
Examples:
rs485_receiver.c, and rs485_sender.c.
void TSMART_RS485_InitCfgStruct ( tsmart_rs485_config_t TSMART_RS485_config)

Set default configuration.

Parameters
TSMART_RS485_configStructure to write default configuration
int32_t TSMART_RS485_Read ( tsmart_rs485_t TSMART_RS485,
uint8_t *  TSMART_RS485_buf,
uint16_t  TSMART_RS485_nb,
portTickType  TSMART_RS485_xticks 
)

Read data from RS485.

Parameters
TSMART_RS485RS485 structure handler.
TSMART_RS485_bufData buffer to store data.
TSMART_RS485_nbNumber of bytes to receive.
TSMART_RS485_xticksMaximum waiting timeout.
Returns
  • Bytes received
Examples:
rs485_receiver.c.
int32_t TSMART_RS485_Send ( tsmart_rs485_t TSMART_RS485,
uint8_t *  TSMART_RS485_buf,
uint16_t  TSMART_RS485_nb 
)

Send data through RS485.

Parameters
TSMART_RS485RS485 structure handler.
TSMART_RS485_bufData buffer to send.
TSMART_RS485_nbBytes to send.
Returns
  • Bytes sent
Examples:
rs485_sender.c.