i2cmux3 2.0.0.0
Public function

Functions

void i2cmux3_cfg_setup (i2cmux3_cfg_t *cfg)
 Config Object Initialization function.
 
I2CMUX3_RETVAL i2cmux3_init (i2cmux3_t *ctx, i2cmux3_cfg_t *cfg)
 Initialization function.
 
void i2cmux3_generic_write (i2cmux3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void i2cmux3_generic_read (i2cmux3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void i2cmux3_write_ctl (i2cmux3_t *ctx, uint8_t wr_data)
 Write Control Register function.
 
uint8_t i2cmux3_read_ctl (i2cmux3_t *ctx)
 Read Control Register function.
 
void i2cmux3_ch_sel (i2cmux3_t *ctx, uint8_t sel_ch)
 Select Channel function.
 
void i2cmux3_wr_slv (i2cmux3_t *ctx, uint8_t slv_sel_adr, uint8_t reg, uint8_t *p_wr_data, uint8_t n_bytes)
 Slave Device Write function.
 
void i2cmux3_rd_slv (i2cmux3_t *ctx, uint8_t slv_sel_adr, uint8_t reg, uint8_t *p_rd_data, uint8_t n_bytes)
 Slave Device Read function.
 
void i2cmux3_dev_enable (i2cmux3_t *ctx, uint8_t stat)
 Device enable function.
 
void i2cmux3_hw_rst (i2cmux3_t *ctx)
 Hardware reset function.
 

Detailed Description

Function Documentation

◆ i2cmux3_cfg_setup()

void i2cmux3_cfg_setup ( i2cmux3_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.

◆ i2cmux3_ch_sel()

void i2cmux3_ch_sel ( i2cmux3_t * ctx,
uint8_t sel_ch )

Select Channel function.

Parameters
ctxClick object.
sel_ch8-bit data ranging from 0 to 7 that defines channel

Function is used to select communication channel.

Note
User can use values ranging from 0 to 7 in order to select wanted channel.

◆ i2cmux3_dev_enable()

void i2cmux3_dev_enable ( i2cmux3_t * ctx,
uint8_t stat )

Device enable function.

Parameters
ctxClick object.
statvalue defines state of the device '1' Device enabled '0' Device disabled

Function is used to enable or disable the device.

◆ i2cmux3_generic_read()

void i2cmux3_generic_read ( i2cmux3_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.

◆ i2cmux3_generic_write()

void i2cmux3_generic_write ( i2cmux3_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.

◆ i2cmux3_hw_rst()

void i2cmux3_hw_rst ( i2cmux3_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

Function is used to perform hardware reset of the I2C MUX 4 click board.

Note
Function holds two 100 milliseconds delay.

◆ i2cmux3_init()

I2CMUX3_RETVAL i2cmux3_init ( i2cmux3_t * ctx,
i2cmux3_cfg_t * cfg )

Initialization function.

Parameters
i2cmux3Click object.
cfgClick configuration structure.

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

◆ i2cmux3_rd_slv()

void i2cmux3_rd_slv ( i2cmux3_t * ctx,
uint8_t slv_sel_adr,
uint8_t reg,
uint8_t * p_rd_data,
uint8_t n_bytes )

Slave Device Read function.

Parameters
ctxClick object.
slv_sel_adrI2C address of the connected slave device
reg8-bit register address
p_rd_datapointer to the data to be read
n_bytesnumber of bytes to be written

Function is used to read a sequential data starting from the targeted 8-bit register address of the device connected to the desired channel of the I2C MUX 3 click board.

◆ i2cmux3_read_ctl()

uint8_t i2cmux3_read_ctl ( i2cmux3_t * ctx)

Read Control Register function.

Parameters
ctxClick object.
Returns
8-bit content of control register

Function is used to read from TCA9548A's control register.

◆ i2cmux3_wr_slv()

void i2cmux3_wr_slv ( i2cmux3_t * ctx,
uint8_t slv_sel_adr,
uint8_t reg,
uint8_t * p_wr_data,
uint8_t n_bytes )

Slave Device Write function.

Parameters
ctxClick object.
slv_sel_adrI2C address of the connected slave device
reg8-bit register address
p_wr_datapointer to the data to be written
n_bytesnumber of bytes to be written

Function is used to write a sequential data starting from the targeted 8-bit register address of the device connected to the desired channel of the I2C MUX 3 click board.

◆ i2cmux3_write_ctl()

void i2cmux3_write_ctl ( i2cmux3_t * ctx,
uint8_t wr_data )

Write Control Register function.

Parameters
ctxClick object.
wr_data8-bit input data

Function is used to write to TCA9548A's control register.