TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (382 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139695 times)
  2. FAT32 Library (72094 times)
  3. Network Ethernet Library (57318 times)
  4. USB Device Library (47663 times)
  5. Network WiFi Library (43282 times)
  6. FT800 Library (42618 times)
  7. GSM click (29958 times)
  8. mikroSDK (28365 times)
  9. PID Library (26974 times)
  10. microSD click (26359 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

NFC 7 I2C Click

Rating:

0

Author: MIKROE

Last Updated: 2024-12-30

Package Version: 2.1.0.1

mikroSDK Library: 2.0.0.0

Category: RFID/NFC

Downloaded: 9 times

Not followed.

License: MIT license  

NFC 7 Click (I2C) is an add-on board that integrates NFC functionality in various applications. This board features the PN7160, a Near Field Communication (NFC) controller from NXP that is compliant with NFC Forum and NCI 2.0 standards. The board features an I2C communication interface, low-power consumption modes, and a new-generation RF contactless front-end design with high sensitivity and dynamic load modulation for reliable communication. It supports multiple NFC standards, including ISO/IEC 14443, ISO/IEC 15693, MIFARE, and FeliCa, and offers standalone card emulation functionality.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "NFC 7 I2C Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "NFC 7 I2C Click" changes.

Do you want to report abuse regarding "NFC 7 I2C Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


NFC 7 I2C Click

NFC 7 Click (I2C) is an add-on board that integrates NFC functionality in various applications. This board features the PN7160, a Near Field Communication (NFC) controller from NXP that is compliant with NFC Forum and NCI 2.0 standards. The board features an I2C communication interface, low-power consumption modes, and a new-generation RF contactless front-end design with high sensitivity and dynamic load modulation for reliable communication. It supports multiple NFC standards, including ISO/IEC 14443, ISO/IEC 15693, MIFARE, and FeliCa, and offers standalone card emulation functionality.

nfc7i2c_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Oct 2024.
  • Type : I2C type

Software Support

We provide a library for the NFC 7 I2C Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for NFC 7 I2C Click driver.

Standard key functions :

  • nfc7i2c_cfg_setup Config Object Initialization function.

    void nfc7i2c_cfg_setup ( nfc7i2c_cfg_t *cfg );
  • nfc7i2c_init Initialization function.

    err_t nfc7i2c_init ( nfc7i2c_t *ctx, nfc7i2c_cfg_t *cfg );
  • nfc7i2c_default_cfg Click Default Configuration function.

    err_t nfc7i2c_default_cfg ( nfc7i2c_t *ctx );

Example key functions :

  • nfc7i2c_wait_discovery This function waits until remote NFC device is discovered.

    err_t nfc7i2c_wait_discovery ( nfc7i2c_t *ctx, nfc7i2c_rf_intf_t *rf_intf );
  • nfc7i2c_presence_check This function waits until the discovered target device is removed.

    err_t nfc7i2c_presence_check ( nfc7i2c_t *ctx, nfc7i2c_rf_intf_t *rf_intf );
  • nfc7i2c_stop_discovery This function stops the RF discovery process.

    err_t nfc7i2c_stop_discovery ( nfc7i2c_t *ctx );

Example Description

This example demonstrates the use of NFC 7 I2C Click board by handling the detection and processing of various NFC technologies and protocols, and ensuring the application can respond to different NFC card types (A,B,F,V).

The demo application is composed of two sections :

Application Init

Initializes the driver and logger, performs the Click default configuration and reads the device firmware version.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    nfc7i2c_cfg_t nfc7i2c_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    nfc7i2c_cfg_setup( &nfc7i2c_cfg );
    NFC7I2C_MAP_MIKROBUS( nfc7i2c_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == nfc7i2c_init( &nfc7i2c, &nfc7i2c_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( NFC7I2C_ERROR == nfc7i2c_default_cfg ( &nfc7i2c ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    log_printf( &logger, " FW version: %.2X.%.2X.%.2X\r\n", 
                ( uint16_t ) nfc7i2c.fw_version[ 0 ], 
                ( uint16_t ) nfc7i2c.fw_version[ 1 ], 
                ( uint16_t ) nfc7i2c.fw_version[ 2 ] );

    log_info( &logger, " Application Task " );
}

Application Task

Waits for an NFC device to be discovered, checks if it supports a known NFC technology, and then handles the device based on its protocol. The application continues processing the device (reading and writing information) and waits until the card is removed. Once the card is removed, the discovery process is restarted to detect a new NFC device.

void application_task ( void )
{
    nfc7i2c_rf_intf_t rf_intf;
    log_printf( &logger, " WAITING FOR DEVICE DISCOVERY\r\n\n" );
    if ( NFC7I2C_OK == nfc7i2c_wait_discovery ( &nfc7i2c, &rf_intf ) )
    {
        if ( ( NFC7I2C_NCI_RF_TECH_PASSIVE_POLL_NFC_A == rf_intf.mode_tech ) || 
             ( NFC7I2C_NCI_RF_TECH_PASSIVE_POLL_NFC_B == rf_intf.mode_tech ) || 
             ( NFC7I2C_NCI_RF_TECH_PASSIVE_POLL_NFC_F == rf_intf.mode_tech ) || 
             ( NFC7I2C_NCI_RF_TECH_PASSIVE_POLL_15693 == rf_intf.mode_tech ) )
        {
            for ( ; ; )
            {
                nfc7i2c_display_card_info ( rf_intf );

                switch ( rf_intf.protocol )
                {
                    case NFC7I2C_NCI_RF_PROT_T2T:
                    {
                        nfc7i2c_handle_iso14443_3a ( &nfc7i2c );
                        break;
                    }
                    case NFC7I2C_NCI_RF_PROT_ISODEP:
                    {
                        nfc7i2c_handle_iso14443_4 ( &nfc7i2c );
                        break;
                    }
                    case NFC7I2C_NCI_RF_PROT_T5T:
                    {
                        nfc7i2c_handle_iso15693 ( &nfc7i2c );
                        break;
                    }
                    case NFC7I2C_NCI_RF_PROT_MIFARE:
                    {
                        nfc7i2c_handle_mifare ( &nfc7i2c );
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
                if ( !rf_intf.more_tags )
                {
                    break;
                }
                nfc7i2c_reader_act_next ( &nfc7i2c, &rf_intf );
            }

            nfc7i2c_presence_check ( &nfc7i2c, &rf_intf );
            log_printf ( &logger, " - CARD REMOVED\r\n\n" );

            nfc7i2c_stop_discovery ( &nfc7i2c );
            while ( NFC7I2C_OK != nfc7i2c_start_discovery ( &nfc7i2c ) );
        }
        else
        {
            log_printf ( &logger, " - WRONG DISCOVERY\r\n\n" );
        }
    }
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.NFC7I2C

Additional notes and informations

Depending on the development board you are using, you may need USB UART Click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

e Fuse 3 Click

0

eFuse 3 Click is a compact add-on board that contains an electronic eFuse. This board features the NIS6150, a resettable fuse that can significantly enhance the reliability of a USB application from both catastrophic and shutdown failures from ON Semiconductor. It is designed to buffer the load device from the excessive input voltage, which can damage sensitive circuits and protect the input side from reverse currents. It includes an over-voltage clamp circuit that limits the output voltage during transients but doesn’t shut the unit down, allowing the load circuit to continue its operation.

[Learn More]

UART 1-Wire Click

0

UART 1-Wire Click is used to convert standard UART or RS232 signals into 1-Wire® signals. Apart from other features such as the slew rate control for larger 1-Wire® busses, selectable data rate, an accurate self-calibrating time base, ESD protection and more, the main feature of the UART 1-Wire® Click, is that it manages all the sensitive signal timings involved in 1-Wire® communication, allowing rapid development of UART to 1-Wire® applications.

[Learn More]

Boost-INV click

5

Boost-INV click is a very useful DC/DC voltage converter device, as can output both positive and negative voltage, boosted up to 12.78V and -13.95, from a single fixed voltage input.

[Learn More]