rs4858 2.1.0.0
RS485 8 Click Driver

API for configuring and manipulating RS485 8 Click driver. More...

Topics

 RS485 8 Device Settings
 Settings for registers of RS485 8 Click driver.
 
 RS485 8 MikroBUS Map
 MikroBUS pin mapping of RS485 8 Click driver.
 

Functions

void rs4858_cfg_setup (rs4858_cfg_t *cfg)
 RS485 8 configuration object setup function.
 
err_t rs4858_init (rs4858_t *ctx, rs4858_cfg_t *cfg)
 RS485 8 initialization function.
 
void rs4858_default_cfg (rs4858_t *ctx)
 RS485 8 default configuration function.
 
err_t rs4858_generic_write (rs4858_t *ctx, uint8_t *data_in, uint16_t len)
 RS485 8 data writing function.
 
err_t rs4858_generic_read (rs4858_t *ctx, uint8_t *data_out, uint16_t len)
 RS485 8 data reading function.
 
void rs4858_enable_device (rs4858_t *ctx)
 RS485 8 enable the device function.
 
void rs4858_disable_device (rs4858_t *ctx)
 RS485 8 disable the device function.
 

Detailed Description

API for configuring and manipulating RS485 8 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ rs4858_cfg_setup()

void rs4858_cfg_setup ( rs4858_cfg_t * cfg)

RS485 8 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See rs4858_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ rs4858_default_cfg()

void rs4858_default_cfg ( rs4858_t * ctx)

RS485 8 default configuration function.

This function executes a default configuration of RS485 8 click board.

Parameters
[in]ctx: Click context object. See rs4858_t object definition for detailed explanation.
Returns
Nothing.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ rs4858_disable_device()

void rs4858_disable_device ( rs4858_t * ctx)

RS485 8 disable the device function.

This function is used to disable the RS485 8 click board.

Parameters
[in]ctx: Click context object. See #rs4857_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ rs4858_enable_device()

void rs4858_enable_device ( rs4858_t * ctx)

RS485 8 enable the device function.

This function is used to enable the RS485 8 click board.

Parameters
[in]ctx: Click context object. See #rs4857_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ rs4858_generic_read()

err_t rs4858_generic_read ( rs4858_t * ctx,
uint8_t * data_out,
uint16_t len )

RS485 8 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See rs4858_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ rs4858_generic_write()

err_t rs4858_generic_write ( rs4858_t * ctx,
uint8_t * data_in,
uint16_t len )

RS485 8 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See rs4858_t object definition for detailed explanation.
[in]data_in: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ rs4858_init()

err_t rs4858_init ( rs4858_t * ctx,
rs4858_cfg_t * cfg )

RS485 8 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See rs4858_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See rs4858_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.