Magic RFID click
Magic RFID Click is a compact add-on board that contains an embedded RFID module. This board features the M6E-NANO, UHF RFID module with ultra-low power consumption from JADAK. Supporting the EPC Gen2V2 and ISO 18000-63 standard, the M6E-NANO module is available for global use. It operates in the Ultra High Frequency (UHF) band in a range from 859 up to 930MHz and can be used for write/read applications.
click Product page
Click library
- Author : MikroE Team
- Date : Sep 2021.
- Type : UART type
Software Support
We provide a library for the MagicRFID 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 MagicRFID Click driver.
Standard key functions :
magicrfid_cfg_setup
Config Object Initialization function.
void magicrfid_cfg_setup(magicrfid_cfg_t *cfg)
Magic RFID configuration object setup function.
Magic RFID Click configuration object.
Definition magicrfid.h:194
magicrfid_init
Initialization function.
err_t magicrfid_init(magicrfid_t *ctx, magicrfid_cfg_t *cfg)
Magic RFID initialization function.
Magic RFID Click context object.
Definition magicrfid.h:176
magicrfid_default_cfg
Click Default Configuration function.
void magicrfid_default_cfg(magicrfid_t *ctx)
Magic RFID default configuration function.
Example key functions :
magicrfid_get_response
Magic RFID get response function.
err_t magicrfid_get_response(magicrfid_t *ctx, magicrfid_response_t *rsp)
Magic RFID get response function.
Magic RFID Click response object.
Definition magicrfid.h:228
magicrfid_parse_tag_rssi
This function parses RSSI value of the tag.
int8_t magicrfid_parse_tag_rssi(magicrfid_response_t rsp)
Parse Tag RSSI value.
magicrfid_parse_tag_epc
This function parses EPC bytes of the tag.
void magicrfid_parse_tag_epc(magicrfid_response_t rsp, magicrfid_epc_t *epc)
Parse Tag EPC bytes.
Magic RFID Click EPC data object.
Definition magicrfid.h:241
Example Description
This example reads and processes data from Magic RFID clicks.
The demo application is composed of two sections :
Application Init
Initialize driver init and starts default configuration module.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define MAGICRFID_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition magicrfid.h:163
void application_init(void)
Definition main.c:28
Application Task
Scans for RFID TAGs and displays on the USB UART the EPC bytes of the detected tag.
It also parses and displays the RSSI as well as the frequency this tag was detected at.
{
{
{
log_printf( &logger, "\r\n --- SCANNING ---\r\n" );
}
else
{
log_printf( &logger, "\r\n --- TAG DETECTED ---\r\n" );
int8_t tag_rssi = 0;
uint32_t tag_freq = 0;
log_printf( &logger, " RSSI: %d\r\n", ( int16_t ) tag_rssi );
log_printf( &logger, " FREQ: %lu\r\n", tag_freq );
log_printf( &logger,
" EPC PC: 0x%.4X\r\n", epc.
epc_pc );
log_printf( &logger,
" EPC ID (len: %u): ", ( uint16_t ) epc.
data_len );
for ( uint8_t cnt = 0; cnt < epc.
data_len; cnt++ )
{
log_printf( &logger,
"%.2X", ( uint16_t ) epc.
data_buf[ cnt ] );
}
log_printf( &logger,
"\r\n EPC CRC: 0x%.4X\r\n", epc.
epc_crc );
Delay_ms ( 100 );
}
}
}
#define MAGICRFID_OPCODE_READ_TAG_ID_MULTIPLE
Definition magicrfid.h:76
uint32_t magicrfid_parse_tag_freq(magicrfid_response_t rsp)
Parse Tag Freq value.
void magicrfid_clear_buffers(magicrfid_t *ctx)
Magic RFID clear buffers function.
@ MAGICRFID_OK
Definition magicrfid.h:255
void application_task(void)
Definition main.c:58
uint16_t epc_pc
Definition magicrfid.h:243
uint8_t data_buf[MAGICRFID_EPC_MAX_DATA_LEN]
Definition magicrfid.h:244
uint8_t data_len
Definition magicrfid.h:242
uint16_t epc_crc
Definition magicrfid.h:245
uint8_t opcode
Definition magicrfid.h:230
uint8_t data_len
Definition magicrfid.h:229
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.MagicRFID
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.