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 :
spirit2_cfg_setup
Config Object Initialization function.
void spirit2_cfg_setup(spirit2_cfg_t *cfg)
SPIRIT 2 configuration object setup function.
SPIRIT 2 Click configuration object.
Definition: spirit2.h:241
spirit2_init
Initialization function.
err_t spirit2_init(spirit2_t *ctx, spirit2_cfg_t *cfg)
SPIRIT 2 initialization function.
SPIRIT 2 Click context object.
Definition: spirit2.h:221
Example key functions :
spirit2_power_module
Function for power mode of SPIRIT 2 click.
void spirit2_power_module(spirit2_t *ctx, uint8_t power_state)
Power module function.
spirit2_reset
Function for reseting SPIRIT 2 click.
void spirit2_reset(spirit2_t *ctx)
Software reset function.
spirit2_set_mode
Function for setting mode of SPIRIT 2 click.
void spirit2_set_mode(spirit2_t *ctx, uint8_t mode)
Set mode function.
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.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
Delay_ms( 1000 );
log_info( &logger, "---- Configuring the module ----" );
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:138
#define SPIRIT2_MAP_MIKROBUS(cfg, mikrobus)
Definition: spirit2.h:49
#define SPIRIT2_OPERATING_MODE
Definition: spirit2.h:77
#define SPIRIT2_MODULE_WAKE_UP
Definition: spirit2.h:80
#define SPIRIT2_CMD_READ_MODULE_VERSION
Definition: spirit2.h:90
#define SPIRIT2_CMD_ENTER_OPERATING_MODE
Definition: spirit2.h:89
#define SPIRIT2_CMD_STORE_CURRENT_CONFIG
Definition: spirit2.h:92
#define SPIRIT2_CMD_ENTER_COMMAND_MODE
Definition: spirit2.h:88
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.
#define SPIRIT2_PCFG_TXRXLED_OPEN_DRAIN
Definition: spirit2.h:191
void application_init(void)
Definition: main.c:60
Application Task
Reads the received data and parses it.
#ifdef DEMO_APP_RECEIVER
spirit2_process( );
#endif
#ifdef DEMO_APP_TRANSMITTER
log_info( &logger, "---- The message has been sent ----" );
Delay_ms( 2000 );
#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.