i2cmux7 2.0.0.0
I2C MUX 7 Click Driver

API for configuring and manipulating I2C MUX 7 Click driver. More...

Topics

 I2C MUX 7 Settings
 Settings of I2C MUX 7 Click driver.
 
 I2C MUX 7 MikroBUS Map
 MikroBUS pin mapping of I2C MUX 7 Click driver.
 

Functions

void i2cmux7_cfg_setup (i2cmux7_cfg_t *cfg)
 I2C MUX 7 configuration object setup function.
 
err_t i2cmux7_init (i2cmux7_t *ctx, i2cmux7_cfg_t *cfg)
 I2C MUX 7 initialization function.
 
err_t i2cmux7_set_channel (i2cmux7_t *ctx, uint8_t ch_sel, uint8_t ch_slave_addr)
 I2C MUX 7 set channel function.
 
err_t i2cmux7_read_channel (i2cmux7_t *ctx, uint8_t *ch_sel)
 I2C MUX 7 read channel function.
 
void i2cmux7_reset_device (i2cmux7_t *ctx)
 I2C MUX 7 reset device function.
 
err_t i2cmux7_generic_write (i2cmux7_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 I2C MUX 7 I2C writing function.
 
err_t i2cmux7_generic_read (i2cmux7_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 I2C MUX 7 I2C reading function.
 

Detailed Description

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

◆ i2cmux7_cfg_setup()

void i2cmux7_cfg_setup ( i2cmux7_cfg_t * cfg)

I2C MUX 7 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ i2cmux7_generic_read()

err_t i2cmux7_generic_read ( i2cmux7_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

I2C MUX 7 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See i2cmux7_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The device channel and slave address must be configured previously using i2cmux7_set_channel function.

◆ i2cmux7_generic_write()

err_t i2cmux7_generic_write ( i2cmux7_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

I2C MUX 7 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See i2cmux7_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The device channel and slave address must be configured previously using i2cmux7_set_channel function.

◆ i2cmux7_init()

err_t i2cmux7_init ( i2cmux7_t * ctx,
i2cmux7_cfg_t * cfg )

I2C MUX 7 initialization function.

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

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

◆ i2cmux7_read_channel()

err_t i2cmux7_read_channel ( i2cmux7_t * ctx,
uint8_t * ch_sel )

I2C MUX 7 read channel function.

This function reads the currently selected channel value.

Parameters
[in]ctx: Click context object. See i2cmux7_t object definition for detailed explanation.
[out]ch_sel: Channel selection bit mask.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ i2cmux7_reset_device()

void i2cmux7_reset_device ( i2cmux7_t * ctx)

I2C MUX 7 reset device function.

This function resets the device by toggling the RST pin state.

Parameters
[in]ctx: Click context object. See i2cmux7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ i2cmux7_set_channel()

err_t i2cmux7_set_channel ( i2cmux7_t * ctx,
uint8_t ch_sel,
uint8_t ch_slave_addr )

I2C MUX 7 set channel function.

This function sets the desired channel active and configures its slave address.

Parameters
[in]ctx: Click context object. See i2cmux7_t object definition for detailed explanation.
[in]ch_sel: Channel selection bit mask.
[in]ch_slave_addr: 7-bit slave address of the device connected to the channel.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.