nfctag5 2.0.0.0
NFC Tag 5 Click Driver

API for configuring and manipulating NFC Tag 5 Click driver. More...

Topics

 NFC Tag 5 Registers List
 List of registers of NFC Tag 5 Click driver.
 
 NFC Tag 5 Registers Settings
 Settings for registers of NFC Tag 5 Click driver.
 
 NFC Tag 5 MikroBUS Map
 MikroBUS pin mapping of NFC Tag 5 Click driver.
 

Functions

void nfctag5_cfg_setup (nfctag5_cfg_t *cfg)
 NFC Tag 5 configuration object setup function.
 
err_t nfctag5_init (nfctag5_t *ctx, nfctag5_cfg_t *cfg)
 NFC Tag 5 initialization function.
 
err_t nfctag5_default_cfg (nfctag5_t *ctx)
 NFC Tag 5 default configuration function.
 
err_t nfctag5_set_address_mode (nfctag5_t *ctx, uint8_t mode)
 NFC Tag 5 set address mode function.
 
err_t nfctag5_write_memory_block (nfctag5_t *ctx, uint16_t block_addr, nfctag5_block_t *block)
 NFC Tag 5 write memory block function.
 
err_t nfctag5_read_memory_block (nfctag5_t *ctx, uint16_t block_addr, nfctag5_block_t *block)
 NFC Tag 5 read memory block function.
 
err_t nfctag5_write_multiple_memory_block (nfctag5_t *ctx, uint16_t block_addr, nfctag5_block_t *block, uint8_t num_blocks)
 NFC Tag 5 write multiple memory block function.
 
err_t nfctag5_read_multiple_memory_block (nfctag5_t *ctx, uint16_t block_addr, nfctag5_block_t *block, uint8_t num_blocks)
 NFC Tag 5 read multiple memory block function.
 
err_t nfctag5_write_ndef_uri_record (nfctag5_t *ctx, uint8_t uri_prefix, uint8_t *uri_data, uint8_t data_len)
 NFC Tag 5 write NDEF URI record function.
 
err_t nfctag5_format_memory (nfctag5_t *ctx)
 NFC Tag 5 format memory function.
 
err_t nfctag5_write_message_to_memory (nfctag5_t *ctx, uint16_t block_addr, uint8_t *message, uint16_t message_len)
 NFC Tag 5 write message to memory function.
 
err_t nfctag5_read_message_from_memory (nfctag5_t *ctx, uint16_t block_addr, uint8_t *message, uint16_t message_len)
 NFC Tag 5 read message from memory function.
 
err_t nfctag5_read_vh_pin_value (nfctag5_t *ctx, uint16_t *data_out)
 NFC Tag 5 read AN pin value function.
 
err_t nfctag5_read_vh_pin_voltage (nfctag5_t *ctx, float *data_out)
 NFC Tag 5 read VH pin voltage level function.
 
uint8_t nfctag5_get_busy_pin (nfctag5_t *ctx)
 NFC Tag 5 get busy pin function.
 

Detailed Description

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

◆ nfctag5_cfg_setup()

void nfctag5_cfg_setup ( nfctag5_cfg_t * cfg)

NFC Tag 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ nfctag5_default_cfg()

err_t nfctag5_default_cfg ( nfctag5_t * ctx)

NFC Tag 5 default configuration function.

This function executes a default configuration of NFC Tag 5 click board.

Parameters
[in]ctx: Click context object. See nfctag5_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.

◆ nfctag5_format_memory()

err_t nfctag5_format_memory ( nfctag5_t * ctx)

NFC Tag 5 format memory function.

This function formats the whole user memory.

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

◆ nfctag5_get_busy_pin()

uint8_t nfctag5_get_busy_pin ( nfctag5_t * ctx)

NFC Tag 5 get busy pin function.

This function returns the BUSY pin logic state.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ nfctag5_init()

err_t nfctag5_init ( nfctag5_t * ctx,
nfctag5_cfg_t * cfg )

