i2cmux5 2.0.0.0
I2C MUX 5 Click Driver

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

Topics

 I2C MUX 5 Registers List
 List of registers of I2C MUX 5 Click driver.
 
 I2C MUX 5 Registers Settings
 Settings for registers of I2C MUX 5 Click driver.
 
 I2C MUX 5 MikroBUS Map
 MikroBUS pin mapping of I2C MUX 5 Click driver.
 
 Sel_ch
 
 Pin_state
 

Functions

void i2cmux5_cfg_setup (i2cmux5_cfg_t *cfg)
 I2C MUX 5 configuration object setup function.
 
err_t i2cmux5_init (i2cmux5_t *ctx, i2cmux5_cfg_t *cfg)
 I2C MUX 5 initialization function.
 
void i2cmux5_default_cfg (i2cmux5_t *ctx)
 I2C MUX 5 default configuration function.
 
void i2cmux5_hw_reset (i2cmux5_t *ctx)
 I2C MUX 5 HW reset function.
 
void i2cmux5_dev_enable (i2cmux5_t *ctx)
 I2C MUX 5 enable the device function.
 
uint8_t i2cmux5_check_rdy (i2cmux5_t *ctx)
 I2C MUX 5 check rdy function.
 
uint8_t i2cmux5_check_alert (i2cmux5_t *ctx)
 I2C MUX 5 check alert function.
 
err_t i2cmux5_generic_write (i2cmux5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 I2C MUX 5 I2C writing function.
 
err_t i2cmux5_generic_read (i2cmux5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 I2C MUX 5 I2C reading function.
 
uint8_t i2cmux5_check_ch_alert (i2cmux5_t *ctx, uint8_t n_channel)
 I2C MUX 5 check channel alert function.
 
void i2cmux5_channel_write_byte (i2cmux5_t *ctx, uint8_t sel_ch, uint8_t ch_slave_addr, uint8_t reg, uint8_t tx_data)
 I2C MUX 5 I2C channel writing function.
 
uint8_t i2cmux5_channel_read_byte (i2cmux5_t *ctx, uint8_t sel_ch, uint8_t ch_slave_addr, uint8_t reg)
 I2C MUX 5 I2C channel reading function.
 

Detailed Description

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

◆ i2cmux5_cfg_setup()

void i2cmux5_cfg_setup ( i2cmux5_cfg_t * cfg)

I2C MUX 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ i2cmux5_channel_read_byte()

uint8_t i2cmux5_channel_read_byte ( i2cmux5_t * ctx,
uint8_t sel_ch,
uint8_t ch_slave_addr,
uint8_t reg )

I2C MUX 5 I2C channel 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 i2cmux5_t object definition for detailed explanation.
[in]sel_ch: Number of the desired channel ( from 1 to 4 ).
[in]ch_slave_addr: Slave address of the device connected to the desired channel.
[in]reg: Start register address.
Returns
Output read data.

See #err_t definition for detailed explanation.

Note
None.

◆ i2cmux5_channel_write_byte()

void i2cmux5_channel_write_byte ( i2cmux5_t * ctx,
uint8_t sel_ch,
uint8_t ch_slave_addr,
uint8_t reg,
uint8_t tx_data )

I2C MUX 5 I2C channel writing function.

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

Parameters
[in]ctx: Click context object. See i2cmux5_t object definition for detailed explanation.
[in]sel_ch: Number of the desired channel ( from 1 to 4 ).
[in]ch_slave_addr: Slave address of the device connected to the desired channel.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
Note
None.

◆ i2cmux5_check_alert()

uint8_t i2cmux5_check_alert ( i2cmux5_t * ctx)

I2C MUX 5 check alert function.

This function check fault alert output of I2C MUX 5 click board.

Parameters
[in]ctx: Click context object. See i2cmux5_t object definition for detailed explanation.
Returns
  • 0 - A fault occurs to alert the host controller,
  • 1 - Passes this information to the master on the upstream bus.

◆ i2cmux5_check_ch_alert()

uint8_t i2cmux5_check_ch_alert ( i2cmux5_t * ctx,
uint8_t n_channel )

I2C MUX 5 check channel alert function.

This function reads a desired channel alert status of I2C MUX 5 click board.

Parameters
[in]ctx: Click context object. See i2cmux5_t object definition for detailed explanation.
[in]ch_numb: The number of the desired channel ( from 1 to 4 ).
[in]rx_len: Number of bytes to be read.
Returns
Alert status on the selected channel:
  • 0 - Inactive,
  • 1 - Active,
  • 255 - Error, wrong channel selection.
Note
None.

◆ i2cmux5_check_rdy()

uint8_t i2cmux5_check_rdy ( i2cmux5_t * ctx)

I2C MUX 5 check rdy function.

This function check connection ready digital output of I2C MUX 5 click board.

Parameters
[in]ctx: Click context object. See i2cmux5_t object definition for detailed explanation.
Returns
  • 0 - None of the downstream channels is connected,
  • 1 - One or more downstream channels is connected.

◆ i2cmux5_default_cfg()

void i2cmux5_default_cfg ( i2cmux5_t * ctx)

I2C MUX 5 default configuration function.

This function executes a default configuration of I2C MUX 5 click board.

Parameters
[in]ctx: Click context object. See i2cmux5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ i2cmux5_dev_enable()

void i2cmux5_dev_enable ( i2cmux5_t * ctx)

I2C MUX 5 enable the device function.

This function executes power-up of the device and enables I2C communication of I2C MUX 5 click board.

Parameters
[in]ctx: Click context object. See i2cmux5_t object definition for detailed explanation.

◆ i2cmux5_generic_read()

err_t i2cmux5_generic_read ( i2cmux5_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

I2C MUX 5 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 i2cmux5_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
None.

◆ i2cmux5_generic_write()

err_t i2cmux5_generic_write ( i2cmux5_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

I2C MUX 5 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 i2cmux5_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
None.

◆ i2cmux5_hw_reset()

void i2cmux5_hw_reset ( i2cmux5_t * ctx)

I2C MUX 5 HW reset function.

This function executes a hardware reset of I2C MUX 5 click board.

Parameters
[in]ctx: Click context object. See i2cmux5_t object definition for detailed explanation.

◆ i2cmux5_init()

err_t i2cmux5_init ( i2cmux5_t * ctx,
i2cmux5_cfg_t * cfg )

I2C MUX 5 initialization function.

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

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