ntag5link 2.0.0.0
NTAG 5 Link Click Driver

API for configuring and manipulating NTAG 5 Link Click driver. More...

Topics

 
 
 

Functions

void ntag5link_cfg_setup (ntag5link_cfg_t *cfg)
 NTAG 5 Link configuration object setup function.
 
err_t ntag5link_init (ntag5link_t *ctx, ntag5link_cfg_t *cfg)
 NTAG 5 Link initialization function.
 
err_t ntag5link_default_cfg (ntag5link_t *ctx)
 NTAG 5 Link default configuration function.
 
err_t ntag5link_write_memory_block (ntag5link_t *ctx, uint16_t block_addr, ntag5link_block_t *block)
 NTAG 5 Link write memory block function.
 
err_t ntag5link_read_memory_block (ntag5link_t *ctx, uint16_t block_addr, ntag5link_block_t *block)
 NTAG 5 Link read memory block function.
 
err_t ntag5link_write_multiple_memory_block (ntag5link_t *ctx, uint16_t block_addr, ntag5link_block_t *block, uint8_t num_blocks)
 NTAG 5 Link write multiple memory block function.
 
err_t ntag5link_read_multiple_memory_block (ntag5link_t *ctx, uint16_t block_addr, ntag5link_block_t *block, uint8_t num_blocks)
 NTAG 5 Link read multiple memory block function.
 
err_t ntag5link_write_session_register (ntag5link_t *ctx, uint16_t block_addr, uint8_t byte_num, uint8_t mask, uint8_t data_in)
 NTAG 5 Link write session register function.
 
err_t ntag5link_read_session_register (ntag5link_t *ctx, uint16_t block_addr, uint8_t byte_num, uint8_t *data_out)
 NTAG 5 Link read session register function.
 
err_t ntag5link_write_ndef_uri_record (ntag5link_t *ctx, uint8_t uri_prefix, uint8_t *uri_data, uint8_t data_len)
 NTAG 5 Link write NDEF URI record function.
 
err_t ntag5link_format_memory (ntag5link_t *ctx)
 NTAG 5 Link format memory function.
 
err_t ntag5link_write_message_to_memory (ntag5link_t *ctx, uint16_t block_addr, uint8_t *message, uint16_t message_len)
 NTAG 5 Link write message to memory function.
 
err_t ntag5link_read_message_from_memory (ntag5link_t *ctx, uint16_t block_addr, uint8_t *message, uint16_t message_len)
 NTAG 5 Link read message from memory function.
 
uint8_t ntag5link_get_event_detection_pin (ntag5link_t *ctx)
 NTAG 5 Link get event detection pin function.
 
void ntag5link_enable_device (ntag5link_t *ctx)
 NTAG 5 Link enable device function.
 
void ntag5link_disable_device (ntag5link_t *ctx)
 NTAG 5 Link disable device function.
 

Detailed Description

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

◆ ntag5link_cfg_setup()

void ntag5link_cfg_setup ( ntag5link_cfg_t * cfg)

NTAG 5 Link configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ ntag5link_default_cfg()

err_t ntag5link_default_cfg ( ntag5link_t * ctx)

NTAG 5 Link default configuration function.

This function executes a default configuration of NTAG 5 Link click board.

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

◆ ntag5link_disable_device()

void ntag5link_disable_device ( ntag5link_t * ctx)

NTAG 5 Link disable device function.

This function disables the device by setting HPD pin to high logic state.

Parameters
[in]ctx: Click context object. See ntag5link_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ntag5link_enable_device()

void ntag5link_enable_device ( ntag5link_t * ctx)

NTAG 5 Link enable device function.

This function enables the device by setting HPD pin to low logic state.

Parameters
[in]ctx: Click context object. See ntag5link_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ntag5link_format_memory()

err_t ntag5link_format_memory ( ntag5link_t * ctx)

NTAG 5 Link format memory function.

This function formats the whole user memory.

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

