nfc7i2c 2.1.0.0
Loading...
Searching...
No Matches
NFC 7 I2C Click Driver

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

Topics

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

Functions

void nfc7i2c_cfg_setup (nfc7i2c_cfg_t *cfg)
 NFC 7 I2C configuration object setup function.
 
err_t nfc7i2c_init (nfc7i2c_t *ctx, nfc7i2c_cfg_t *cfg)
 NFC 7 I2C initialization function.
 
err_t nfc7i2c_default_cfg (nfc7i2c_t *ctx)
 NFC 7 I2C default configuration function.
 
void nfc7i2c_enable_device (nfc7i2c_t *ctx)
 NFC 7 I2C enable device function.
 
void nfc7i2c_disable_device (nfc7i2c_t *ctx)
 NFC 7 I2C disable device function.
 
void nfc7i2c_reset_device (nfc7i2c_t *ctx)
 NFC 7 I2C reset device function.
 
uint8_t nfc7i2c_get_irq_pin (nfc7i2c_t *ctx)
 NFC 7 I2C get IRQ pin function.
 
err_t nfc7i2c_tx (nfc7i2c_t *ctx, uint8_t *data_in, uint16_t len)
 NFC 7 I2C TX function.
 
err_t nfc7i2c_rx (nfc7i2c_t *ctx, uint8_t *data_out, uint16_t *len, uint16_t timeout)
 NFC 7 I2C RX function.
 
err_t nfc7i2c_trx (nfc7i2c_t *ctx, uint8_t *data_in, uint16_t in_len, uint8_t *data_out, uint16_t *out_len)
 NFC 7 I2C TRX function.
 
err_t nfc7i2c_pkt_ctrl_tx (nfc7i2c_t *ctx, nfc7i2c_pkt_ctrl_t *pkt)
 NFC 7 I2C packet control TX function.
 
err_t nfc7i2c_pkt_ctrl_rx (nfc7i2c_t *ctx, nfc7i2c_pkt_ctrl_t *pkt, uint16_t timeout)
 NFC 7 I2C packet control RX function.
 
err_t nfc7i2c_pkt_ctrl_trx (nfc7i2c_t *ctx, nfc7i2c_pkt_ctrl_t *pkt)
 NFC 7 I2C packet control TRX function.
 
err_t nfc7i2c_pkt_data_tx (nfc7i2c_t *ctx, nfc7i2c_pkt_data_t *pkt)
 NFC 7 I2C packet data TX function.
 
err_t nfc7i2c_pkt_data_rx (nfc7i2c_t *ctx, nfc7i2c_pkt_data_t *pkt, uint16_t timeout)
 NFC 7 I2C packet data RX function.
 
err_t nfc7i2c_pkt_data_trx (nfc7i2c_t *ctx, nfc7i2c_pkt_data_t *pkt)
 NFC 7 I2C packet data TRX function.
 
err_t nfc7i2c_core_reset (nfc7i2c_t *ctx)
 NFC 7 I2C core reset function.
 
err_t nfc7i2c_core_init (nfc7i2c_t *ctx)
 NFC 7 I2C core init function.
 
err_t nfc7i2c_core_standby (nfc7i2c_t *ctx, uint8_t mode)
 NFC 7 I2C core standby function.
 
err_t nfc7i2c_core_total_duration (nfc7i2c_t *ctx)
 NFC 7 I2C core total duration function.
 
err_t nfc7i2c_core_tag_detector (nfc7i2c_t *ctx)
 NFC 7 I2C core tag detector function.
 
err_t nfc7i2c_core_clock_sel (nfc7i2c_t *ctx)
 NFC 7 I2C core clock sel function.
 
err_t nfc7i2c_core_pmu (nfc7i2c_t *ctx)
 NFC 7 I2C core PMU function.
 
err_t nfc7i2c_core_rf_config (nfc7i2c_t *ctx)
 NFC 7 I2C core RF config function.
 
