nfc 2.1.0.0
nfc.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  nfc_t
 NFC Click context object. More...
 
struct  nfc_cfg_t
 NFC Click configuration object. More...
 
struct  control_packet_t
 NFC Click control packet object. More...
 
struct  data_packet_t
 NFC Click data packet object. More...
 

Macros

#define NFC_RF_DISCOVER_MAP_CMD   0x00
 NFC description setting.
 
#define NFC_RF_DISCOVER_MAP_RSP   0x00
 
#define NFC_RF_SET_LISTEN_MODE_ROUTING_CMD   0x01
 
#define NFC_RF_SET_LISTEN_MODE_ROUTING_RSP   0x01
 
#define NFC_RF_GET_LISTEN_MODE_ROUTING_CMD   0x02
 
#define NFC_RF_GET_LISTEN_MODE_ROUTING_RSP   0x02
 
#define NFC_RF_GET_LISTEN_MODE_ROUTING_NTF   0x02
 
#define NFC_RF_DISCOVER_CMD   0x03
 
#define NFC_RF_DISCOVER_RSP   0x03
 
#define NFC_RF_DISCOVER_NTF   0x03
 
#define NFC_RF_DISCOVER_SELECT_CMD   0x04
 
#define NFC_RF_DISCOVER_SELECT_RSP   0x04
 
#define NFC_RF_INTF_ACTIVATED_NTF   0x05
 
#define NFC_RF_DEACTIVATE_CMD   0x06
 
#define NFC_RF_DEACTIVATE_RSP   0x06
 
#define NFC_RF_DEACTIVATE_NTF   0x06
 
#define NFC_RF_FIELD_INFO_NTF   0x07
 
#define NFC_RF_T3T_POLLING_CMD   0x08
 
#define NFC_RF_T3T_POLLING_RSP   0x08
 
#define NFC_RF_T3T_POLLING_NTF   0x08
 
#define NFC_RF_NFCEE_ACTION_NTF   0x09
 
#define NFC_RF_NFCEE_DISCOVERY_REQ_NTF   0x0A
 
#define NFC_RF_PARAMETER_UPDATE_CMD   0x0B
 
#define NFC_RF_PARAMETER_UPDATE_RSP   0x0B
 
#define NFC_NFCEE_DISCOVER_CMD   0x00
 
#define NFC_NFCEE_DISCOVER_RSP   0x00
 
#define NFC_NFCEE_DISCOVER_NTF   0x00
 
#define NFC_NFCEE_MODE_SET_CMD   0x01
 
#define NFC_NFCEE_MODE_SET_RSP   0x01
 
#define NFC_NCI_PROPRIETARY_ACT_CMD   0x02
 
#define NFC_NCI_PROPRIETARY_ACT_RSP   0x02
 
#define NFC_RESET_KEEP_CONFIG   0x00
 
#define NFC_RESET_CLEAR_CONFIG   0x01
 
#define NFC_STATUS_OK   0x00
 NFC generic status codes.
 
#define NFC_STATUS_REJECTED   0x01
 
#define NFC_STATUS_RF_FRAME_CORRUPTED   0x02
 
#define NFC_STATUS_FAILED   0x03
 
#define NFC_STATUS_NOT_INITIALIZED   0x04
 
#define NFC_STATUS_SYNTAX_ERROR   0x05
 
#define NFC_STATUS_SEMANTIC_ERROR   0x06
 
#define NFC_STATUS_INVALID_PARAM   0x09
 
#define NFC_STATUS_MESSAGE_SIZE_EXCEEDED   0x0A
 
#define NFC_DISCOVERY_ALREADY_STARTED   0xA0
 
#define NFC_DISCOVERY_TARGET_ACTIVATION_FAILED   0xA1
 
#define NFC_DISCOVERY_TEAR_DOWN   0xA2
 
#define NFC_RF_TRANSMISSION_ERROR   0xB0
 
#define NFC_RF_PROTOCOL_ERROR   0xB1
 
#define NFC_RF_TIMEOUT_ERROR   0xB2
 
