42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define NFCTAG4_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
76#define NFCTAG4_RETVAL uint8_t
78#define NFCTAG4_OK 0x00
79#define NFCTAG4_INIT_ERROR 0xFF
86#define NFCTAG4_DEVICE_ADDRESS 0x53
93#define NFCTAG4_MEMORY_USER 0x01
94#define NFCTAG4_MEMORY_DYNAMIC 0x02
95#define NFCTAG4_MEMORY_MAILBOX 0x03
96#define NFCTAG4_MEMORY_SYSTEM 0x04
103#define NFCTAG4_SYSTEM_REG_GPO 0x0000
104#define NFCTAG4_SYSTEM_REG_IT_TIME 0x0001
105#define NFCTAG4_SYSTEM_REG_EH_MODE 0x0002
106#define NFCTAG4_SYSTEM_REG_RF_MNGT 0x0003
107#define NFCTAG4_SYSTEM_REG_RFA1SS 0x0004
108#define NFCTAG4_SYSTEM_REG_ENDA1 0x0005
109#define NFCTAG4_SYSTEM_REG_RFA2SS 0x0006
110#define NFCTAG4_SYSTEM_REG_ENDA2 0x0007
111#define NFCTAG4_SYSTEM_REG_RFA3SS 0x0008
112#define NFCTAG4_SYSTEM_REG_ENDA3 0x0009
113#define NFCTAG4_SYSTEM_REG_RFA4SS 0x000A
114#define NFCTAG4_SYSTEM_REG_I2CSS 0x000B
115#define NFCTAG4_SYSTEM_REG_LOCK_CCFILE 0x000C
116#define NFCTAG4_SYSTEM_REG_MB_MODE 0x000D
117#define NFCTAG4_SYSTEM_REG_MB_WDG 0x000E
118#define NFCTAG4_SYSTEM_REG_LOCK_CFG 0x000F
119#define NFCTAG4_SYSTEM_REG_LOCK_DSFID 0x0010
120#define NFCTAG4_SYSTEM_REG_LOCK_AFI 0x0011
121#define NFCTAG4_SYSTEM_REG_DSFID 0x0012
122#define NFCTAG4_SYSTEM_REG_AFI 0x0013
123#define NFCTAG4_SYSTEM_REG_MEM_SIZE_1 0x0014
124#define NFCTAG4_SYSTEM_REG_MEM_SIZE_2 0x0015
125#define NFCTAG4_SYSTEM_REG_BLK_SIZE 0x0016
126#define NFCTAG4_SYSTEM_REG_IC_REF 0x0017
127#define NFCTAG4_SYSTEM_REG_UID_1 0x0018
128#define NFCTAG4_SYSTEM_REG_UID_2 0x0019
129#define NFCTAG4_SYSTEM_REG_UID_3 0x001A
130#define NFCTAG4_SYSTEM_REG_UID_4 0x001B
131#define NFCTAG4_SYSTEM_REG_UID_5 0x001C
132#define NFCTAG4_SYSTEM_REG_UID_6 0x001D
133#define NFCTAG4_SYSTEM_REG_UID_7 0x001E
134#define NFCTAG4_SYSTEM_REG_UID_8 0x001F
135#define NFCTAG4_SYSTEM_REG_IC_REV 0x0020
136#define NFCTAG4_SYSTEM_REG_ST_RES_1 0x0021
137#define NFCTAG4_SYSTEM_REG_ST_RES_2 0x0022
138#define NFCTAG4_SYSTEM_REG_ST_RES_3 0x0023
139#define NFCTAG4_SYSTEM_REG_I2C_PWD_1 0x0900
140#define NFCTAG4_SYSTEM_REG_I2C_PWD_2 0x0901
141#define NFCTAG4_SYSTEM_REG_I2C_PWD_3 0x0902
142#define NFCTAG4_SYSTEM_REG_I2C_PWD_4 0x0903
143#define NFCTAG4_SYSTEM_REG_I2C_PWD_5 0x0904
144#define NFCTAG4_SYSTEM_REG_I2C_PWD_6 0x0905
145#define NFCTAG4_SYSTEM_REG_I2C_PWD_7 0x0906
146#define NFCTAG4_SYSTEM_REG_I2C_PWD_8 0x0907
153#define NFCTAG4_DYNAMIC_REG_GPO_CTRL 0x2000
154#define NFCTAG4_DYNAMIC_REG_RESERVED_1 0x2001
155#define NFCTAG4_DYNAMIC_REG_EH_CTRL 0x2002
156#define NFCTAG4_DYNAMIC_REG_RF_MNGT 0x2003
157#define NFCTAG4_DYNAMIC_REG_I2C_SSO 0x2004
158#define NFCTAG4_DYNAMIC_REG_IT_STS 0x2005
159#define NFCTAG4_DYNAMIC_REG_MB_CTRL 0x2006
160#define NFCTAG4_DYNAMIC_REG_MB_LEN 0x2007
167#define NFCTAG4_MAILBOX_REG_BYTE_0 0x2008
174#define NFCTAG4_MAILBOX_DISABLE 0x00
175#define NFCTAG4_MAILBOX_ENABLE 0x01
182#define NFCTAG4_RF_DISABLE 0x00
183#define NFCTAG4_RF_ENABLE 0x01
#define NFCTAG4_RETVAL
Definition nfctag4.h:76
uint8_t nfctag4_enable_mailbox(nfctag4_t *ctx, uint8_t enable_mailbox)
Enabling or disabling mailbox.
void nfctag4_default_cfg(nfctag4_t *ctx)
Click Default Configuration function.
uint8_t nfctag4_password_write(nfctag4_t *ctx, uint8_t *password_bytes)
Writing password to device.
NFCTAG4_RETVAL nfctag4_init(nfctag4_t *ctx, nfctag4_cfg_t *cfg)
Initialization function.
uint8_t nfctag4_enable_rf(nfctag4_t *ctx, uint8_t enable_rf)
Enabling or disabling RF.
void nfctag4_cfg_setup(nfctag4_cfg_t *cfg)
Config Object Initialization function.
uint8_t nfctag4_int_get(nfctag4_t *ctx)
Getting INT pin state.
uint8_t nfctag4_i2c_get(nfctag4_t *ctx, transfer_info *dev, uint8_t *register_buffer)
Getting registers via I2C.
uint8_t nfctag4_password_present(nfctag4_t *ctx, uint8_t *password_bytes)
Presenting password to device.
uint8_t nfctag4_i2c_set(nfctag4_t *ctx, transfer_info *dev, uint8_t *register_buffer)
Setting registers via I2C.
Click configuration structure definition.
Definition nfctag4.h:215
uint32_t i2c_speed
Definition nfctag4.h:227
pin_name_t scl
Definition nfctag4.h:218
pin_name_t int_pin
Definition nfctag4.h:223
pin_name_t sda
Definition nfctag4.h:219
uint8_t i2c_address
Definition nfctag4.h:228
Click ctx object definition.
Definition nfctag4.h:197
digital_in_t int_pin
Definition nfctag4.h:199
i2c_master_t i2c
Definition nfctag4.h:203
uint8_t slave_address
Definition nfctag4.h:207
uint16_t register_address
Definition nfctag4.h:235
uint8_t memory_area
Definition nfctag4.h:234
uint16_t n_registers
Definition nfctag4.h:236