i2cmux2 2.0.0.0
Public function

Functions

void i2cmux2_cfg_setup (i2cmux2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t i2cmux2_init (i2cmux2_t *ctx, i2cmux2_cfg_t *cfg)
 Initialization function.
 
void i2cmux2_generic_write (i2cmux2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void i2cmux2_generic_read (i2cmux2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void i2cmux2_hw_reset (i2cmux2_t *ctx)
 Hardware reset function.
 
void i2cmux2_write_cmd (i2cmux2_t *ctx, uint8_t tx_data)
 Write command function.
 
uint8_t i2cmux2_read_cmd (i2cmux2_t *ctx)
 Read command function.
 
void i2cmux2_set_channel (i2cmux2_t *ctx, uint8_t channel, uint8_t ch_slave_address)
 Set channel function.
 
uint8_t i2cmux2_read_interrupt (i2cmux2_t *ctx)
 Read interrupt status function.
 
uint8_t i2cmux2_check_int (i2cmux2_t *ctx)
 Check interrupt status function.
 

Detailed Description

Function Documentation

◆ i2cmux2_cfg_setup()

void i2cmux2_cfg_setup ( i2cmux2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ i2cmux2_check_int()

uint8_t i2cmux2_check_int ( i2cmux2_t * ctx)

Check interrupt status function.

Parameters
ctxClick object.
Returns
Interrupt pin state:
  • 0 : Active;
  • 1 : Not active;

    Function check interrupt state by returning the state of the INT pin of I2C MUX 2 click board.

◆ i2cmux2_generic_read()

void i2cmux2_generic_read ( i2cmux2_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

This function reads data from the desired register.

◆ i2cmux2_generic_write()

void i2cmux2_generic_write ( i2cmux2_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.

This function writes data to the desired register.

◆ i2cmux2_hw_reset()

void i2cmux2_hw_reset ( i2cmux2_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

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

◆ i2cmux2_init()

err_t i2cmux2_init ( i2cmux2_t * ctx,
i2cmux2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ i2cmux2_read_cmd()

uint8_t i2cmux2_read_cmd ( i2cmux2_t * ctx)

Read command function.

Parameters
ctxClick object.
Returns
8-bit read data.

Function executes read command from the TCA9545A Low Voltage 4-Channel I2C on the I2C MUX 2 click board.

◆ i2cmux2_read_interrupt()

uint8_t i2cmux2_read_interrupt ( i2cmux2_t * ctx)

Read interrupt status function.

Parameters
ctxClick object.
Returns
Interrupt of channel state:
  • [ bit 0 ] : Interrupt on channel 0;
  • [ bit 1 ] : Interrupt on channel 1;
  • [ bit 2 ] : Interrupt on channel 2;
  • [ bit 3 ] : Interrupt on channel 3;

    Function get interrupt status by reading from the TCA9545A Low Voltage 4-Channel I2C on the I2C MUX 2 click board.

◆ i2cmux2_set_channel()

void i2cmux2_set_channel ( i2cmux2_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.

Function sets channel of the I2C MUX 2 click board.

◆ i2cmux2_write_cmd()

void i2cmux2_write_cmd ( i2cmux2_t * ctx,
uint8_t tx_data )

Write command function.

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

Function executes writes command to the TCA9545A Low Voltage 4-Channel I2C on the I2C MUX 2 click board.