magicrfid 2.0.0.0
Magic RFID Click Driver

API for configuring and manipulating Magic RFID Click driver. More...

Topics

 Magic RFID Device Settings
 Settings for registers of Magic RFID Click driver.
 
 Magic RFID MikroBUS Map
 MikroBUS pin mapping of Magic RFID Click driver.
 

Functions

void magicrfid_cfg_setup (magicrfid_cfg_t *cfg)
 Magic RFID configuration object setup function.
 
err_t magicrfid_init (magicrfid_t *ctx, magicrfid_cfg_t *cfg)
 Magic RFID initialization function.
 
void magicrfid_default_cfg (magicrfid_t *ctx)
 Magic RFID default configuration function.
 
err_t magicrfid_generic_write (magicrfid_t *ctx, uint8_t *data_buf, uint16_t len)
 Magic RFID data writing function.
 
err_t magicrfid_generic_read (magicrfid_t *ctx, uint8_t *data_buf, uint16_t max_len)
 Magic RFID data reading function.
 
void magicrfid_device_reset (magicrfid_t *ctx)
 Magic RFID device reset function.
 
void magicrfid_send_command (magicrfid_t *ctx, magicrfid_command_t cmd)
 Magic RFID send command function.
 
err_t magicrfid_get_response (magicrfid_t *ctx, magicrfid_response_t *rsp)
 Magic RFID get response function.
 
int8_t magicrfid_parse_tag_rssi (magicrfid_response_t rsp)
 Parse Tag RSSI value.
 
uint32_t magicrfid_parse_tag_freq (magicrfid_response_t rsp)
 Parse Tag Freq value.
 
void magicrfid_parse_tag_epc (magicrfid_response_t rsp, magicrfid_epc_t *epc)
 Parse Tag EPC bytes.
 
void magicrfid_set_tag_protocol (magicrfid_t *ctx, uint8_t protocol)
 Magic RFID set protocol function.
 
void magicrfid_set_region (magicrfid_t *ctx, uint8_t region)
 Magic RFID set region function.
 
void magicrfid_set_antenna_port (magicrfid_t *ctx)
 Magic RFID turn on antenna port function.
 
void magicrfid_set_baud_rate (magicrfid_t *ctx, uint32_t baud_rate)
 Magic RFID set baud rate function.
 
void magicrfid_set_read_power (magicrfid_t *ctx, uint16_t power_setting)
 Magic RFID set read function power.
 
void magicrfid_set_write_power (magicrfid_t *ctx, uint16_t power_setting)
 Magic RFID set write function power.
 
void magicrfid_set_reader_config (magicrfid_t *ctx, uint8_t option1, uint8_t option2)
 Magic RFID set reader configuration function.
 
void magicrfid_start_reading (magicrfid_t *ctx)
 Magic RFID enable reading function.
 
void magicrfid_clear_buffers (magicrfid_t *ctx)
 Magic RFID clear buffers function.
 

Detailed Description

API for configuring and manipulating Magic RFID Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ magicrfid_cfg_setup()

void magicrfid_cfg_setup ( magicrfid_cfg_t * cfg)

Magic RFID configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See magicrfid_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ magicrfid_clear_buffers()

void magicrfid_clear_buffers ( magicrfid_t * ctx)

Magic RFID clear buffers function.

This function clears UART ring buffers.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
Returns
Nothing.

◆ magicrfid_default_cfg()

void magicrfid_default_cfg ( magicrfid_t * ctx)

Magic RFID default configuration function.

This function executes a default configuration of Magic RFID click board.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
Returns
None.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ magicrfid_device_reset()

void magicrfid_device_reset ( magicrfid_t * ctx)

Magic RFID device reset function.

Device reset and wake up module.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
Returns
Nothing.

◆ magicrfid_generic_read()

err_t magicrfid_generic_read ( magicrfid_t * ctx,
uint8_t * data_buf,
uint16_t max_len )

Magic RFID data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.

◆ magicrfid_generic_write()

err_t magicrfid_generic_write ( magicrfid_t * ctx,
uint8_t * data_buf,
uint16_t len )

Magic RFID data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.

◆ magicrfid_get_response()

