rfid 2.0.0.0
RFID Click Driver

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

Topics

 RFID Registers List
 List of registers of RFID Click driver.
 
 RFID Registers Settings
 Settings for registers of RFID Click driver.
 
 RFID MikroBUS Map
 MikroBUS pin mapping of RFID Click driver.
 

Functions

void rfid_cfg_setup (rfid_cfg_t *cfg)
 RFID configuration object setup function.
 
err_t rfid_init (rfid_t *ctx, rfid_cfg_t *cfg)
 RFID initialization function.
 
err_t rfid_default_cfg (rfid_t *ctx)
 RFID default configuration function.
 
err_t rfid_send_command (rfid_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 RFID command writing function.
 
err_t rfid_read_data (rfid_t *ctx, uint8_t *data_out)
 RFID data reading function.
 
uint8_t rfid_data_ready (rfid_t *ctx)
 RFID data ready function.
 
err_t rfid_reset (rfid_t *ctx)
 RFID reset function.
 
err_t rfid_check_echo (rfid_t *ctx)
 RFID check echo response.
 
err_t rfid_calibration (rfid_t *ctx)
 RFID calibration function.
 
err_t rfid_get_device_id (rfid_t *ctx, uint8_t *device_id)
 RFID get device id function.
 
err_t rfid_select_communication_interface (rfid_t *ctx, uint8_t com_interface)
 Select communication interface.
 
err_t rfid_select_rfid_protocol (rfid_t *ctx, uint8_t rfid_protocol)
 Select RF communication protocol.
 
err_t rfid_set_index_mod_and_gain (rfid_t *ctx)
 Configure IndexMod and Gain.
 
err_t rfid_auto_detect_filter (rfid_t *ctx)
 Configure auto detect filter.
 
err_t rfid_get_tag_uid (rfid_t *ctx, uint8_t rfid_protocol, uint8_t *tag_uid)
 RFID get RFID tag uid function.
 

Detailed Description

API for configuring and manipulating 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

◆ rfid_auto_detect_filter()

err_t rfid_auto_detect_filter ( rfid_t * ctx)

Configure auto detect filter.

This function sets Auto Detect filter register.

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_calibration()

err_t rfid_calibration ( rfid_t * ctx)

RFID calibration function.

This function calibrates the module.

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_cfg_setup()

void rfid_cfg_setup ( rfid_cfg_t * cfg)

RFID configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ rfid_check_echo()

err_t rfid_check_echo ( rfid_t * ctx)

RFID check echo response.

This function checks the echo response.

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_data_ready()

uint8_t rfid_data_ready ( rfid_t * ctx)

RFID data ready function.

This function checks if there's any data ready ( SPI mode only ).

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
Returns
  • 0x08 - data is ready,
  • 0 - data is not ready.
Note
None.

◆ rfid_default_cfg()

err_t rfid_default_cfg ( rfid_t * ctx)

RFID default configuration function.

This function executes a default configuration of RFID click board.

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ rfid_get_device_id()

err_t rfid_get_device_id ( rfid_t * ctx,
uint8_t * device_id )

RFID get device id function.

This function gets the device id.

Parameters
[in]ctx: Click context object.
[out]device_id: Device id. See rfid_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_get_tag_uid()

err_t rfid_get_tag_uid ( rfid_t * ctx,
uint8_t rfid_protocol,
uint8_t * tag_uid )

RFID get RFID tag uid function.

This function gets the RFID tag uid.

Parameters
[in]ctx: Click context object.
[in]rfid_protocol: RFID protocol ( 0x02 - RFID_ISO_14443A, 0x04 - RFID_ISO_18092NFC ).
[out]tag_uid: Tag uid. See rfid_t object definition for detailed explanation.
Returns
  • >0 - Tag length in bytes,
  • 0 - No tag detected,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_init()

err_t rfid_init ( rfid_t * ctx,
rfid_cfg_t * cfg )

RFID initialization function.

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

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

◆ rfid_read_data()

err_t rfid_read_data ( rfid_t * ctx,
uint8_t * data_out )

RFID data reading function.

This function reads all available data bytes.

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_reset()

err_t rfid_reset ( rfid_t * ctx)

RFID reset function.

This function resets the device ( SPI mode only ).

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_select_communication_interface()

err_t rfid_select_communication_interface ( rfid_t * ctx,
uint8_t com_interface )

Select communication interface.

This function selects the communication interface.

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
[in]com_interface: Communication interface ( 0x01 - SPI, 0x00 - UART ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_select_rfid_protocol()

err_t rfid_select_rfid_protocol ( rfid_t * ctx,
uint8_t rfid_protocol )

Select RF communication protocol.

This function selects the RF communication protocol.

Parameters
[in]ctx: Click context object.
[in]rfid_protocol: RFID protocol ( 0x02 - RFID_ISO_14443A, 0x04 - RFID_ISO_18092NFC ). See rfid_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_send_command()

err_t rfid_send_command ( rfid_t * ctx,
uint8_t cmd,
uint8_t * data_in,
uint8_t len )

RFID command writing function.

This function writes a desired number of data bytes starting from the selected command.

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rfid_set_index_mod_and_gain()

err_t rfid_set_index_mod_and_gain ( rfid_t * ctx)

Configure IndexMod and Gain.

This function sets IndexMod and Gain in Analog Value register.

Parameters
[in]ctx: Click context object. See rfid_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.