err_t nfc7i2c_config_settings (nfc7i2c_t *ctx)
 NFC 7 I2C config settings function.
 
err_t nfc7i2c_map_rf_interface (nfc7i2c_t *ctx)
 NFC 7 I2C map RF interface function.
 
err_t nfc7i2c_start_discovery (nfc7i2c_t *ctx)
 NFC 7 I2C start discovery function.
 
err_t nfc7i2c_stop_discovery (nfc7i2c_t *ctx)
 NFC 7 I2C stop discovery function.
 
err_t nfc7i2c_wait_discovery (nfc7i2c_t *ctx, nfc7i2c_rf_intf_t *rf_intf)
 NFC 7 I2C wait discovery function.
 
void nfc7i2c_presence_check (nfc7i2c_t *ctx, nfc7i2c_rf_intf_t *rf_intf)
 NFC 7 I2C presence check function.
 
err_t nfc7i2c_reader_act_next (nfc7i2c_t *ctx, nfc7i2c_rf_intf_t *rf_intf)
 NFC 7 I2C reader activate next function.
 
err_t nfc7i2c_reader_re_act (nfc7i2c_t *ctx, nfc7i2c_rf_intf_t *rf_intf)
 NFC 7 I2C reader reactivate next function.
 
err_t nfc7i2c_reader_tag_cmd (nfc7i2c_t *ctx, nfc7i2c_pkt_data_t *pkt)
 NFC 7 I2C reader tag cmd function.
 

Detailed Description

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

◆ nfc7i2c_cfg_setup()

void nfc7i2c_cfg_setup ( nfc7i2c_cfg_t * cfg)

NFC 7 I2C configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ nfc7i2c_config_settings()

err_t nfc7i2c_config_settings ( nfc7i2c_t * ctx)

NFC 7 I2C config settings function.

This function sets the default core config settings.

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

◆ nfc7i2c_core_clock_sel()

err_t nfc7i2c_core_clock_sel ( nfc7i2c_t * ctx)

NFC 7 I2C core clock sel function.

This function sets the core clock selection to NFC7I2C_NCI_CORE_CLOCK_SEL_XTAL.

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

◆ nfc7i2c_core_init()

err_t nfc7i2c_core_init ( nfc7i2c_t * ctx)

NFC 7 I2C core init function.

This function resets and initializes the device core.

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

◆ nfc7i2c_core_pmu()

err_t nfc7i2c_core_pmu ( nfc7i2c_t * ctx)

NFC 7 I2C core PMU function.

This function sets the core power management unit to NFC7I2C_NCI_CORE_PMU_IRQ_EN_TVDD_3V3.

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

◆ nfc7i2c_core_reset()

err_t nfc7i2c_core_reset ( nfc7i2c_t * ctx)

NFC 7 I2C core reset function.

This function resets the device core and reads the FW version.

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

◆ nfc7i2c_core_rf_config()

err_t nfc7i2c_core_rf_config ( nfc7i2c_t * ctx)

NFC 7 I2C core RF config function.

This function sets the core RF config to NFC7I2C_NCI_CORE_RF_CONF.

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

◆ nfc7i2c_core_standby()

err_t nfc7i2c_core_standby ( nfc7i2c_t * ctx,
uint8_t mode )

NFC 7 I2C core standby function.

This function sets the core standby mode.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in]mode:
  • 0 - Standby mode disabled,
  • 1 - Standby mode enabled,
  • 2 - Autonomous mode enabled.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_core_tag_detector()

err_t nfc7i2c_core_tag_detector ( nfc7i2c_t * ctx)

NFC 7 I2C core tag detector function.

This function sets the core tag detector to NFC7I2C_NCI_CORE_TAG_DETECTOR_DIS.

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

◆ nfc7i2c_core_total_duration()

err_t nfc7i2c_core_total_duration ( nfc7i2c_t * ctx)

NFC 7 I2C core total duration function.

