nfc6 2.1.0.0
nfc6.h File Reference

This file contains API for NFC 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  nfc6_t
 NFC 6 Click context object. More...
 
struct  nfc6_cfg_t
 NFC 6 Click configuration object. More...
 

Macros

#define NFC6_CONTROL_SEND_COMMAND   0x00
 NFC 6 control bytes.
 
#define NFC6_CONTROL_READ_DATA   0x02
 
#define NFC6_CONTROL_POLL_READY   0x03
 
#define NFC6_CONTROL_RESET_DEVICE   0x01
 
#define NFC6_CONTROL_POLL_READY_FLAG   0x08
 
#define NFC6_CMD_IDN   0x01
 NFC 6 command bytes.
 
#define NFC6_CMD_PROTOCOL_SELECT   0x02
 
#define NFC6_CMD_POLL_FIELD   0x03
 
#define NFC6_CMD_SEND_RECV   0x04
 
#define NFC6_CMD_LISTEN   0x05
 
#define NFC6_CMD_SEND   0x06
 
#define NFC6_CMD_IDLE   0x07
 
#define NFC6_CMD_RD_REG   0x08
 
#define NFC6_CMD_WR_REG   0x09
 
#define NFC6_CMD_SUB_FREQ_RES   0x0B
 
#define NFC6_CMD_AC_FILTER   0x0D
 
#define NFC6_CMD_ECHO   0x55
 
#define NFC6_RSP_FIXED_BYTES   0x80
 NFC 6 response setting.
 
#define NFC6_RSP_FIXED_BYTES_MASK   0x8F
 
#define NFC6_RSP_LONG_FRAME_MASK   0x60
 
#define NFC6_RSP_OK   0x00
 
#define NFC6_RSP_ECHO   0x55
 
#define NFC6_RSP_MAX_DATA_LEN   528u
 
#define NFC6_RSP_READY_TIMEOUT_MS   5000ul
 
#define NFC6_IDLE_CMD_LENGTH   14
 NFC 6 IDLE command setting for calibration of tag detector.
 
#define NFC6_IDLE_CMD_WU_SOURCE   0x03
 
#define NFC6_IDLE_CMD_ENTER_CTRL_L   0xA1
 
#define NFC6_IDLE_CMD_ENTER_CTRL_H   0x00
 
#define NFC6_IDLE_CMD_WU_CTRL_L   0xF8
 
#define NFC6_IDLE_CMD_WU_CTRL_H   0x01
 
#define NFC6_IDLE_CMD_LEAVE_CTRL_L   0x18
 
#define NFC6_IDLE_CMD_LEAVE_CTRL_H   0x00
 
#define NFC6_IDLE_CMD_WU_PERIOD   0x20
 
#define NFC6_IDLE_CMD_OSC_START   0x60
 
#define NFC6_IDLE_CMD_DAC_START   0x60
 
#define NFC6_IDLE_CMD_DAC_DATA_L   0x00
 
#define NFC6_IDLE_CMD_DAC_DATA_H   0x00
 
#define NFC6_IDLE_CMD_DAC_DATA_H_MIN   0x00
 
#define NFC6_IDLE_CMD_DAC_DATA_H_MAX   0xFC
 
#define NFC6_IDLE_CMD_SWINGS_CNT   0x3F
 
#define NFC6_IDLE_CMD_MAX_SLEEP   0x01
 
#define NFC6_IDLE_RSP_TIMEOUT   0x01
 
#define NFC6_IDLE_RSP_TAG_DETECT   0x02
 
#define NFC6_IDLE_RSP_LENGTH   1
 
#define NFC6_IDLE_CALIB_START   0x80
 
#define NFC6_PROTOCOL_FIELD_OFF   0
 NFC 6 protocol selection setting.
 
#define NFC6_PROTOCOL_ISO_15693   1
 
#define NFC6_PROTOCOL_ISO_14443A   2
 
#define NFC6_PROTOCOL_ISO_14443B   3
 
#define NFC6_PROTOCOL_FELICA   4
 
#define NFC6_TAG_UID_RSP_MAX_DATA_LEN   10
 NFC 6 MIFARE classic setting.
 
#define NFC6_TAG_UID_MAX_LEN   7
 
#define NFC6_MIFARE_REQA   0x26
 
#define NFC6_MIFARE_REQA_LEN   0x07
 
#define NFC6_MIFARE_WUPA   0x52
 
#define NFC6_MIFARE_CL1   0x93
 
#define NFC6_MIFARE_CL2   0x95
 
#define NFC6_MIFARE_ANTICOLLISION   0x20
 
#define NFC6_MIFARE_ANTICOLLISION_LEN   0x08
 
#define NFC6_MIFARE_SELECT   0x70
 
#define NFC6_MIFARE_CASCADE_TAG   0x88
 
#define NFC6_MIFARE_READ   0x30
 
#define NFC6_MIFARE_WRITE   0xA0
 
#define NFC6_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define NFC6_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define NFC6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  nfc6_return_value_t { NFC6_OK = 0 , NFC6_ERROR = -1 }
 NFC 6 Click return value data. More...
 

Functions

void nfc6_cfg_setup (nfc6_cfg_t *cfg)
 NFC 6 configuration object setup function.
 
err_t nfc6_init (nfc6_t *ctx, nfc6_cfg_t *cfg)
 NFC 6 initialization function.
 
err_t nfc6_default_cfg (nfc6_t *ctx)
 NFC 6 default configuration function.
 
err_t nfc6_send_command (nfc6_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 NFC 6 send command function.
 
err_t nfc6_read_data (nfc6_t *ctx, uint8_t *data_out, uint16_t buffer_size, uint16_t *rx_len)
 NFC 6 read data function.
 
err_t nfc6_poll_ready (nfc6_t *ctx)
 NFC 6 poll ready function.
 
err_t nfc6_poll_ready_irq (nfc6_t *ctx)
 NFC 6 poll ready irq function.
 
err_t nfc6_reset_device (nfc6_t *ctx)
 NFC 6 reset device function.
 
err_t nfc6_check_command_echo (nfc6_t *ctx)
 NFC 6 check command echo function.
 
void nfc6_pulse_irq_in (nfc6_t *ctx)
 NFC 6 pulse irq in function.
 
void nfc6_set_irq_in_pin (nfc6_t *ctx, uint8_t state)
 NFC 6 set irq in pin function.
 
uint8_t nfc6_get_irq_out_pin (nfc6_t *ctx)
 NFC 6 get irq out pin function.
 
err_t nfc6_calibrate_device (nfc6_t *ctx)
 NFC 6 calibrate device function.
 
err_t nfc6_select_protocol (nfc6_t *ctx, uint8_t protocol)
 NFC 6 select protocol function.
 
err_t nfc6_read_mifare_tag_uid (nfc6_t *ctx, uint8_t *tag_uid, uint8_t *tag_uid_len)
 NFC 6 read MIFARE tag UID function.
 

Detailed Description

This file contains API for NFC 6 Click Driver.

Enumeration Type Documentation

◆ nfc6_return_value_t

NFC 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
NFC6_OK 
NFC6_ERROR