nfc2 2.0.0.0
main.c File Reference

NFC2 Click example. More...

#include "board.h"
#include "log.h"
#include "nfc2.h"

Functions

void display_packet (control_packet_t *ctrl_pck)
 NFC 2 display packet function.
 
void display_nfc_data (control_packet_t *ctrl_pck)
 NFC 2 display nfc data function.
 
void nfc2_read_nfc_data (nfc2_t *ctx, control_packet_t *ctrl_pck)
 NFC 2 read nfc data function.
 
void nfc2_test_antenna (nfc2_t *ctx, control_packet_t *ctrl_pck)
 NFC 2 test antena function.
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

uint8_t n_cnt
 
control_packet_t ctrl_pck_data
 

Detailed Description

NFC2 Click example.

Description

This is an example which demonstrates the usage of NFC 2 Click board.

The demo application is composed of two sections :

Application Init

Initialization driver enables - I2C, hw reset, reseteting and initialize core, disabling standby mode, starting test procedure, set configuration and start discovery, also write log.

Application Task

NFC 2 Click board can be used for detection of RFiD tag and displays it's value via USART terminal. All data logs write on USB uart changes for every 1 sec.

Additional Functions : -void display_packet ( control_packet_t *ctrl_pck ) - Display packet log data. -void display_nfc_data ( control_packet_t *ctrl_pck ) - Display packet log data. -void nfc2_read_nfc_data ( nfc2_t *ctx, control_packet_t *ctrl_pck ) - Read nfc data function. -void nfc2_test_antenna ( nfc2_t *ctx, control_packet_t *ctrl_pck ) - Testing Antenna function.

Author
Stefan Ilic

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< 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 LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ display_nfc_data()

void display_nfc_data ( control_packet_t * ctrl_pck)

NFC 2 display nfc data function.

This function displays nfc data values.

◆ display_packet()

void display_packet ( control_packet_t * ctrl_pck)

NFC 2 display packet function.

This function displays data values.

◆ main()

int main ( void )

◆ nfc2_read_nfc_data()

void nfc2_read_nfc_data ( nfc2_t * ctx,
control_packet_t * ctrl_pck )

NFC 2 read nfc data function.

This function reads nfc data and displays data.

◆ nfc2_test_antenna()

void nfc2_test_antenna ( nfc2_t * ctx,
control_packet_t * ctrl_pck )

NFC 2 test antena function.

This function tests antenna and displays data.

Variable Documentation

◆ ctrl_pck_data

control_packet_t ctrl_pck_data

◆ n_cnt

uint8_t n_cnt