solidswitch8 2.1.0.0
Main Page

SolidSwitch 8 click

PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU

[click Product page](CLICK_PRODUCT_PAGE_LINK)


Click library

  • Author : Stefan Ilic
  • Date : Jan 2024.
  • Type : GPIO type

Software Support

We provide a library for the SolidSwitch 8 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for SolidSwitch 8 Click driver.

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of SolidSwitch 8 Click board by switching state of the switch.

The demo application is composed of two sections :

Application Init

Initializes the driver, performs the click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
solidswitch8_cfg_t solidswitch8_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
solidswitch8_cfg_setup( &solidswitch8_cfg );
SOLIDSWITCH8_MAP_MIKROBUS( solidswitch8_cfg, MIKROBUS_1 );
if ( DIGITAL_OUT_UNSUPPORTED_PIN == solidswitch8_init( &solidswitch8, &solidswitch8_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
solidswitch8_default_cfg ( &solidswitch8 );
log_info( &logger, " Application Task " );
}
#define SOLIDSWITCH8_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: solidswitch8.h:88
void application_init(void)
Definition: main.c:29

Application Task

Switching state of the output every 5 seconds, and monitoring the status of the device.

void application_task ( void )
{
{
log_error( &logger, " Detected over temperature condition." );
for ( ; ; );
}
log_printf( &logger, " Switch state cloased. \r\n" );
Delay_ms( 5000 );
log_printf( &logger, " Switch state open. \r\n" );
Delay_ms( 5000 );
}
#define SOLIDSWITCH8_PIN_STATE_HIGH
Definition: solidswitch8.h:71
#define SOLIDSWITCH8_PIN_STATE_LOW
SolidSwitch 8 description setting.
Definition: solidswitch8.h:70
void application_task(void)
Definition: main.c:61

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.SolidSwitch8

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. UART terminal is available in all MikroElektronika compilers.