#define NFC_NFCEE_INTERFACE_ACTIVATION_FAILED   0xC0
 
#define NFC_NFCEE_TRANSMISSION_ERROR   0xC1
 
#define NFC_NFCEE_PROTOCOL_ERROR   0xC2
 
#define NFC_NFCEE_TIMEOUT_ERROR   0xC3
 
#define NFC_NFC_RF_TECHNOLOGY_A   0x00
 
#define NFC_NFC_RF_TECHNOLOGY_B   0x01
 
#define NFC_NFC_RF_TECHNOLOGY_F   0x02
 
#define NFC_NFC_RF_TECHNOLOGY_15693   0x03
 
#define NFC_NFC_A_PASSIVE_POLL_MODE   0x00
 NFC passive poll mode.
 
#define NFC_NFC_B_PASSIVE_POLL_MODE   0x01
 
#define NFC_NFC_F_PASSIVE_POLL_MODE   0x02
 
#define NFC_NFC_A_ACTIVE_POLL_MODE   0x03
 
#define NFC_NFC_F_ACTIVE_POLL_MODE   0x05
 
#define NFC_NFC_15693_PASSIVE_POLL_MODE   0x06
 
#define NFC_NFC_A_PASSIVE_LISTEN_MODE   0x80
 
#define NFC_NFC_B_PASSIVE_LISTEN_MODE   0x81
 
#define NFC_NFC_F_PASSIVE_LISTEN_MODE   0x82
 
#define NFC_NFC_A_ACTIVE_LISTEN_MODE   0x83
 
#define NFC_NFC_F_ACTIVE_LISTEN_MODE   0x85
 
#define NFC_NFC_15693_PASSIVE_LISTEN_MODE   0x86
 
#define NFC_PROTOCOL_UNDETERMINED   0x00
 NFC RF protocols.
 
#define NFC_PROTOCOL_T1T   0x01
 
#define NFC_PROTOCOL_T2T   0x02
 
#define NFC_PROTOCOL_T3T   0x03
 
#define NFC_PROTOCOL_ISO_DEP   0x04
 
#define NFC_PROTOCOL_NFC_DEP   0x05
 
#define NFC_NFCEE_DIRECT_RF_INTERFACE   0x00
 
#define NFC_FRAME_RF_INTERFACE   0x01
 
#define NFC_ISO_DEP_RF_INTERFACE   0x02
 
#define NFC_NFC_DEP_RF_INTERFACE   0x03
 
#define NFC_APDU   0x00
 NFC NFCEE protocol.
 
#define NFC_HCI_ACCES   0x01
 
#define NFC_TYPE_3_TAG_COMMAND_SET   0x02
 
#define NFC_TRANSPARENT   0x03
 
#define NFC_NFC_BIT_RATE_106   0x00
 NFC bit rates.
 
#define NFC_NFC_BIT_RATE_212   0x01
 
#define NFC_NFC_BIT_RATE_424   0x02
 
#define NFC_NFC_BIT_RATE_848   0x03
 
#define NFC_NFC_BIT_RATE_1695   0x04
 
#define NFC_NFC_BIT_RATE_3390   0x05
 
#define NFC_NFC_BIT_RATE_6780   0x06
 
#define NFC_IRQ_STATE_LOW   0x00
 NFC IRQ state.
 
#define NFC_IRQ_STATE_HIGH   0x01
 
#define NFC_GROUP_ID_CORE   0x00
 NFC Group Identifier ( GID ).
 
#define NFC_GROUP_ID_RF_MANAGEMENT   0x01
 
#define NFC_GROUP_ID_NFC_MANAGEMENT   0x02
 
#define NFC_GROUP_ID_PROPRIETARY   0x0F
 
#define NFC_CORE_RESET_CMD   0x00
 NFC OpCode Identifier ( OID ).
 
#define NFC_CORE_RESET_RSP   0x00
 
#define NFC_CORE_RESET_NTF   0x00
 
#define NFC_CORE_INIT_CMD   0x01
 
