Go to the documentation of this file.
37 #include "mikrosdk_version.h"
40 #if mikroSDK_GET_VERSION < 20800ul
41 #include "rcu_delays.h"
47 #include "drv_digital_out.h"
48 #include "drv_digital_in.h"
49 #include "drv_i2c_master.h"
61 #define NFCEXTEND_MAP_MIKROBUS( cfg, mikrobus ) \
62 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
63 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
64 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
71 #define NFCEXTEND_RETVAL uint8_t
73 #define NFCEXTEND_OK 0x00
74 #define NFCEXTEND_INIT_ERROR 0xFF
81 #define NFCEXTEND_I2C_SLAVE_ADDRESS 0x53
89 #define NFCEXTEND_MEMORY_USER 0x01
90 #define NFCEXTEND_MEMORY_DYNAMIC 0x02
91 #define NFCEXTEND_MEMORY_MAILBOX 0x03
92 #define NFCEXTEND_MEMORY_SYSTEM 0x04
95 #define NFCEXTEND_SYSTEM_REG_GPO 0x0000
96 #define NFCEXTEND_SYSTEM_REG_IT_TIME 0x0001
97 #define NFCEXTEND_SYSTEM_REG_EH_MODE 0x0002
98 #define NFCEXTEND_SYSTEM_REG_RF_MNGT 0x0003
99 #define NFCEXTEND_SYSTEM_REG_RFA1SS 0x0004
100 #define NFCEXTEND_SYSTEM_REG_ENDA1 0x0005
101 #define NFCEXTEND_SYSTEM_REG_RFA2SS 0x0006
102 #define NFCEXTEND_SYSTEM_REG_ENDA2 0x0007
103 #define NFCEXTEND_SYSTEM_REG_RFA3SS 0x0008
104 #define NFCEXTEND_SYSTEM_REG_ENDA3 0x0009
105 #define NFCEXTEND_SYSTEM_REG_RFA4SS 0x000A
106 #define NFCEXTEND_SYSTEM_REG_I2CSS 0x000B
107 #define NFCEXTEND_SYSTEM_REG_LOCK_CCFILE 0x000C
108 #define NFCEXTEND_SYSTEM_REG_MB_MODE 0x000D
109 #define NFCEXTEND_SYSTEM_REG_MB_WDG 0x000E
110 #define NFCEXTEND_SYSTEM_REG_LOCK_CFG 0x000F
111 #define NFCEXTEND_SYSTEM_REG_LOCK_DSFID 0x0010
112 #define NFCEXTEND_SYSTEM_REG_LOCK_AFI 0x0011
113 #define NFCEXTEND_SYSTEM_REG_DSFID 0x0012
114 #define NFCEXTEND_SYSTEM_REG_AFI 0x0013
115 #define NFCEXTEND_SYSTEM_REG_MEM_SIZE_1 0x0014
116 #define NFCEXTEND_SYSTEM_REG_MEM_SIZE_2 0x0015
117 #define NFCEXTEND_SYSTEM_REG_BLK_SIZE 0x0016
118 #define NFCEXTEND_SYSTEM_REG_IC_REF 0x0017
119 #define NFCEXTEND_SYSTEM_REG_UID_1 0x0018
120 #define NFCEXTEND_SYSTEM_REG_UID_2 0x0019
121 #define NFCEXTEND_SYSTEM_REG_UID_3 0x001A
122 #define NFCEXTEND_SYSTEM_REG_UID_4 0x001B
123 #define NFCEXTEND_SYSTEM_REG_UID_5 0x001C
124 #define NFCEXTEND_SYSTEM_REG_UID_6 0x001D
125 #define NFCEXTEND_SYSTEM_REG_UID_7 0x001E
126 #define NFCEXTEND_SYSTEM_REG_UID_8 0x001F
127 #define NFCEXTEND_SYSTEM_REG_IC_REV 0x0020
128 #define NFCEXTEND_SYSTEM_REG_ST_RES_1 0x0021
129 #define NFCEXTEND_SYSTEM_REG_ST_RES_2 0x0022
130 #define NFCEXTEND_SYSTEM_REG_ST_RES_3 0x0023
131 #define NFCEXTEND_SYSTEM_REG_I2C_PWD_1 0x0900
132 #define NFCEXTEND_SYSTEM_REG_I2C_PWD_2 0x0901
133 #define NFCEXTEND_SYSTEM_REG_I2C_PWD_3 0x0902
134 #define NFCEXTEND_SYSTEM_REG_I2C_PWD_4 0x0903
135 #define NFCEXTEND_SYSTEM_REG_I2C_PWD_5 0x0904
136 #define NFCEXTEND_SYSTEM_REG_I2C_PWD_6 0x0905
137 #define NFCEXTEND_SYSTEM_REG_I2C_PWD_7 0x0906
138 #define NFCEXTEND_SYSTEM_REG_I2C_PWD_8 0x0907
141 #define NFCEXTEND_DYNAMIC_REG_GPO_CTRL 0x2000
142 #define NFCEXTEND_DYNAMIC_REG_RESERVED_1 0x2001
143 #define NFCEXTEND_DYNAMIC_REG_EH_CTRL 0x2002
144 #define NFCEXTEND_DYNAMIC_REG_RF_MNGT 0x2003
145 #define NFCEXTEND_DYNAMIC_REG_I2C_SSO 0x2004
146 #define NFCEXTEND_DYNAMIC_REG_IT_STS 0x2005
147 #define NFCEXTEND_DYNAMIC_REG_MB_CTRL 0x2006
148 #define NFCEXTEND_DYNAMIC_REG_MB_LEN 0x2007
156 #define NFCEXTEND_MAILBOX_REG_BYTE_0 0x2008
159 #define NFCEXTEND_MAILBOX_DISABLE 0x00
160 #define NFCEXTEND_MAILBOX_ENABLE 0x01
163 #define NFCEXTEND_RF_DISABLE 0x00
164 #define NFCEXTEND_RF_ENABLE 0x01
167 #define NFCEXTEND_PASSWORD_LEN 8
168 #define NFCEXTEND_PASSWORD_BUFFER_SIZE NFCEXTEND_PASSWORD_LEN * 2 + 1
313 #endif // _NFCEXTEND_H_
pin_name_t int_pin
Definition: nfcextend.h:221
uint8_t nfcextend_default_cfg(nfcextend_t *ctx)
Click Default Configuration function.
void nfcextend_cfg_setup(nfcextend_cfg_t *cfg)
Config Object Initialization function.
uint8_t slave_address
Definition: nfcextend.h:205
digital_in_t int_pin
Definition: nfcextend.h:197
Click ctx object definition.
Definition: nfcextend.h:194
uint8_t nfcextend_i2c_get(nfcextend_t *ctx, nfcextend_block_t *block)
I2C get function.
uint8_t memory_area
Definition: nfcextend.h:183
NFCEXTEND_RETVAL nfcextend_init(nfcextend_t *ctx, nfcextend_cfg_t *cfg)
Initialization function.
uint8_t nfcextend_password_present(nfcextend_t *ctx, uint8_t *pass_buf)
Password present function.
Click configuration structure definition.
Definition: nfcextend.h:213
uint16_t reg_addr
Definition: nfcextend.h:184
uint8_t * data_buf
Definition: nfcextend.h:185
uint16_t len
Definition: nfcextend.h:186
pin_name_t sda
Definition: nfcextend.h:217
uint8_t nfcextend_i2c_set(nfcextend_t *ctx, nfcextend_block_t *block)
I2C set function.
uint32_t i2c_speed
Definition: nfcextend.h:225
uint8_t i2c_address
Definition: nfcextend.h:226
#define NFCEXTEND_RETVAL
Definition: nfcextend.h:71
i2c_master_t i2c
Definition: nfcextend.h:201
pin_name_t scl
Definition: nfcextend.h:216
uint8_t nfcextend_digital_read_int(nfcextend_t *ctx)
Digital read interrupt.
I2C communication block object definition.
Definition: nfcextend.h:182