i2cmux4 2.0.0.0
Public function

Functions

void i2cmux4_cfg_setup (i2cmux4_cfg_t *cfg)
 Config Object Initialization function.
 
I2CMUX4_RETVAL i2cmux4_init (i2cmux4_t *ctx, i2cmux4_cfg_t *cfg)
 Initialization function.
 
void i2cmux4_generic_write (i2cmux4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void i2cmux4_generic_read (i2cmux4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void i2cmux4_power_on (i2cmux4_t *ctx, uint8_t enable)
 Power On function.
 
void i2cmux4_hw_reset (i2cmux4_t *ctx)
 Hardware reset function.
 
void i2cmux4_write_cmd (i2cmux4_t *ctx, uint8_t cmd_data)
 Write command function.
 
uint8_t i2cmux4_read_cmd (i2cmux4_t *ctx)
 Read command function.
 
void i2cmux4_set_channel (i2cmux4_t *ctx, uint8_t sel_ch, uint8_t ch_slave_addr)
 Set channel function.
 
uint8_t i2cmux4_get_ch_interrupt (i2cmux4_t *ctx)
 Get channel interrupt function.
 
void i2cmux4_rmt_write_bytes (i2cmux4_t *ctx, uint8_t reg, uint8_t *p_tx_data, uint8_t n_bytes)
 Generic rmt write data function.
 
void i2cmux4_rmt_read_bytes (i2cmux4_t *ctx, uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes)
 Generic read data function.
 
uint8_t i2cmux4_check_int (i2cmux4_t *ctx)
 Check interrupt function.
 

Detailed Description

Function Documentation

◆ i2cmux4_cfg_setup()

void i2cmux4_cfg_setup ( i2cmux4_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.

◆ i2cmux4_check_int()

uint8_t i2cmux4_check_int ( i2cmux4_t * ctx)

Check interrupt function.

Parameters
ctxClick object.
Returns
state of the INT pin.

@description The function get INT pin state of I2C MUX 4 click board.

◆ i2cmux4_generic_read()

void i2cmux4_generic_read ( i2cmux4_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.

◆ i2cmux4_generic_write()

void i2cmux4_generic_write ( i2cmux4_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.

◆ i2cmux4_get_ch_interrupt()

uint8_t i2cmux4_get_ch_interrupt ( i2cmux4_t * ctx)

Get channel interrupt function.

Parameters
ctxClick object.
Returns
channel interrupt bit

@description The function get channel interrupt of the I2C MUX 4 click board.

◆ i2cmux4_hw_reset()

void i2cmux4_hw_reset ( i2cmux4_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

@description The function hardware reset I2C MUX 4 click board by cleared to '0' state of the RST pin, wait the 100 ms, sets to '1' state of the RST pin and wait another the 100 ms.

◆ i2cmux4_init()

I2CMUX4_RETVAL i2cmux4_init ( i2cmux4_t * ctx,
i2cmux4_cfg_t * cfg )

Initialization function.

Parameters
i2cmux4Click object.
cfgClick configuration structure.

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

◆ i2cmux4_power_on()

void i2cmux4_power_on ( i2cmux4_t * ctx,
uint8_t enable )

Power On function.

Parameters
ctxClick object.

@description The function enable or disable the I2C MUX 4 click board by set to '1' or cleared to '0' state of the RST pin.

◆ i2cmux4_read_cmd()

uint8_t i2cmux4_read_cmd ( i2cmux4_t * ctx)

Read command function.

Parameters
ctxClick object.
Returns
8-bit read data.

Function executes read command from the TCA9543A Low Voltage 2-Channel I2C Bus Switch With Interrupt Logic And Reset on the I2C MUX 4 click board.

◆ i2cmux4_rmt_read_bytes()

void i2cmux4_rmt_read_bytes ( i2cmux4_t * ctx,
uint8_t reg,
uint8_t * p_rx_data,
uint8_t n_bytes )

Generic read data function.

Parameters
ctxClick object.
reg
8-bit register address.
p_rx_data
pointer to the memory location where data be stored.
n_bytes
number of bytes to be read.

@description The function read a sequential data starting from the targeted 8-bit register address of register address of the device connected to the desired channel of the I2C MUX 4 click board.

◆ i2cmux4_rmt_write_bytes()

void i2cmux4_rmt_write_bytes ( i2cmux4_t * ctx,
uint8_t reg,
uint8_t * p_tx_data,
uint8_t n_bytes )

Generic rmt write data function.

Parameters
ctxClick object.
reg
8-bit register address.
p_tx_data
pointer to the data to be written.
n_bytes
number of bytes to be written.

@description The function writes a sequential data starting to the targeted 8-bit register address of the device connected to the desired channel of the I2C MUX 4 click board.

◆ i2cmux4_set_channel()

void i2cmux4_set_channel ( i2cmux4_t * ctx,
uint8_t sel_ch,
uint8_t ch_slave_addr )

Set channel function.

Parameters
ctxClick object.
sel_ch
select channel:
  • 0x00 ( I2CMUX4_SEL_CH_ALL_DISABLE ) : No channel selected; power-up/reset default state.
  • 0x01 ( I2CMUX4_SEL_CH_0 ) : Channel 0 enabled.
  • 0x02 ( I2CMUX4_SEL_CH_1 ) : Channel 1 enabled.
ch_slave_addr7-bit i2c slave address of the device connected to the selected channel.

@description The function sets channel and slave address of the device connected to the selected channel of the I2C MUX 4 click board.

◆ i2cmux4_write_cmd()

void i2cmux4_write_cmd ( i2cmux4_t * ctx,
uint8_t cmd_data )

Write command function.

Parameters
ctxClick object.
cmd_data
8-bit command data to be transmitted.

@description The function executes writes command to the TCA9543A Low Voltage 2-Channel I2C Bus Switch With Interrupt Logic And Reset on the I2C MUX 4 click board.