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-08-10
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: SPI
Downloaded: 2101 times
Not followed.
License: MIT license
SPI Extend Click is a compact add-on board for applications that require extending the SPI communication bus over a long distance. This board features the LTC4332, an SPI slave extender device, from Analog Devices.
Do you want to subscribe in order to receive notifications regarding "SPI Extend click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "SPI Extend click" changes.
Do you want to report abuse regarding "SPI Extend click".
Library Description
The library covers all the necessary functions to control SPI Extend click board. Library performs a standard SPI interface communication.
Key functions:
void spiextend_generic_write ( uint8_t reg, uint8_t tx_data )
- Generic write data function.void spiextend_get_config ( spiextend_config_data_t *config_data )
- Get the configuration function.uint8_t spiextend_rmt_read ( uint8_t reg, uint8_t sel_slave )
- Generic read data in Remote Mode function.Examples description
The application is composed of three sections :
void application_task ( )
{
spiextend_get_status( &spiextend_status );
if ( spiextend_status.nlink == SPIEXTEND_STATUS_ACTIVE )
{
spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTX_L_A );
mikrobus_logWrite( " Accel X : ", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_LINE );
spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTY_L_A );
mikrobus_logWrite( " Accel Y : ", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_LINE );
spiextend_accel14_get_axis( SPIEXTEND_ACCEL14_REG_OUTZ_L_A );
mikrobus_logWrite( " Accel Z : ", _LOG_TEXT );
IntToStr( axis, log_text );
mikrobus_logWrite( log_text, _LOG_LINE );
mikrobus_logWrite( "---------------------", _LOG_LINE );
Delay_ms( 1000 );
}
else
{
mikrobus_logWrite( " LINK not established", _LOG_LINE );
mikrobus_logWrite( "---------------------", _LOG_LINE );
Delay_ms( 1000 );
}
}
Additional Functions :
void spiextend_accel14_get_axis ( uint8_t axis_out_reg )
- Read axis.void spiextend_display_status ( uint8_t check_status )
- Display status.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.