err_t magicrfid_get_response ( magicrfid_t * ctx,
magicrfid_response_t * rsp )

Magic RFID get response function.

Get response function.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[out]rsp: Response object. See magicrfid_response_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ magicrfid_init()

err_t magicrfid_init ( magicrfid_t * ctx,
magicrfid_cfg_t * cfg )

Magic RFID initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See magicrfid_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ magicrfid_parse_tag_epc()

void magicrfid_parse_tag_epc ( magicrfid_response_t rsp,
magicrfid_epc_t * epc )

Parse Tag EPC bytes.

This function parses EPC bytes of the tag.

Parameters
[in]rsp: Response object. See magicrfid_response_t object definition for detailed explanation.
[out]epc: EPC data object. See magicrfid_epc_t object definition for detailed explanation.
Returns
Nothing.

◆ magicrfid_parse_tag_freq()

uint32_t magicrfid_parse_tag_freq ( magicrfid_response_t rsp)

Parse Tag Freq value.

This function parses the frequency value the tag was detected at.

Parameters
[in]rsp: Response object. See magicrfid_response_t object definition for detailed explanation.
Returns
Frequency value.

◆ magicrfid_parse_tag_rssi()

int8_t magicrfid_parse_tag_rssi ( magicrfid_response_t rsp)

Parse Tag RSSI value.

This function parses RSSI value of the tag.

Parameters
[in]rsp: Response object. See magicrfid_response_t object definition for detailed explanation.
Returns
RSSI value

◆ magicrfid_send_command()

void magicrfid_send_command ( magicrfid_t * ctx,
magicrfid_command_t cmd )

Magic RFID send command function.

Send command function.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[in]cmd: Command object. See magicrfid_command_t object definition for detailed explanation.
Returns
Nothing.

◆ magicrfid_set_antenna_port()

void magicrfid_set_antenna_port ( magicrfid_t * ctx)

Magic RFID turn on antenna port function.

This function is used for setting up antenna port of Magic RFID Click Board by using UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
Returns
Nothing.

◆ magicrfid_set_baud_rate()

void magicrfid_set_baud_rate ( magicrfid_t * ctx,
uint32_t baud_rate )

Magic RFID set baud rate function.

This function is used for setting up baud rate of Magic RFID Click Board by using UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[in]baud_rate: Baud rate value.
Returns
Nothing.

◆ magicrfid_set_read_power()

void magicrfid_set_read_power ( magicrfid_t * ctx,
uint16_t power_setting )

Magic RFID set read function power.

This function is used for setting up read power of Magic RFID Click Board in dBm by using UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[in]power_setting: Power setting value in dBm.
Returns
Nothing.

◆ magicrfid_set_reader_config()

void magicrfid_set_reader_config ( magicrfid_t * ctx,
uint8_t option1,
uint8_t option2 )

Magic RFID set reader configuration function.

This function is used for sending optional parameters to Magic RFID Click BoardSends optional parameters by using the UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
Returns
Nothing.

◆ magicrfid_set_region()

void magicrfid_set_region ( magicrfid_t * ctx,
uint8_t region )

Magic RFID set region function.

This function is used for setting up region of Magic RFID Click Board by using UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[in]region: Selected region.
Returns
Nothing.

◆ magicrfid_set_tag_protocol()

void magicrfid_set_tag_protocol ( magicrfid_t * ctx,
uint8_t protocol )

Magic RFID set protocol function.

This function is used for setting up protocol of Magic RFID Click Board by using UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[in]protocol: Selected protocol.
Returns
Nothing.

◆ magicrfid_set_write_power()

void magicrfid_set_write_power ( magicrfid_t * ctx,
uint16_t power_setting )

Magic RFID set write function power.

This function is used for setting up write power of Magic RFID Click Board in dBm by using UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
[in]power_setting: Power setting value in dBm.
Returns
Nothing.

◆ magicrfid_start_reading()

void magicrfid_start_reading ( magicrfid_t * ctx)

Magic RFID enable reading function.

This function is used for setting up Magic RFID Click Board in continuous reading mode by using the UART serial interface.

Parameters
[in]ctx: Click context object. See magicrfid_t object definition for detailed explanation.
Returns
Nothing.