nfc2 2.0.0.0
NFC 2 Click Driver

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

Topics

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

Functions

void nfc2_cfg_setup (nfc2_cfg_t *cfg)
 NFC 2 configuration object setup function.
 
err_t nfc2_init (nfc2_t *ctx, nfc2_cfg_t *cfg)
 NFC 2 initialization function.
 
void nfc2_default_cfg (nfc2_t *ctx, control_packet_t *ctrl_pck)
 NFC 2 default configuration function.
 
err_t nfc2_generic_write (nfc2_t *ctx, uint8_t *p_tx_data, uint8_t n_bytes)
 NFC 2 I2C writing function.
 
err_t nfc2_generic_read (nfc2_t *ctx, uint8_t *p_rx_h_data, uint8_t *p_rx_p_data)
 NFC 2 I2C reading function.
 
void nfc2_hw_reset (nfc2_t *ctx)
 HW reset function.
 
uint8_t nfc2_get_data (nfc2_t *ctx, uint8_t *p_rx_data)
 Get data function.
 
void nfc2_read_ctrl_packet_data (nfc2_t *ctx, control_packet_t *ctrl_pck)
 Read control packet data function.
 
void nfc2_write_ctrl_packet_data (nfc2_t *ctx, control_packet_t ctrl_pck)
 Write control packet data function.
 
uint8_t nfc2_check_irq (nfc2_t *ctx)
 Check IRQ ststus function.
 
void nfc2_cmd_core_reset (nfc2_t *ctx)
 Core reset command function.
 
void nfc2_cmd_core_init (nfc2_t *ctx)
 Core init command function.
 
void nfc2_cmd_disable_standby_mode (nfc2_t *ctx)
 Disable standby mode command function.
 
void nfc2_cmd_antenna_test (nfc2_t *ctx, uint8_t sel_ant)
 Antenna test function.
 
void nfc2_cmd_test_procedure (nfc2_t *ctx)
 NFC test procedure command function.
 
void nfc2_core_reset (nfc2_t *ctx)
 Core reset command function.
 
void nfc2_init_core (nfc2_t *ctx)
 Core initialization command function.
 
void nfc2_core_set_default_config (nfc2_t *ctx)
 Set default configuration function.
 
void nfc2_core_set_protocol_config (nfc2_t *ctx)
 Set protocol configuration function.
 
void nfc2_cmd_start_discovery (nfc2_t *ctx)
 Start discovery command function.
 
void nfc2_activate_rmt_mifare_card (nfc2_t *ctx)
 Activate remote mifare card command function.
 
void nfc2_cmd_authenticate_sector (nfc2_t *ctx, uint8_t sel_sect_addr)
 Authenticate sector command function.
 
void nfc2_cmd_card_disconnected (nfc2_t *ctx)
 Card disconnected command function.
 

Detailed Description

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

◆ nfc2_activate_rmt_mifare_card()

void nfc2_activate_rmt_mifare_card ( nfc2_t * ctx)

Activate remote mifare card command function.

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

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

◆ nfc2_cfg_setup()

void nfc2_cfg_setup ( nfc2_cfg_t * cfg)

NFC 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ nfc2_check_irq()

uint8_t nfc2_check_irq ( nfc2_t * ctx)

Check IRQ ststus function.

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

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

◆ nfc2_cmd_antenna_test()

void nfc2_cmd_antenna_test ( nfc2_t * ctx,
uint8_t sel_ant )

Antenna test function.

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

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

◆ nfc2_cmd_authenticate_sector()

void nfc2_cmd_authenticate_sector ( nfc2_t * ctx,
uint8_t sel_sect_addr )

Authenticate sector command function.

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

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

◆ nfc2_cmd_card_disconnected()

void nfc2_cmd_card_disconnected ( nfc2_t * ctx)

Card disconnected command function.

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

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

◆ nfc2_cmd_core_init()

void nfc2_cmd_core_init ( nfc2_t * ctx)

Core init command function.

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

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

◆ nfc2_cmd_core_reset()

void nfc2_cmd_core_reset ( nfc2_t * ctx)

Core reset command function.

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

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

◆ nfc2_cmd_disable_standby_mode()

void nfc2_cmd_disable_standby_mode ( nfc2_t * ctx)

Disable standby mode command function.

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

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

◆ nfc2_cmd_start_discovery()

void nfc2_cmd_start_discovery ( nfc2_t * ctx)

Start discovery command function.

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

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

◆ nfc2_cmd_test_procedure()

void nfc2_cmd_test_procedure ( nfc2_t * ctx)

NFC test procedure command function.

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

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

◆ nfc2_core_reset()

void nfc2_core_reset ( nfc2_t * ctx)

Core reset command function.

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

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

◆ nfc2_core_set_default_config()

void nfc2_core_set_default_config ( nfc2_t * ctx)

Set default configuration function.

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

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

◆ nfc2_core_set_protocol_config()

void nfc2_core_set_protocol_config ( nfc2_t * ctx)

Set protocol configuration function.

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

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

◆ nfc2_default_cfg()

void nfc2_default_cfg ( nfc2_t * ctx,
control_packet_t * ctrl_pck )

NFC 2 default configuration function.

This function executes a default configuration of NFC 2 click board.

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

◆ nfc2_generic_read()

err_t nfc2_generic_read ( nfc2_t * ctx,
uint8_t * p_rx_h_data,
uint8_t * p_rx_p_data )

NFC 2 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 nfc2_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.

◆ nfc2_generic_write()

err_t nfc2_generic_write ( nfc2_t * ctx,
uint8_t * p_tx_data,
uint8_t n_bytes )

NFC 2 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 nfc2_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.

◆ nfc2_get_data()

uint8_t nfc2_get_data ( nfc2_t * ctx,
uint8_t * p_rx_data )

Get data function.

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

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

◆ nfc2_hw_reset()

void nfc2_hw_reset ( nfc2_t * ctx)

HW reset function.

The function hw reset

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

◆ nfc2_init()

err_t nfc2_init ( nfc2_t * ctx,
nfc2_cfg_t * cfg )

NFC 2 initialization function.

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

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

◆ nfc2_init_core()

void nfc2_init_core ( nfc2_t * ctx)

Core initialization command function.

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

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

◆ nfc2_read_ctrl_packet_data()

void nfc2_read_ctrl_packet_data ( nfc2_t * ctx,
control_packet_t * ctrl_pck )

Read control packet data function.

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

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

◆ nfc2_write_ctrl_packet_data()

void nfc2_write_ctrl_packet_data ( nfc2_t * ctx,
control_packet_t ctrl_pck )

Write control packet data function.

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

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