We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-09-10
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: I2C
Downloaded: 1738 times
Not followed.
License: MIT license
I2C MUX 4 Click is a compact add-on board that contains a dual bidirectional translating switch dedicated for applications with I2C slave address conflicts. This board features the TCA9543APWR, a low voltage 2-channel I2C bus switch with interrupt logic from Texas Instruments.
Do you want to subscribe in order to receive notifications regarding "I2C MUX 4 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "I2C MUX 4 click" changes.
Do you want to report abuse regarding "I2C MUX 4 click".
Library Description
The library covers all the necessary functions to control I2C MUX 4 Click board. A library performs the communication with the TCA9543A Low Voltage 2-Channel I2C Bus Switch via I2C interface.
Key functions:
void i2cmux4_power_on ( uint8_t enable )
- Power On function.void i2cmux4_set_channel ( uint8_t sel_ch, uint8_t ch_slave_addr )
- Set channel function.uint8_t i2cmux4_check_int ( void )
- Check interrupt function.Examples description
The application is composed of three sections :
void application_task ( )
{
// CH 0 - 6DOF IMU 12 click
i2cmux4_set_channel( I2CMUX4_SEL_CH_0, 0x68 );
Delay_ms( 100 );
i2cmux4_rmt_read_bytes( 0x00, &rx_data, 1 );
Delay_ms( 100 );
ByteToHex( rx_data, log_text );
mikrobus_logWrite( " 6DOF IMU 12 click ", _LOG_LINE );
mikrobus_logWrite( "- - - - - - - - - - - -", _LOG_LINE );
mikrobus_logWrite( " ID = 0x", _LOG_TEXT );
mikrobus_logWrite( log_text, _LOG_LINE );
mikrobus_logWrite( "-----------------------", _LOG_LINE );
Delay_ms( 1000 );
// CH 1 - RTC 10 click
i2cmux4_set_channel( I2CMUX4_SEL_CH_1, 0x68 );
Delay_ms( 100 );
i2cmux4_rmt_read_bytes( 0x0F, &rx_data, 1 );
Delay_ms( 100 );
ByteToHex( rx_data, log_text );
mikrobus_logWrite( " RTC 10 click ", _LOG_LINE );
mikrobus_logWrite( "- - - - - - - - - - - -", _LOG_LINE );
mikrobus_logWrite( " ID = 0x", _LOG_TEXT );
mikrobus_logWrite( log_text, _LOG_LINE );
mikrobus_logWrite( "-----------------------", _LOG_LINE );
Delay_ms( 1000 );
}
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.