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 );
}

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( 2000 );
#endif
}

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.


spirit2_generic_write
void spirit2_generic_write(spirit2_t *ctx, char *data_buf, uint16_t len)
SPIRIT 2 data writing function.
SPIRIT2_MAP_MIKROBUS
#define SPIRIT2_MAP_MIKROBUS(cfg, mikrobus)
Definition: spirit2.h:59
SPIRIT2_PCFG_TXRXLED_OPEN_DRAIN
#define SPIRIT2_PCFG_TXRXLED_OPEN_DRAIN
Definition: spirit2.h:201
spirit2_cfg_setup
void spirit2_cfg_setup(spirit2_cfg_t *cfg)
SPIRIT 2 configuration object setup function.
SPIRIT2_CMD_STORE_CURRENT_CONFIG
#define SPIRIT2_CMD_STORE_CURRENT_CONFIG
Definition: spirit2.h:102
SPIRIT2_CMD_ENTER_COMMAND_MODE
#define SPIRIT2_CMD_ENTER_COMMAND_MODE
Definition: spirit2.h:98
spirit2_send_cmd
void spirit2_send_cmd(spirit2_t *ctx, char *cmd)
Send command function.
SPIRIT2_CMD_READ_MODULE_VERSION
#define SPIRIT2_CMD_READ_MODULE_VERSION
Definition: spirit2.h:100
SPIRIT2_CMD_ENTER_OPERATING_MODE
#define SPIRIT2_CMD_ENTER_OPERATING_MODE
Definition: spirit2.h:99
spirit2_set_mode
void spirit2_set_mode(spirit2_t *ctx, uint8_t mode)
Set mode function.
spirit2_reset
void spirit2_reset(spirit2_t *ctx)
Software reset function.
SPIRIT2_CMD_CFG_TXRX_LED
#define SPIRIT2_CMD_CFG_TXRX_LED
Definition: spirit2.h:148
application_task
void application_task(void)
Definition: main.c:115
spirit2_cfg_t
SPIRIT 2 Click configuration object.
Definition: spirit2.h:251
spirit2_init
err_t spirit2_init(spirit2_t *ctx, spirit2_cfg_t *cfg)
SPIRIT 2 initialization function.
spirit2_send_cmd_with_parameter
void spirit2_send_cmd_with_parameter(spirit2_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
SPIRIT2_MODULE_WAKE_UP
#define SPIRIT2_MODULE_WAKE_UP
Definition: spirit2.h:90
TEXT_TO_SEND
#define TEXT_TO_SEND
Definition: main.c:33
SPIRIT2_OPERATING_MODE
#define SPIRIT2_OPERATING_MODE
Definition: spirit2.h:87
spirit2_t
SPIRIT 2 Click context object.
Definition: spirit2.h:231
spirit2_power_module
void spirit2_power_module(spirit2_t *ctx, uint8_t power_state)
Power module function.
application_init
void application_init(void)
Definition: main.c:60