nfc 2.1.0.0
NFC Click Driver

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

Topics

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

Functions

void nfc_cfg_setup (nfc_cfg_t *cfg)
 NFC configuration object setup function.
 
err_t nfc_init (nfc_t *ctx, nfc_cfg_t *cfg)
 NFC initialization function.
 
void nfc_default_cfg (nfc_t *ctx, control_packet_t *ctrl_pck)
 NFC default configuration function.
 
err_t nfc_generic_write (nfc_t *ctx, uint8_t *p_tx_data, uint8_t n_bytes)
 NFC I2C writing function.
 
err_t nfc_generic_read (nfc_t *ctx, uint8_t *p_rx_h_data, uint8_t *p_rx_p_data)
 NFC I2C reading function.
 
void nfc_hw_reset (nfc_t *ctx)
 HW reset function.
 
uint8_t nfc_get_data (nfc_t *ctx, uint8_t *p_rx_data)
 Get data function.
 
void nfc_read_ctrl_packet_data (nfc_t *ctx, control_packet_t *ctrl_pck)
 Read control packet data function.
 
void nfc_write_ctrl_packet_data (nfc_t *ctx, control_packet_t ctrl_pck)
 Write control packet data function.
 
uint8_t nfc_check_irq (nfc_t *ctx)
 Check IRQ ststus function.
 
void nfc_cmd_core_reset (nfc_t *ctx)
 Core reset command function.
 
void nfc_cmd_core_init (nfc_t *ctx)
 Core init command function.
 
void nfc_cmd_disable_standby_mode (nfc_t *ctx)
 Disable standby mode command function.
 
void nfc_cmd_antenna_test (nfc_t *ctx, uint8_t sel_ant)
 Antenna test function.
 
void nfc_cmd_test_procedure (nfc_t *ctx)
 NFC test procedure command function.
 
void nfc_core_reset (nfc_t *ctx)
 Core reset command function.
 
void nfc_init_core (nfc_t *ctx)
 Core initialization command function.
 
void nfc_core_set_default_config (nfc_t *ctx)
 Set default configuration function.
 
void nfc_core_set_protocol_config (nfc_t *ctx)
 Set protocol configuration function.
 
void nfc_cmd_start_discovery (nfc_t *ctx)
 Start discovery command function.
 
void nfc_activate_rmt_mifare_card (nfc_t *ctx)
 Activate remote mifare card command function.
 
void nfc_cmd_authenticate_sector (nfc_t *ctx, uint8_t sel_sect_addr)
 Authenticate sector command function.
 
void nfc_cmd_card_disconnected (nfc_t *ctx)
 Card disconnected command function.
 

Detailed Description

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

◆ nfc_activate_rmt_mifare_card()

void nfc_activate_rmt_mifare_card ( nfc_t * ctx)

Activate remote mifare card command function.

The function set activate remote mifare card command of the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_cfg_setup()

void nfc_cfg_setup ( nfc_cfg_t * cfg)

NFC configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ nfc_check_irq()

uint8_t nfc_check_irq ( nfc_t * ctx)

Check IRQ ststus function.

The function check interrupt state and return state of the INT pin of the PN7120 High performance NFC controller on the NFC click board.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
Returns
  • 0 - No active,
  • 1 - Active.

◆ nfc_cmd_antenna_test()

void nfc_cmd_antenna_test ( nfc_t * ctx,
uint8_t sel_ant )

Antenna test function.

The function set antenna test to the PN7120 High performance NFC controller on the NFC click board.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
[in]sel_ant: Presence of the antenna components.
Returns
Nothing.

◆ nfc_cmd_authenticate_sector()

void nfc_cmd_authenticate_sector ( nfc_t * ctx,
uint8_t sel_sect_addr )

Authenticate sector command function.

The function set authenticate sector command of the PN7120 High performance NFC controller on the NFC click board.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
[in]sel_sect_addr: Sector authenticate address.
Returns
Nothing.

◆ nfc_cmd_card_disconnected()

