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-12-01
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: I2C
Downloaded: 1725 times
Not followed.
License: MIT license
I2C Extend 2 Click is a compact add-on board suitable for I2C communication bus extension. This board features the PCA9615, a 2-channel multipoint differential I2C bus buffer with hot-swap logic from NXP Semiconductors.
Do you want to subscribe in order to receive notifications regarding "I2C Extend 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "I2C Extend 2 click" changes.
Do you want to report abuse regarding "I2C Extend 2 click".
Library Description
The library covers all the necessary functions to control I2C Extend 2 Click board™. Library performs a standard I2C interface communication.
Key functions:
void i2cextend2_rmt_write ( uint8_t rmt_slave_addr, uint8_t reg, uint8_t tx_data )
- Generic write data to the remote device function.uint8_t i2cextend2_rmt_read ( uint8_t rmt_slave_addr, uint8_t reg )
- Generic read data from the remote device function.void i2cextend2_enable ( uint8_t en_extend )
- Enable extend function.Examples description
The application is composed of three sections :
void application_task ( )
{
mikrobus_logWrite( " Accel | Mag ", _LOG_LINE );
mikrobus_logWrite( "------------------------", _LOG_LINE );
i2cextend2_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_XOUT_L );
mikrobus_logWrite( " X :", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_TEXT );
mikrobus_logWrite( " | ", _LOG_TEXT );
i2cextend2_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_XOUT_L );
mikrobus_logWrite( " X :", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_LINE );
i2cextend2_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_YOUT_L );
mikrobus_logWrite( " Y :", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_TEXT );
mikrobus_logWrite( " | ", _LOG_TEXT );
i2cextend2_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_YOUT_L );
mikrobus_logWrite( " Y :", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_LINE );
i2cextend2_6dofimu11_get_axis( C6DOFIMU11_REG_ACCEL_ZOUT_L );
mikrobus_logWrite( " Z :", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_TEXT );
mikrobus_logWrite( " | ", _LOG_TEXT );
i2cextend2_6dofimu11_get_axis( C6DOFIMU11_REG_MAG_ZOUT_L );
mikrobus_logWrite( " Z :", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_LINE );
mikrobus_logWrite( "------------------------", _LOG_LINE );
Delay_ms( 1000 );
}
void i2cextend2_6dofimu11_get_axis ( uint8_t axis_out_reg )
- Read axis.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.