◆ ntag5link_get_event_detection_pin()

uint8_t ntag5link_get_event_detection_pin ( ntag5link_t * ctx)

NTAG 5 Link get event detection pin function.

This function returns the event detection (ED) pin logic state.

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

◆ ntag5link_init()

err_t ntag5link_init ( ntag5link_t * ctx,
ntag5link_cfg_t * cfg )

NTAG 5 Link initialization function.

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

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

◆ ntag5link_read_memory_block()

err_t ntag5link_read_memory_block ( ntag5link_t * ctx,
uint16_t block_addr,
ntag5link_block_t * block )

NTAG 5 Link 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 ntag5link_t object definition for detailed explanation.
[in]block_addr: User or config memory block address.
[out]block: Address of memory block where to store read data. See ntag5link_block_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ntag5link_read_message_from_memory()

err_t ntag5link_read_message_from_memory ( ntag5link_t * ctx,
uint16_t block_addr,
uint8_t * message,
uint16_t message_len )

NTAG 5 Link 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 ntag5link_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.

◆ ntag5link_read_multiple_memory_block()

err_t ntag5link_read_multiple_memory_block ( ntag5link_t * ctx,
uint16_t block_addr,
ntag5link_block_t * block,
uint8_t num_blocks )

NTAG 5 Link 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 ntag5link_t object definition for detailed explanation.
[in]block_addr: User or config memory block address.
[out]block: Array of memory blocks where to store read data. See ntag5link_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.

◆ ntag5link_read_session_register()

err_t ntag5link_read_session_register ( ntag5link_t * ctx,
uint16_t block_addr,
uint8_t byte_num,
uint8_t * data_out )

NTAG 5 Link read session register function.

This function reads data from the selected session register.

Parameters
[in]ctx: Click context object. See ntag5link_t object definition for detailed explanation.
[in]block_addr: Session register block address.
[in]byte_num: Register byte number in a block [0-3].
[out]data_out: Output data read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ntag5link_write_memory_block()

err_t ntag5link_write_memory_block ( ntag5link_t * ctx,
uint16_t block_addr,
ntag5link_block_t * block )

NTAG 5 Link 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 ntag5link_t object definition for detailed explanation.
[in]block_addr: User or config memory block address.
[in]block: Address of memory block to be written. See ntag5link_block_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ntag5link_write_message_to_memory()

err_t ntag5link_write_message_to_memory ( ntag5link_t * ctx,
uint16_t block_addr,
uint8_t * message,
uint16_t message_len )

NTAG 5 Link 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 ntag5link_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.

◆ ntag5link_write_multiple_memory_block()

err_t ntag5link_write_multiple_memory_block ( ntag5link_t * ctx,
uint16_t block_addr,
ntag5link_block_t * block,
uint8_t num_blocks )

NTAG 5 Link 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 ntag5link_t object definition for detailed explanation.
[in]block_addr: User or config memory block address.
[in]block: Array of memory block to be written. See ntag5link_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.

◆ ntag5link_write_ndef_uri_record()

err_t ntag5link_write_ndef_uri_record ( ntag5link_t * ctx,
uint8_t uri_prefix,
uint8_t * uri_data,
uint8_t data_len )

NTAG 5 Link 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 ntag5link_t object definition for detailed explanation.
[in]uri_prefix: URI prefix code [0x00-0x23]. See #ntag5link_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.

◆ ntag5link_write_session_register()

err_t ntag5link_write_session_register ( ntag5link_t * ctx,
uint16_t block_addr,
uint8_t byte_num,
uint8_t mask,
uint8_t data_in )

NTAG 5 Link write session register function.

This function writes specified data to the selected session register.

Parameters
[in]ctx: Click context object. See ntag5link_t object definition for detailed explanation.
[in]block_addr: Session register block address.
[in]byte_num: Register byte number in a block [0-3].
[in]mask: Mask of bits to be overwritten.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.