void nfc_cmd_card_disconnected ( nfc_t * ctx)

Card disconnected command function.

The function set card disconnected command of the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_cmd_core_init()

void nfc_cmd_core_init ( nfc_t * ctx)

Core init command function.

The function set core init command to the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_cmd_core_reset()

void nfc_cmd_core_reset ( nfc_t * ctx)

Core reset command function.

The function set core reset command to the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_cmd_disable_standby_mode()

void nfc_cmd_disable_standby_mode ( nfc_t * ctx)

Disable standby mode command function.

The function set disable standby mode command to the PN7120 High performance NFC controller on the NFC click board.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.

◆ nfc_cmd_start_discovery()

void nfc_cmd_start_discovery ( nfc_t * ctx)

Start discovery command function.

The function set start discovery command of the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_cmd_test_procedure()

void nfc_cmd_test_procedure ( nfc_t * ctx)

NFC test procedure command function.

The function set test procedure command to the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_core_reset()

void nfc_core_reset ( nfc_t * ctx)

Core reset command function.

The function set core reset command to the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_core_set_default_config()

void nfc_core_set_default_config ( nfc_t * ctx)

Set default configuration function.

The function set default configuration of the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_core_set_protocol_config()

void nfc_core_set_protocol_config ( nfc_t * ctx)

Set protocol configuration function.

The function set protocol configuration of the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_default_cfg()

void nfc_default_cfg ( nfc_t * ctx,
control_packet_t * ctrl_pck )

NFC default configuration function.

This function executes a default configuration of NFC click board.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
[out]ctrl_pck: Pointer to the memory location of structure.
Returns
Nothing.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ nfc_generic_read()

err_t nfc_generic_read ( nfc_t * ctx,
uint8_t * p_rx_h_data,
uint8_t * p_rx_p_data )

NFC I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
[out]p_rx_h_data: Pointer to the memory location where header data be stored.
[out]p_rx_p_data: Pointer to the memory location where payload data be stored.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ nfc_generic_write()

err_t nfc_generic_write ( nfc_t * ctx,
uint8_t * p_tx_data,
uint8_t n_bytes )

NFC I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
[in]p_tx_data: Data to be written.
[in]n_bytes: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ nfc_get_data()

uint8_t nfc_get_data ( nfc_t * ctx,
uint8_t * p_rx_data )

Get data function.

The function read a sequential data starting of the PN7120 High performance NFC controller on the NFC click board.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
[out]p_rx_data: Pointer to the memory location where data be stored.
Returns
Number od data.

◆ nfc_hw_reset()

void nfc_hw_reset ( nfc_t * ctx)

HW reset function.

The function hw reset

Parameters
[out]ctx: Click context object. See nfc_t object definition for detailed explanation. the PN7120 High performance NFC controller on the NFC click board.
Returns
Nothing.

◆ nfc_init()

err_t nfc_init ( nfc_t * ctx,
nfc_cfg_t * cfg )

NFC initialization function.

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

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

◆ nfc_init_core()

void nfc_init_core ( nfc_t * ctx)

Core initialization command function.

The function set core initialization command to the PN7120 High performance NFC controller on the NFC click board.

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

◆ nfc_read_ctrl_packet_data()

void nfc_read_ctrl_packet_data ( nfc_t * ctx,
control_packet_t * ctrl_pck )

Read control packet data function.

The function read control packet data of the PN7120 High performance NFC controller on the NFC click board.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
[in]ctrl_pck: Pointer to the memory location of structure.
Returns
Nothing.

◆ nfc_write_ctrl_packet_data()

void nfc_write_ctrl_packet_data ( nfc_t * ctx,
control_packet_t ctrl_pck )

Write control packet data function.

The function write control packet data to the PN7120 High performance NFC controller on the NFC click board.

Parameters
[in]ctx: Click context object. See nfc_t object definition for detailed explanation.
[in]ctrl_pck: Structure where data be stored.
Returns
Nothing.