#define NFC_CORE_INIT_RSP   0x01
 
#define NFC_CORE_SET_CONFIG_CMD   0x02
 
#define NFC_CORE_SET_CONFIG_RSP   0x02
 
#define NFC_CORE_GET_CONFIG_CMD   0x03
 
#define NFC_CORE_GET_CONFIG_RSP   0x03
 
#define NFC_CORE_CONN_CREATE_CMD   0x04
 
#define NFC_CORE_CONN_CREATE_RSP   0x04
 
#define NFC_CORE_CONN_CLOSE_CMD   0x05
 
#define NFC_CORE_CONN_CLOSE_RSP   0x05
 
#define NFC_CORE_CONN_CREDITS_NTF   0x06
 
#define NFC_CORE_GENERIC_ERROR_NTF   0x07
 
#define NFC_CORE_INTERFACE_ERROR_NTF   0x08
 
#define NFC_I2C_ADDR_0   0x28
 NFC device address setting.
 
#define NFC_I2C_ADDR_1   0x29
 
#define NFC_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  nfc_return_value_t { NFC_OK = 0 , NFC_ERROR = -1 }
 NFC Click return value data. More...
 

Functions

void nfc_cfg_setup (nfc_cfg_t *cfg)
 NFC configuration object setup function.
 
err_t nfc_init (nfc_t *ctx, nfc_cfg_t *cfg)
 NFC initialization function.
 
void nfc_default_cfg (nfc_t *ctx, control_packet_t *ctrl_pck)
 NFC default configuration function.
 
err_t nfc_generic_write (nfc_t *ctx, uint8_t *p_tx_data, uint8_t n_bytes)
 NFC I2C writing function.
 
err_t nfc_generic_read (nfc_t *ctx, uint8_t *p_rx_h_data, uint8_t *p_rx_p_data)
 NFC I2C reading function.
 
void nfc_hw_reset (nfc_t *ctx)
 HW reset function.
 
uint8_t nfc_get_data (nfc_t *ctx, uint8_t *p_rx_data)
 Get data function.
 
void nfc_read_ctrl_packet_data (nfc_t *ctx, control_packet_t *ctrl_pck)
 Read control packet data function.
 
void nfc_write_ctrl_packet_data (nfc_t *ctx, control_packet_t ctrl_pck)
 Write control packet data function.
 
uint8_t nfc_check_irq (nfc_t *ctx)
 Check IRQ ststus function.
 
void nfc_cmd_core_reset (nfc_t *ctx)
 Core reset command function.
 
void nfc_cmd_core_init (nfc_t *ctx)
 Core init command function.
 
void nfc_cmd_disable_standby_mode (nfc_t *ctx)
 Disable standby mode command function.
 
void nfc_cmd_antenna_test (nfc_t *ctx, uint8_t sel_ant)
 Antenna test function.
 
void nfc_cmd_test_procedure (nfc_t *ctx)
 NFC test procedure command function.
 
void nfc_core_reset (nfc_t *ctx)
 Core reset command function.
 
void nfc_init_core (nfc_t *ctx)
 Core initialization command function.
 
void nfc_core_set_default_config (nfc_t *ctx)
 Set default configuration function.
 
void nfc_core_set_protocol_config (nfc_t *ctx)
 Set protocol configuration function.
 
void nfc_cmd_start_discovery (nfc_t *ctx)
 Start discovery command function.
 
void nfc_activate_rmt_mifare_card (nfc_t *ctx)
 Activate remote mifare card command function.
 
void nfc_cmd_authenticate_sector (nfc_t *ctx, uint8_t sel_sect_addr)
 Authenticate sector command function.
 
void nfc_cmd_card_disconnected (nfc_t *ctx)
 Card disconnected command function.
 

Detailed Description

This file contains API for NFC Click Driver.

Enumeration Type Documentation

◆ nfc_return_value_t

NFC Click return value data.

Predefined enum values for driver return values.

Enumerator
NFC_OK 
NFC_ERROR