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-04-22
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: ADC
Downloaded: 3039 times
Not followed.
License: MIT license
AD-SWIO Click is a quad-channel software configurable input/output solution based on AD74412R, for building and process control application. The AD74412R is a quad-channel software configurable input/output solution for building and process control applications.
Do you want to subscribe in order to receive notifications regarding "AD-SWIO click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "AD-SWIO click" changes.
Do you want to report abuse regarding "AD-SWIO click".
Library Description
This library has ability to perform a full control of the AD-SWIO Click board. This click can convert and measure voltage, current and resistance from 4 independent channels and 4 different diagnostics.
Key functions:
adswio_err_t adswio_enable_ch( uint8_t channel )
- This function allows user to enable the desired channel/channels.adswio_err_t adswio_set_ch_func( uint8_t channel, uint8_t ch_func )
- This function allows user to modify the functionality of the selected channel.adswio_err_t adswio_get_conv_results( uint8_t channel, uint16_t *data_out )
- This function allows user to get the converted results of the selected channel.Examples description
The application is composed of three sections :
void application_task( )
{
adswio_rdy = adswio_status_pin_ready( );
while ( adswio_rdy == 0 )
{
adswio_rdy = adswio_status_pin_ready( );
}
adswio_err = adswio_get_conv_results( _ADSWIO_SETUP_CONV_EN_CHA,
&adswio_ch_a );
if ( adswio_err == _ADSWIO_ERR_STATUS_OK )
{
adswio_res = adswio_ch_a;
adswio_res /= _ADSWIO_RANGE_RESOLUTION;
adswio_res *= _ADSWIO_RANGE_VOLT_MV;
adswio_ch_a = adswio_res;
WordToStr( adswio_ch_a, adswio_log );
Ltrim( adswio_log );
mikrobus_logWrite( "* CH A converted result is ", _LOG_TEXT );
mikrobus_logWrite( adswio_log, _LOG_TEXT );
mikrobus_logWrite( " mV", _LOG_LINE );
Delay_ms( 100 );
}
}
Additional Functions :
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.