spirit2 2.0.0.0
Main Page

SPIRIT 2 click

SPIRIT 2 Click features the SP1ML-915, an ultra-low power, fully integrated RF module, which operates at 915 MHz ISM band. This Click boardâ„¢ can be used to add wireless connectivity to any application, requiring no extensive RF communication experience. The module integrates all the required components, including the 32-bit STM32L1 MCU, a compact chip antenna, and accompanying circuitry. The SP1ML-915 module supports several types of modulation schemes, including 2-FSK, GFSK, GMSK, OOK, and ASK, allowing it to fulfill different RF transmission requirements.

click Product page


Click library

  • Author : Jelena Milosavljevic
  • Date : Jul 2021.
  • Type : UART type

Software Support

We provide a library for the SPIRIT2 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 SPIRIT2 Click driver.

Standard key functions :

Example key functions :

Example Description

‍This example reads and processes data from SPIRIT2 2 clicks.

The demo application is composed of two sections :

Application Init

‍Initializes driver and wake-up module.

void application_init ( void )
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
SPIRIT2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
spirit2_init( &spirit2, &cfg );
Delay_ms ( 1000 );
log_info( &logger, "---- Configuring the module ----" );
spirit2_reset( &spirit2 );
Delay_ms ( 1000 );
log_printf( &logger, "COMMAND MODE\r\n" );
spirit2_process( );
log_printf( &logger, "FIRMWARE VERSION\r\n" );
spirit2_process( );
log_printf( &logger, "TXRX LED - OPEN DRAIN OUTPUT\r\n" );
spirit2_process( );
log_printf( &logger, "STORE CONFIG\r\n" );
spirit2_process( );
log_printf( &logger, "OPERATING MODE\r\n" );
spirit2_process( );
log_info( &logger, "---- The module has been configured ----" );
#ifdef DEMO_APP_RECEIVER
log_info( &logger, "---- RECEIVER MODE ----" );
#endif
#ifdef DEMO_APP_TRANSMITTER
log_info( &logger, "---- TRANSMITTER MODE ----" );
#endif
Delay_ms ( 1000 );
}
#define SPIRIT2_CMD_CFG_TXRX_LED
Definition spirit2.h:152
#define SPIRIT2_MAP_MIKROBUS(cfg, mikrobus)
Definition spirit2.h:63
#define SPIRIT2_OPERATING_MODE
Definition spirit2.h:91
#define SPIRIT2_MODULE_WAKE_UP
Definition spirit2.h:94
#define SPIRIT2_CMD_READ_MODULE_VERSION
Definition spirit2.h:104
#define SPIRIT2_CMD_ENTER_OPERATING_MODE
Definition spirit2.h:103
#define SPIRIT2_CMD_STORE_CURRENT_CONFIG
Definition spirit2.h:106
#define SPIRIT2_CMD_ENTER_COMMAND_MODE
Definition spirit2.h:102
#define SPIRIT2_PCFG_TXRXLED_OPEN_DRAIN
Definition spirit2.h:205
void spirit2_send_cmd_with_parameter(spirit2_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
void spirit2_send_cmd(spirit2_t *ctx, char *cmd)
Send command function.
void application_init(void)
Definition main.c:60

Application Task

‍Reads the received data and parses it.

void application_task ( void ) {
#ifdef DEMO_APP_RECEIVER
spirit2_process( );
#endif
#ifdef DEMO_APP_TRANSMITTER
log_info( &logger, "---- The message has been sent ----" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
#endif
}
void spirit2_generic_write(spirit2_t *ctx, char *data_buf, uint16_t len)
SPIRIT 2 data writing function.
void application_task(void)
Definition main.c:115
#define TEXT_TO_SEND
Definition main.c:33

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.SPIRIT2

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.