This function sets the core total duration of the single discovery period to NFC7I2C_NCI_CORE_TOTAL_DURATION_510MS.

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

◆ nfc7i2c_default_cfg()

err_t nfc7i2c_default_cfg ( nfc7i2c_t * ctx)

NFC 7 I2C default configuration function.

This function executes a default configuration of NFC 7 I2C Click board.

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

◆ nfc7i2c_disable_device()

void nfc7i2c_disable_device ( nfc7i2c_t * ctx)

NFC 7 I2C disable device function.

This function disables the device by setting the VEN pin to LOW logic state.

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

◆ nfc7i2c_enable_device()

void nfc7i2c_enable_device ( nfc7i2c_t * ctx)

NFC 7 I2C enable device function.

This function enables the device by setting the VEN pin to HIGH logic state.

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

◆ nfc7i2c_get_irq_pin()

uint8_t nfc7i2c_get_irq_pin ( nfc7i2c_t * ctx)

NFC 7 I2C get IRQ pin function.

This function returns the IRQ pin logic state.

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

◆ nfc7i2c_init()

err_t nfc7i2c_init ( nfc7i2c_t * ctx,
nfc7i2c_cfg_t * cfg )

NFC 7 I2C initialization function.

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

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

◆ nfc7i2c_map_rf_interface()

err_t nfc7i2c_map_rf_interface ( nfc7i2c_t * ctx)

NFC 7 I2C map RF interface function.

This function enables all RF protocols and interface in poll mode.

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

◆ nfc7i2c_pkt_ctrl_rx()

err_t nfc7i2c_pkt_ctrl_rx ( nfc7i2c_t * ctx,
nfc7i2c_pkt_ctrl_t * pkt,
uint16_t timeout )

NFC 7 I2C packet control RX function.

This function waits a desired period for a NCI control packet response to arrive and reads it.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[out]pkt: NCI control packet data structure read. See nfc7i2c_pkt_ctrl_t object definition for detailed explanation.
[in]timeout: Waiting data timeout in milliseconds.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_pkt_ctrl_trx()

err_t nfc7i2c_pkt_ctrl_trx ( nfc7i2c_t * ctx,
nfc7i2c_pkt_ctrl_t * pkt )

NFC 7 I2C packet control TRX function.

This function sends a NCI control packet using nfc7i2c_pkt_ctrl_tx function and reads the response using nfc7i2c_pkt_ctrl_rx with a 1 second timeout.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in,out]pkt: NCI control packet data structure to write (response packet is populated here). See nfc7i2c_pkt_ctrl_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_pkt_ctrl_tx()

err_t nfc7i2c_pkt_ctrl_tx ( nfc7i2c_t * ctx,
nfc7i2c_pkt_ctrl_t * pkt )

NFC 7 I2C packet control TX function.

This function sends a desired NCI control packet data.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in]pkt: NCI control packet data structure to be sent. See nfc7i2c_pkt_ctrl_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_pkt_data_rx()

err_t nfc7i2c_pkt_data_rx ( nfc7i2c_t * ctx,
nfc7i2c_pkt_data_t * pkt,
uint16_t timeout )

NFC 7 I2C packet data RX function.

This function waits a desired period for a NCI data packet response to arrive and reads it.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[out]pkt: NCI data packet data structure read. See nfc7i2c_pkt_data_t object definition for detailed explanation.
[in]timeout: Waiting data timeout in milliseconds.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_pkt_data_trx()

err_t nfc7i2c_pkt_data_trx ( nfc7i2c_t * ctx,
nfc7i2c_pkt_data_t * pkt )

NFC 7 I2C packet data TRX function.

This function sends a NCI data packet using nfc7i2c_pkt_data_tx function and reads the response using nfc7i2c_pkt_data_rx with a 1 second timeout.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in,out]pkt: NCI data packet data structure to write (response packet is populated here). See nfc7i2c_pkt_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_pkt_data_tx()

err_t nfc7i2c_pkt_data_tx ( nfc7i2c_t * ctx,
nfc7i2c_pkt_data_t * pkt )