NFC Tag 5 initialization function.

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

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

◆ nfctag5_read_memory_block()

err_t nfctag5_read_memory_block ( nfctag5_t * ctx,
uint16_t block_addr,
nfctag5_block_t * block )

NFC Tag 5 read memory block function.

This function reads a memory block data from the selected address by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
[in]block_addr: User memory block address.
[out]block: Address of memory block where to store read data. See nfctag5_block_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfctag5_read_message_from_memory()

err_t nfctag5_read_message_from_memory ( nfctag5_t * ctx,
uint16_t block_addr,
uint8_t * message,
uint16_t message_len )

NFC Tag 5 read message from memory function.

This function reads specified number of data bytes from the user memory starting from block_addr.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
[in]block_addr: User memory block address.
[out]message: Array of bytes where to store read data.
[in]message_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfctag5_read_multiple_memory_block()

err_t nfctag5_read_multiple_memory_block ( nfctag5_t * ctx,
uint16_t block_addr,
nfctag5_block_t * block,
uint8_t num_blocks )

NFC Tag 5 read multiple memory block function.

This function reads multiple memory blocks starting from the selected address by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
[in]block_addr: User memory block address.
[out]block: Array of memory blocks where to store read data. See nfctag5_block_t object definition for detailed explanation.
[in]num_blocks: Number of blocks to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfctag5_read_vh_pin_value()

err_t nfctag5_read_vh_pin_value ( nfctag5_t * ctx,
uint16_t * data_out )

NFC Tag 5 read AN pin value function.

This function reads results of AD conversion of the VH pin.

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

◆ nfctag5_read_vh_pin_voltage()

err_t nfctag5_read_vh_pin_voltage ( nfctag5_t * ctx,
float * data_out )

NFC Tag 5 read VH pin voltage level function.

This function reads results of AD conversion of the VH pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ nfctag5_set_address_mode()

err_t nfctag5_set_address_mode ( nfctag5_t * ctx,
uint8_t mode )

NFC Tag 5 set address mode function.

This function sets the address mode to config or user memory.

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

◆ nfctag5_write_memory_block()

err_t nfctag5_write_memory_block ( nfctag5_t * ctx,
uint16_t block_addr,
nfctag5_block_t * block )

NFC Tag 5 write memory block function.

This function writes a memory block data to the selected address by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
[in]block_addr: User memory block address.
[in]block: Address of memory block to be written. See nfctag5_block_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfctag5_write_message_to_memory()

err_t nfctag5_write_message_to_memory ( nfctag5_t * ctx,
uint16_t block_addr,
uint8_t * message,
uint16_t message_len )

NFC Tag 5 write message to memory function.

This function writes specified number of data bytes to the user memory starting from block_addr.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
[in]block_addr: User memory block address.
[in]message: Array of bytes to be written.
[in]message_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfctag5_write_multiple_memory_block()

err_t nfctag5_write_multiple_memory_block ( nfctag5_t * ctx,
uint16_t block_addr,
nfctag5_block_t * block,
uint8_t num_blocks )

NFC Tag 5 write multiple memory block function.

This function writes multiple memory blocks starting from the selected address by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
[in]block_addr: User memory block address.
[in]block: Array of memory block to be written. See nfctag5_block_t object definition for detailed explanation.
[in]num_blocks: Number of blocks to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfctag5_write_ndef_uri_record()

err_t nfctag5_write_ndef_uri_record ( nfctag5_t * ctx,
uint8_t uri_prefix,
uint8_t * uri_data,
uint8_t data_len )

NFC Tag 5 write NDEF URI record function.

This function writes specific NDEF URI record to the memory address specified with NTAG5LINK_NDEF_MESSAGE_START_ADDRESS macro.

Parameters
[in]ctx: Click context object. See nfctag5_t object definition for detailed explanation.
[in]uri_prefix: URI prefix code [0x00-0x23]. See #nfctag5_set group for detailed explanation.
[in]uri_data: URI data to be written.
[in]data_len: URI data length.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.