i2cmux 2.0.0.0
Public function

Functions

void i2cmux_cfg_setup (i2cmux_cfg_t *cfg)
 Config Object Initialization function.
 
I2CMUX_RETVAL i2cmux_init (i2cmux_t *ctx, i2cmux_cfg_t *cfg)
 Initialization function.
 
void i2cmux_generic_write (i2cmux_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void i2cmux_generic_read (i2cmux_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void i2cmux_hw_reset (i2cmux_t *ctx)
 Hardware reset function.
 
void i2cmux_write_cmd (i2cmux_t *ctx, uint8_t tx_data)
 Write command function.
 
uint8_t i2cmux_read_cmd (i2cmux_t *ctx)
 Read command function.
 
void i2cmux_set_channel (i2cmux_t *ctx, uint8_t channel, uint8_t ch_slave_address)
 Set channel function.
 

Detailed Description

Function Documentation

◆ i2cmux_cfg_setup()

void i2cmux_cfg_setup ( i2cmux_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ i2cmux_generic_read()

void i2cmux_generic_read ( i2cmux_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf.
lenNumber of the bytes to be read.

@description This function reads data from the desired register.

◆ i2cmux_generic_write()

void i2cmux_generic_write ( i2cmux_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ i2cmux_hw_reset()

void i2cmux_hw_reset ( i2cmux_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

@description This function resets I2C MUX 2 click board by clearing the RST pin for 100ms.

◆ i2cmux_init()

I2CMUX_RETVAL i2cmux_init ( i2cmux_t * ctx,
i2cmux_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ i2cmux_read_cmd()

uint8_t i2cmux_read_cmd ( i2cmux_t * ctx)

Read command function.

Parameters
ctxClick object.

@description This function executes read command from the TCA9546A Low Voltage 4-Channel I2C and SMBus Switch on the I2C MUX click board.

◆ i2cmux_set_channel()

void i2cmux_set_channel ( i2cmux_t * ctx,
uint8_t channel,
uint8_t ch_slave_address )

Set channel function.

Parameters
ctxClick object.
channel8-bit register address.
ch_slave_addressPointer to the data to be written.

@description This function sets channel of the I2C MUX click board.

◆ i2cmux_write_cmd()

void i2cmux_write_cmd ( i2cmux_t * ctx,
uint8_t tx_data )

Write command function.

Parameters
ctxClick object.
tx_data8-bit data to be transmitted.

@description This function executes writes command to the TCA9546A Low Voltage 4-Channel I2C and SMBus Switch on the I2C MUX click board.