NFC 7 I2C packet data TX function.

This function sends a desired NCI data packet data.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in]pkt: NCI data packet data structure to be sent. See nfc7i2c_pkt_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_presence_check()

void nfc7i2c_presence_check ( nfc7i2c_t * ctx,
nfc7i2c_rf_intf_t * rf_intf )

NFC 7 I2C presence check function.

This function waits until the discovered target device is removed.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in]rf_intf: Filled with discovered NFC remote device properties.
Returns
None.
Note
None.

◆ nfc7i2c_reader_act_next()

err_t nfc7i2c_reader_act_next ( nfc7i2c_t * ctx,
nfc7i2c_rf_intf_t * rf_intf )

NFC 7 I2C reader activate next function.

This function performs activation of the next tag (in case of multiple tag detection or multi-protocol tag).

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in,out]rf_intf: Filled with discovered NFC remote device properties.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_reader_re_act()

err_t nfc7i2c_reader_re_act ( nfc7i2c_t * ctx,
nfc7i2c_rf_intf_t * rf_intf )

NFC 7 I2C reader reactivate next function.

This function performs reactivation of the current tag.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in]rf_intf: Filled with discovered NFC remote device properties.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_reader_tag_cmd()

err_t nfc7i2c_reader_tag_cmd ( nfc7i2c_t * ctx,
nfc7i2c_pkt_data_t * pkt )

NFC 7 I2C reader tag cmd function.

This function performs RAW data packet transceive operation (send then receive) with the remote tag.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in,out]pkt: NCI data packet data structure to write (response packet is populated here). See nfc7i2c_pkt_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_reset_device()

void nfc7i2c_reset_device ( nfc7i2c_t * ctx)

NFC 7 I2C reset device function.

This function resets the device by toggling the VEN pin.

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

◆ nfc7i2c_rx()

err_t nfc7i2c_rx ( nfc7i2c_t * ctx,
uint8_t * data_out,
uint16_t * len,
uint16_t timeout )

NFC 7 I2C RX function.

This function waits a desired period for a data received flag and reads the data by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[out]data_out: Output read data.
[out]len: Number of bytes read.
[in]timeout: Waiting data timeout in milliseconds.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_start_discovery()

err_t nfc7i2c_start_discovery ( nfc7i2c_t * ctx)

NFC 7 I2C start discovery function.

This function starts RF discovery for NFC-A, NFC-B, NFC-F, and NFC-V technologies.

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

◆ nfc7i2c_stop_discovery()

err_t nfc7i2c_stop_discovery ( nfc7i2c_t * ctx)

NFC 7 I2C stop discovery function.

This function stops the RF discovery process.

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

◆ nfc7i2c_trx()

err_t nfc7i2c_trx ( nfc7i2c_t * ctx,
uint8_t * data_in,
uint16_t in_len,
uint8_t * data_out,
uint16_t * out_len )

NFC 7 I2C TRX function.

This function sends data using nfc7i2c_tx function and reads the response using nfc7i2c_rx with a 1 second timeout.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[in]data_in: Data to be written.
[in]in_len: Number of bytes to be written.
[out]data_out: Output read data.
[out]out_len: Number of bytes read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ nfc7i2c_tx()

err_t nfc7i2c_tx ( nfc7i2c_t * ctx,
uint8_t * data_in,
uint16_t len )

NFC 7 I2C TX function.

This function writes a desired number of data bytes by using I2C serial interface.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[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.

◆ nfc7i2c_wait_discovery()

err_t nfc7i2c_wait_discovery ( nfc7i2c_t * ctx,
nfc7i2c_rf_intf_t * rf_intf )

NFC 7 I2C wait discovery function.

This function waits until remote NFC device is discovered.

Parameters
[in]ctx: Click context object. See nfc7i2c_t object definition for detailed explanation.
[out]rf_intf: Filled with discovered NFC remote device properties.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.