uartmux2 2.0.0.0
UART MUX 2 Click Driver

API for configuring and manipulating UART MUX 2 Click driver. More...

Topics

 UART MUX 2 Commands List
 List of commands of UART MUX 2 Click driver.
 
 UART MUX 2 Device Settings
 UART MUX 2 description register.
 
 UART MUX 2 MikroBUS Map
 MikroBUS pin mapping of UART MUX 2 Click driver.
 
 Status
 
 Op_mode
 
 Mux_ch
 

Functions

void uartmux2_cfg_setup (uartmux2_cfg_t *cfg)
 UART MUX 2 configuration object setup function.
 
err_t uartmux2_init (uartmux2_t *ctx, uartmux2_cfg_t *cfg)
 UART MUX 2 initialization function.
 
void uartmux2_default_cfg (uartmux2_t *ctx)
 UART MUX 2 default configuration function.
 
err_t uartmux2_generic_write (uartmux2_t *ctx, char *data_buf, uint16_t len)
 UART MUX 2 data writing function.
 
err_t uartmux2_generic_read (uartmux2_t *ctx, char *data_buf, uint16_t max_len)
 UART MUX 2 data reading function.
 
err_t uartmux2_set_operation_mode (uartmux2_t *ctx, uint8_t op_mode)
 UART MUX 2 set operation mode function.
 
err_t uartmux2_set_channel (uartmux2_t *ctx, uint8_t mux_ch)
 UART MUX 2 set channel function.
 
err_t uartmux2_send_data (uartmux2_t *ctx, char *tx_data)
 UART MUX 2 data writing function.
 
uint8_t uartmux2_get_inv_status (uartmux2_t *ctx)
 UART MUX 2 get INV pin status function.
 

Detailed Description

API for configuring and manipulating UART MUX 2 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

◆ uartmux2_cfg_setup()

void uartmux2_cfg_setup ( uartmux2_cfg_t * cfg)

UART MUX 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ uartmux2_default_cfg()

void uartmux2_default_cfg ( uartmux2_t * ctx)

UART MUX 2 default configuration function.

This function executes a default configuration of UART MUX 2 click board.

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

◆ uartmux2_generic_read()

err_t uartmux2_generic_read ( uartmux2_t * ctx,
char * data_buf,
uint16_t max_len )

UART MUX 2 data reading function.

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

Parameters
[in]ctx: Click context object. See uartmux2_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_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.

◆ uartmux2_generic_write()

err_t uartmux2_generic_write ( uartmux2_t * ctx,
char * data_buf,
uint16_t len )

UART MUX 2 data writing function.

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

Parameters
[in]ctx: Click context object. See uartmux2_t object definition for detailed explanation.
[in]data_buf: 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.

◆ uartmux2_get_inv_status()

uint8_t uartmux2_get_inv_status ( uartmux2_t * ctx)

UART MUX 2 get INV pin status function.

This function get INV pin status ( RS232 status ) of the UART MUX 2 click board.

Parameters
[in]ctx: Click context object. See uartmux2_t object definition for detailed explanation.
Returns
  • 0 - RS232 receiver input are unpowered,
  • 1 - RS232 receiver input are powered.
See #err_t definition for detailed explanation.
Note
None.

◆ uartmux2_init()

err_t uartmux2_init ( uartmux2_t * ctx,
uartmux2_cfg_t * cfg )

UART MUX 2 initialization function.

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

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

◆ uartmux2_send_data()

err_t uartmux2_send_data ( uartmux2_t * ctx,
char * tx_data )

UART MUX 2 data writing function.

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

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

◆ uartmux2_set_channel()

err_t uartmux2_set_channel ( uartmux2_t * ctx,
uint8_t mux_ch )

UART MUX 2 set channel function.

This function set a desired channel f the UART MUX 2 click board.

Parameters
[in]ctx: Click context object. See uartmux2_t object definition for detailed explanation.
[in]mux_ch: Selected channel
  • 0 ( UARTMUX2_CHANNEL_0 ) - UART0, Channel 0,
  • 1 ( UARTMUX2_CHANNEL_1 ) - UART1, Channel 1,
  • 2 ( UARTMUX2_CHANNEL_2 ) - UART2, Channel 2,
  • 3 ( UARTMUX2_CHANNEL_3 ) - UART3, Channel 3.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ uartmux2_set_operation_mode()

err_t uartmux2_set_operation_mode ( uartmux2_t * ctx,
uint8_t op_mode )

UART MUX 2 set operation mode function.

This function set a desired operation mode of the UART MUX 2 click board.

Parameters
[in]ctx: Click context object. See uartmux2_t object definition for detailed explanation.
[in]op_mode: Operation mode
  • 0x00 ( UARTMUX2_OP_MODE_NORMAL ) - Normal operation with automatic power down disabled,
  • 0x01 ( UARTMUX2_OP_MODE_POWER_DOWN ) - Normal operation with automatic power down enabled.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.