42#define CHIP_NAME "NXP NTAG213/5/6"
43#define MANUFACTURER_NAME "NXP"
44#define SUPPLY_VOLTAGE_MIN 3.3f
45#define SUPPLY_VOLTAGE_MAX 4.0f
46#define MAX_CURRENT 30.0f
47#define TEMPERATURE_MIN -25.0f
48#define TEMPERATURE_MAX 70.0f
49#define DRIVER_VERSION 1000
54#define NTAG21X_COMMAND_REQUEST 0x26
55#define NTAG21X_COMMAND_WAKE_UP 0x52
56#define NTAG21X_COMMAND_ANTICOLLISION_CL1 0x9320U
57#define NTAG21X_COMMAND_SELECT_CL1 0x9370U
58#define NTAG21X_COMMAND_ANTICOLLISION_CL2 0x9520U
59#define NTAG21X_COMMAND_SELECT_CL2 0x9570U
60#define NTAG21X_COMMAND_HALT 0x5000U
61#define NTAG21X_COMMAND_GET_VERSION 0x60
62#define NTAG21X_COMMAND_READ 0x30
63#define NTAG21X_COMMAND_FAST_READ 0x3A
64#define NTAG21X_COMMAND_WRITE 0xA2
65#define NTAG21X_COMMAND_COMP_WRITE 0xA0
66#define NTAG21X_COMMAND_READ_CNT 0x39
67#define NTAG21X_COMMAND_PWD_AUTH 0x1B
68#define NTAG21X_COMMAND_READ_SIG 0x3C
76static void a_ntag21x_iso14443a_crc(uint8_t *p, uint8_t len, uint8_t output[2])
78 uint32_t w_crc = 0x6363;
85 bt = (bt ^ (uint8_t)(w_crc & 0x00FF));
86 bt = (bt ^ (bt << 4));
87 w_crc = (w_crc >> 8) ^ ((uint32_t) bt << 8) ^ ((uint32_t) bt << 3) ^ ((uint32_t) bt >> 4);
90 output[0] = (uint8_t)(w_crc & 0xFF);
91 output[1] = (uint8_t)((w_crc >> 8) & 0xFF);
104static uint8_t a_ntag21x_conf_read(
ntag21x_handle_t *handle, uint8_t page, uint8_t data[4])
108 uint8_t input_buf[5];
110 uint8_t output_buf[6];
117 a_ntag21x_iso14443a_crc(input_buf , 3, input_buf + 3);
122 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
128 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
132 a_ntag21x_iso14443a_crc(output_buf, 4, crc_buf);
133 if ((output_buf[4] == crc_buf[0]) && (output_buf[5] == crc_buf[1]))
135 memcpy(data, output_buf, 4);
157static uint8_t a_ntag21x_conf_write(
ntag21x_handle_t *handle, uint8_t page, uint8_t data[4])
161 uint8_t input_buf[8];
163 uint8_t output_buf[1];
168 input_buf[2] = data[0];
169 input_buf[3] = data[1];
170 input_buf[4] = data[2];
171 input_buf[5] = data[3];
172 a_ntag21x_iso14443a_crc(input_buf, 6, input_buf + 6);
177 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
183 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
187 if (output_buf[0] != 0xA)
221 handle->
debug_print(
"ntag21x: contactless_init is null.\n");
227 handle->
debug_print(
"ntag21x: contactless_deinit is null.\n");
233 handle->
debug_print(
"ntag21x: contactless_transceiver is null.\n");
239 handle->
debug_print(
"ntag21x: delay_ms is null.\n");
247 handle->
debug_print(
"ntag21x: contactless init failed.\n");
284 handle->
debug_print(
"ntag21x: contactless deinit failed.\n");
310 uint8_t input_buf[1];
312 uint8_t output_buf[2];
329 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
335 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
339 if ((output_buf[0] == 0x44) && (output_buf[1] == 0x00))
342 handle->
type = *type;
349 handle->
type = *type;
350 handle->
debug_print(
"ntag21x: type is invalid.\n");
373 uint8_t input_buf[1];
375 uint8_t output_buf[2];
393 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
399 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
403 if ((output_buf[0] == 0x44) && (output_buf[1] == 0x00))
406 handle->
type = *type;
413 handle->
type = *type;
414 handle->
debug_print(
"ntag21x: type is invalid.\n");
433 uint8_t input_buf[4];
435 uint8_t output_buf[1];
449 a_ntag21x_iso14443a_crc(input_buf, 2, input_buf + 2);
475 uint8_t input_buf[2];
477 uint8_t output_buf[5];
495 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
501 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
506 for (i = 0; i < 4; i++)
508 id[i] = output_buf[i];
509 check ^= output_buf[i];
511 if (check != output_buf[4])
540 uint8_t input_buf[2];
542 uint8_t output_buf[5];
560 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
566 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
571 for (i = 0; i < 4; i++)
573 id[i] = output_buf[i];
574 check ^= output_buf[i];
576 if (check != output_buf[4])
604 uint8_t input_buf[9];
606 uint8_t output_buf[1];
621 for (i = 0; i < 4; i++)
623 input_buf[2 + i] =
id[i];
624 input_buf[6] ^=
id[i];
626 a_ntag21x_iso14443a_crc(input_buf, 7, input_buf + 7);
631 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
637 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
641 if (output_buf[0] == 0x04)
671 uint8_t input_buf[9];
673 uint8_t output_buf[1];
688 for (i = 0; i < 4; i++)
690 input_buf[2 + i] =
id[i];
691 input_buf[6] ^=
id[i];
693 a_ntag21x_iso14443a_crc(input_buf, 7, input_buf + 7);
698 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
704 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
708 if (output_buf[0] == 0x00)
737 uint8_t input_buf[3];
739 uint8_t output_buf[10];
753 a_ntag21x_iso14443a_crc(input_buf, 1, input_buf + 1);
758 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
762 if (output_len != 10)
764 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
768 a_ntag21x_iso14443a_crc(output_buf, 8, crc_buf);
769 if ((output_buf[8] == crc_buf[0]) && (output_buf[9] == crc_buf[1]))
823 uint8_t input_buf[4];
825 uint8_t output_buf[5];
840 a_ntag21x_iso14443a_crc(input_buf, 2, input_buf + 2);
845 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
851 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
855 a_ntag21x_iso14443a_crc(output_buf, 3, crc_buf);
856 if ((output_buf[3] == crc_buf[0]) && (output_buf[4] == crc_buf[1]))
858 *cnt = ((uint32_t)output_buf[2] << 16) | ((uint32_t)output_buf[1] << 8) |
859 ((uint32_t)output_buf[0] << 0);
888 uint8_t input_buf[4];
890 uint8_t output_buf[34];
905 a_ntag21x_iso14443a_crc(input_buf, 2, input_buf + 2);
910 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
914 if (output_len != 34)
916 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
920 a_ntag21x_iso14443a_crc(output_buf, 32, crc_buf);
921 if ((output_buf[32] == crc_buf[0]) && (output_buf[33] == crc_buf[1]))
923 memcpy(signature, output_buf, 32);
952 uint8_t input_buf[4];
954 uint8_t output_buf[18];
969 a_ntag21x_iso14443a_crc(input_buf , 2, input_buf + 2);
974 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
978 if (output_len != 18)
980 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
984 a_ntag21x_iso14443a_crc(output_buf, 16, crc_buf);
985 if ((output_buf[16] == crc_buf[0]) && (output_buf[17] == crc_buf[1]))
987 number[0] = output_buf[0];
988 number[1] = output_buf[1];
989 number[2] = output_buf[2];
990 number[3] = output_buf[4];
991 number[4] = output_buf[5];
992 number[5] = output_buf[6];
993 number[6] = output_buf[7];
1023 uint8_t input_buf[4];
1025 uint8_t output_buf[18];
1039 input_buf[1] = 0x00;
1040 a_ntag21x_iso14443a_crc(input_buf , 2, input_buf + 2);
1045 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1049 if (output_len != 18)
1051 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1055 a_ntag21x_iso14443a_crc(output_buf, 16, crc_buf);
1056 if ((output_buf[16] == crc_buf[0]) && (output_buf[17] == crc_buf[1]))
1058 if ((output_buf[12] == 0xE1) && (output_buf[13] == 0x10) &&
1059 (output_buf[15] == 0x00)
1062 if (output_buf[14] == 0x12)
1067 else if (output_buf[14] == 0x3E)
1072 else if (output_buf[14] == 0x6D)
1079 handle->
debug_print(
"ntag21x: data is invalid.\n");
1088 handle->
debug_print(
"ntag21x: data is invalid.\n");
1119 uint8_t input_buf[4];
1121 uint8_t output_buf[18];
1135 input_buf[1] = start_page;
1136 a_ntag21x_iso14443a_crc(input_buf , 2, input_buf + 2);
1141 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1145 if (output_len != 18)
1147 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1151 a_ntag21x_iso14443a_crc(output_buf, 16, crc_buf);
1152 if ((output_buf[16] == crc_buf[0]) && (output_buf[17] == crc_buf[1]))
1154 memcpy(data, output_buf, 16);
1184 uint8_t input_buf[4];
1186 uint8_t output_buf[18];
1200 input_buf[1] = page;
1201 a_ntag21x_iso14443a_crc(input_buf , 2, input_buf + 2);
1206 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1210 if (output_len != 18)
1212 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1216 a_ntag21x_iso14443a_crc(output_buf, 16, crc_buf);
1217 if ((output_buf[16] == crc_buf[0]) && (output_buf[17] == crc_buf[1]))
1219 memcpy(data, output_buf, 4);
1255 uint8_t input_buf[5];
1258 uint8_t output_buf[64];
1269 if (stop_page < start_page)
1271 handle->
debug_print(
"ntag21x: stop_page < start_page.\n");
1275 if (stop_page - start_page + 1 > 15)
1277 handle->
debug_print(
"ntag21x: stop_page - start_page + 1 is over 15.\n");
1281 if ((*len) < (4 * (stop_page - start_page + 1)))
1283 handle->
debug_print(
"ntag21x: len < %d.\n", 4 * (stop_page - start_page + 1));
1290 input_buf[1] = start_page;
1291 input_buf[2] = stop_page;
1292 a_ntag21x_iso14443a_crc(input_buf , 3, input_buf + 3);
1293 cal_len = 4 * (stop_page - start_page + 1);
1294 output_len = (uint8_t)(cal_len + 2);
1298 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1302 if (output_len != (cal_len + 2))
1304 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1308 a_ntag21x_iso14443a_crc(output_buf, (uint8_t)cal_len, crc_buf);
1309 if ((output_buf[cal_len] == crc_buf[0]) && (output_buf[cal_len + 1] == crc_buf[1]))
1311 memcpy(data, output_buf, cal_len);
1343 uint8_t input_buf[18];
1345 uint8_t output_buf[1];
1358 input_buf[1] = page;
1359 a_ntag21x_iso14443a_crc(input_buf, 2, input_buf + 2);
1364 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1368 if (output_len != 1)
1370 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1374 if (output_buf[0] != 0xA)
1381 for (i = 0; i < 4; i ++)
1383 input_buf[i] = data[i];
1385 for (i = 0; i < 12; i ++)
1387 input_buf[4 + i] = 0x00;
1389 a_ntag21x_iso14443a_crc(input_buf, 16, input_buf + 16);
1395 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1399 if (output_buf[0] != 0xA)
1427 uint8_t input_buf[8];
1429 uint8_t output_buf[1];
1442 input_buf[1] = page;
1443 input_buf[2] = data[0];
1444 input_buf[3] = data[1];
1445 input_buf[4] = data[2];
1446 input_buf[5] = data[3];
1447 a_ntag21x_iso14443a_crc(input_buf, 6, input_buf + 6);
1452 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1456 if (output_len != 1)
1458 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1462 if (output_buf[0] != 0xA)
1491 uint8_t input_buf[7];
1493 uint8_t output_buf[4];
1507 input_buf[1] = pwd[0];
1508 input_buf[2] = pwd[1];
1509 input_buf[3] = pwd[2];
1510 input_buf[4] = pwd[3];
1511 a_ntag21x_iso14443a_crc(input_buf, 5, input_buf + 5);
1516 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1520 if (output_len != 4)
1522 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1526 a_ntag21x_iso14443a_crc(output_buf, 2, crc_buf);
1527 if ((output_buf[2] == crc_buf[0]) && (output_buf[3] == crc_buf[1]))
1529 if ((output_buf[0] != pack[0]) || (output_buf[1] != pack[1]))
1531 handle->
debug_print(
"ntag21x: pack check failed.\n");
1563 uint8_t input_buf[8];
1565 uint8_t output_buf[1];
1578 input_buf[1] = handle->
end_page - 1;
1579 input_buf[2] = pwd[0];
1580 input_buf[3] = pwd[1];
1581 input_buf[4] = pwd[2];
1582 input_buf[5] = pwd[3];
1583 a_ntag21x_iso14443a_crc(input_buf, 6, input_buf + 6);
1588 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1592 if (output_len != 1)
1594 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1598 if (output_buf[0] != 0xA)
1625 uint8_t input_buf[8];
1627 uint8_t output_buf[1];
1641 input_buf[2] = pack[0];
1642 input_buf[3] = pack[1];
1643 input_buf[4] = 0x00;
1644 input_buf[5] = 0x00;
1645 a_ntag21x_iso14443a_crc(input_buf, 6, input_buf + 6);
1650 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1654 if (output_len != 1)
1656 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1660 if (output_buf[0] != 0xA)
1716 uint8_t input_buf[8];
1718 uint8_t output_buf[1];
1731 input_buf[1] = handle->
end_page - 4;
1732 input_buf[2] = lock[0];
1733 input_buf[3] = lock[1];
1734 input_buf[4] = lock[2];
1735 input_buf[5] = 0x00;
1736 a_ntag21x_iso14443a_crc(input_buf, 6, input_buf + 6);
1741 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1745 if (output_len != 1)
1747 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1751 if (output_buf[0] != 0xA)
1778 uint8_t input_buf[5];
1780 uint8_t output_buf[6];
1794 input_buf[1] = handle->
end_page - 4;
1795 input_buf[2] = handle->
end_page - 4;
1796 a_ntag21x_iso14443a_crc(input_buf , 3, input_buf + 3);
1801 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1805 if (output_len != 6)
1807 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1811 a_ntag21x_iso14443a_crc(output_buf, 4, crc_buf);
1812 if ((output_buf[4] == crc_buf[0]) && (output_buf[5] == crc_buf[1]))
1814 memcpy(lock, output_buf, 3);
1848 uint8_t input_buf[8];
1850 uint8_t output_buf[1];
1863 input_buf[1] = 0x02;
1864 input_buf[2] = 0x00;
1865 input_buf[3] = 0x00;
1866 input_buf[4] = lock[0];
1867 input_buf[5] = lock[1];
1868 a_ntag21x_iso14443a_crc(input_buf, 6, input_buf + 6);
1873 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1877 if (output_len != 1)
1879 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1883 if (output_buf[0] != 0xA)
1910 uint8_t input_buf[5];
1912 uint8_t output_buf[6];
1928 a_ntag21x_iso14443a_crc(input_buf , 3, input_buf + 3);
1933 handle->
debug_print(
"ntag21x: contactless transceiver failed.\n");
1937 if (output_len != 6)
1939 handle->
debug_print(
"ntag21x: output_len is invalid.\n");
1943 a_ntag21x_iso14443a_crc(output_buf, 4, crc_buf);
1944 if ((output_buf[4] == crc_buf[0]) && (output_buf[5] == crc_buf[1]))
1946 memcpy(lock, output_buf + 2, 2);
1983 memset(conf, 0,
sizeof(uint8_t) * 4);
1984 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
1987 handle->
debug_print(
"ntag21x: conf read failed.\n");
1991 conf[0] &= ~(3 << 6);
1992 conf[0] |= mirror << 6;
1993 res = a_ntag21x_conf_write(handle, handle->
end_page - 3, conf);
1996 handle->
debug_print(
"ntag21x: conf write failed.\n");
2029 memset(conf, 0,
sizeof(uint8_t) * 4);
2030 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2033 handle->
debug_print(
"ntag21x: conf read failed.\n");
2067 memset(conf, 0,
sizeof(uint8_t) * 4);
2068 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2071 handle->
debug_print(
"ntag21x: conf read failed.\n");
2075 conf[0] &= ~(3 << 4);
2076 conf[0] |=
byte << 4;
2077 res = a_ntag21x_conf_write(handle, handle->
end_page - 3, conf);
2080 handle->
debug_print(
"ntag21x: conf write failed.\n");
2113 memset(conf, 0,
sizeof(uint8_t) * 4);
2114 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2117 handle->
debug_print(
"ntag21x: conf read failed.\n");
2151 memset(conf, 0,
sizeof(uint8_t) * 4);
2152 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2155 handle->
debug_print(
"ntag21x: conf read failed.\n");
2159 conf[0] &= ~(1 << 2);
2160 conf[0] |= mode << 2;
2161 res = a_ntag21x_conf_write(handle, handle->
end_page - 3, conf);
2164 handle->
debug_print(
"ntag21x: conf write failed.\n");
2197 memset(conf, 0,
sizeof(uint8_t) * 4);
2198 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2201 handle->
debug_print(
"ntag21x: conf read failed.\n");
2235 memset(conf, 0,
sizeof(uint8_t) * 4);
2236 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2239 handle->
debug_print(
"ntag21x: conf read failed.\n");
2244 res = a_ntag21x_conf_write(handle, handle->
end_page - 3, conf);
2247 handle->
debug_print(
"ntag21x: conf write failed.\n");
2280 memset(conf, 0,
sizeof(uint8_t) * 4);
2281 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2284 handle->
debug_print(
"ntag21x: conf read failed.\n");
2318 memset(conf, 0,
sizeof(uint8_t) * 4);
2319 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2322 handle->
debug_print(
"ntag21x: conf read failed.\n");
2327 res = a_ntag21x_conf_write(handle, handle->
end_page - 3, conf);
2330 handle->
debug_print(
"ntag21x: conf write failed.\n");
2363 memset(conf, 0,
sizeof(uint8_t) * 4);
2364 res = a_ntag21x_conf_read(handle, handle->
end_page - 3, conf);
2367 handle->
debug_print(
"ntag21x: conf read failed.\n");
2402 memset(conf, 0,
sizeof(uint8_t) * 4);
2403 res = a_ntag21x_conf_read(handle, handle->
end_page - 2, conf);
2406 handle->
debug_print(
"ntag21x: conf read failed.\n");
2410 conf[0] &= ~(1 << access);
2411 conf[0] |= enable << access;
2412 res = a_ntag21x_conf_write(handle, handle->
end_page - 2, conf);
2415 handle->
debug_print(
"ntag21x: conf write failed.\n");
2449 memset(conf, 0,
sizeof(uint8_t) * 4);
2450 res = a_ntag21x_conf_read(handle, handle->
end_page - 2, conf);
2453 handle->
debug_print(
"ntag21x: conf read failed.\n");
2494 memset(conf, 0,
sizeof(uint8_t) * 4);
2495 res = a_ntag21x_conf_read(handle, handle->
end_page - 2, conf);
2498 handle->
debug_print(
"ntag21x: conf read failed.\n");
2502 conf[0] &= ~(7 << 0);
2503 conf[0] |= limit << 0;
2504 res = a_ntag21x_conf_write(handle, handle->
end_page - 2, conf);
2507 handle->
debug_print(
"ntag21x: conf write failed.\n");
2540 memset(conf, 0,
sizeof(uint8_t) * 4);
2541 res = a_ntag21x_conf_read(handle, handle->
end_page - 2, conf);
2544 handle->
debug_print(
"ntag21x: conf read failed.\n");
2548 *limit = conf[0] & 0x7;
2577 out_buf, out_len) != 0)
#define NTAG21X_COMMAND_FAST_READ
#define NTAG21X_COMMAND_ANTICOLLISION_CL1
#define NTAG21X_COMMAND_COMP_WRITE
#define NTAG21X_COMMAND_SELECT_CL1
#define NTAG21X_COMMAND_READ
#define SUPPLY_VOLTAGE_MAX
#define NTAG21X_COMMAND_READ_SIG
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define NTAG21X_COMMAND_WAKE_UP
#define NTAG21X_COMMAND_PWD_AUTH
#define NTAG21X_COMMAND_READ_CNT
#define NTAG21X_COMMAND_GET_VERSION
#define NTAG21X_COMMAND_ANTICOLLISION_CL2
#define NTAG21X_COMMAND_WRITE
#define NTAG21X_COMMAND_HALT
#define NTAG21X_COMMAND_REQUEST
chip command definition
#define CHIP_NAME
chip information definition
#define NTAG21X_COMMAND_SELECT_CL2
driver ntag21x header file
ntag21x_type_t
ntag21x type enumeration definition
ntag21x_capability_container_t
ntag21x capability container enumeration definition
uint8_t ntag21x_anticollision_cl1(ntag21x_handle_t *handle, uint8_t id[4])
ntag21x anti collision cl1
uint8_t ntag21x_set_dynamic_lock(ntag21x_handle_t *handle, uint8_t lock[3])
ntag21x set the dynamic lock
struct ntag21x_handle_s ntag21x_handle_t
ntag21x handle structure definition
uint8_t ntag21x_halt(ntag21x_handle_t *handle)
ntag21x halt
uint8_t ntag21x_set_pack(ntag21x_handle_t *handle, uint8_t pack[2])
ntag21x set the pack
ntag21x_access_t
ntag21x access enumeration definition
uint8_t ntag21x_wake_up(ntag21x_handle_t *handle, ntag21x_type_t *type)
ntag21x wake up
uint8_t ntag21x_read_signature(ntag21x_handle_t *handle, uint8_t signature[32])
ntag21x read the signature
uint8_t ntag21x_get_static_lock(ntag21x_handle_t *handle, uint8_t lock[2])
ntag21x get the static lock
uint8_t ntag21x_read_counter(ntag21x_handle_t *handle, uint32_t *cnt)
ntag21x read the counter
uint8_t ntag21x_authenticate(ntag21x_handle_t *handle, uint8_t pwd[4], uint8_t pack[2])
ntag21x authenticate
uint8_t ntag21x_fast_read_page(ntag21x_handle_t *handle, uint8_t start_page, uint8_t stop_page, uint8_t *data, uint16_t *len)
ntag21x fast read page
uint8_t ntag21x_get_dynamic_lock(ntag21x_handle_t *handle, uint8_t lock[3])
ntag21x get the dynamic lock
uint8_t ntag21x_get_mirror(ntag21x_handle_t *handle, ntag21x_mirror_t *mirror)
ntag21x get the mirror
uint8_t ntag21x_get_protect_start_page(ntag21x_handle_t *handle, uint8_t *page)
ntag21x get the start page of protection
uint8_t ntag21x_select_cl2(ntag21x_handle_t *handle, uint8_t id[4])
ntag21x select cl2
uint8_t ntag21x_compatibility_write_page(ntag21x_handle_t *handle, uint8_t page, uint8_t data[4])
ntag21x compatibility write page
uint8_t ntag21x_request(ntag21x_handle_t *handle, ntag21x_type_t *type)
ntag21x request
uint8_t ntag21x_get_version(ntag21x_handle_t *handle, ntag21x_version_t *version)
ntag21x get the version
uint8_t ntag21x_get_serial_number(ntag21x_handle_t *handle, uint8_t number[7])
ntag21x get the serial number
uint8_t ntag21x_set_mirror_byte(ntag21x_handle_t *handle, ntag21x_mirror_byte_t byte)
ntag21x set the mirror byte
uint8_t ntag21x_read_four_pages(ntag21x_handle_t *handle, uint8_t start_page, uint8_t data[16])
ntag21x read four pages
uint8_t ntag21x_deinit(ntag21x_handle_t *handle)
close the chip
uint8_t ntag21x_set_static_lock(ntag21x_handle_t *handle, uint8_t lock[2])
ntag21x set the static lock
ntag21x_modulation_mode_t
ntag21x modulation mode enumeration definition
uint8_t ntag21x_get_mirror_byte(ntag21x_handle_t *handle, ntag21x_mirror_byte_t *byte)
ntag21x get the mirror byte
uint8_t ntag21x_set_protect_start_page(ntag21x_handle_t *handle, uint8_t page)
ntag21x set the start page of protection
uint8_t ntag21x_info(ntag21x_info_t *info)
get chip information
uint8_t ntag21x_write_page(ntag21x_handle_t *handle, uint8_t page, uint8_t data[4])
ntag21x write page
uint8_t ntag21x_get_authenticate_limitation(ntag21x_handle_t *handle, uint8_t *limit)
ntag21x get the authenticate limitation
uint8_t ntag21x_get_mirror_page(ntag21x_handle_t *handle, uint8_t *page)
ntag21x get the mirror page
struct ntag21x_info_s ntag21x_info_t
ntag21x information structure definition
uint8_t ntag21x_init(ntag21x_handle_t *handle)
initialize the chip
uint8_t ntag21x_set_mirror(ntag21x_handle_t *handle, ntag21x_mirror_t mirror)
ntag21x set the mirror
ntag21x_mirror_byte_t
ntag21x mirror byte enumeration definition
uint8_t ntag21x_read_page(ntag21x_handle_t *handle, uint8_t page, uint8_t data[4])
ntag21x read page
uint8_t ntag21x_set_access(ntag21x_handle_t *handle, ntag21x_access_t access, ntag21x_bool_t enable)
ntag21x enable or disable access
uint8_t ntag21x_anticollision_cl2(ntag21x_handle_t *handle, uint8_t id[4])
ntag21x anti collision cl2
uint8_t ntag21x_get_capability_container(ntag21x_handle_t *handle, ntag21x_capability_container_t *container)
ntag21x get the capability container
uint8_t ntag21x_get_access(ntag21x_handle_t *handle, ntag21x_access_t access, ntag21x_bool_t *enable)
ntag21x get the access status
uint8_t ntag21x_set_password(ntag21x_handle_t *handle, uint8_t pwd[4])
ntag21x set the password
uint8_t ntag21x_set_authenticate_limitation(ntag21x_handle_t *handle, uint8_t limit)
ntag21x set the authenticate limitation
uint8_t ntag21x_select_cl1(ntag21x_handle_t *handle, uint8_t id[4])
ntag21x select cl1
ntag21x_bool_t
ntag21x bool enumeration definition
uint8_t ntag21x_get_modulation_mode(ntag21x_handle_t *handle, ntag21x_modulation_mode_t *mode)
ntag21x get the modulation mode
struct ntag21x_version_s ntag21x_version_t
ntag21x version structure definition
ntag21x_mirror_t
ntag21x mirror enumeration definition
uint8_t ntag21x_set_mirror_page(ntag21x_handle_t *handle, uint8_t page)
ntag21x set the mirror page
uint8_t ntag21x_set_modulation_mode(ntag21x_handle_t *handle, ntag21x_modulation_mode_t mode)
ntag21x set the modulation mode
@ NTAG21X_CAPABILITY_CONTAINER_144_BYTE_NTAG213
@ NTAG21X_CAPABILITY_CONTAINER_496_BYTE_NTAG215
@ NTAG21X_CAPABILITY_CONTAINER_872_BYTE_NTAG216
uint8_t ntag21x_transceiver(ntag21x_handle_t *handle, uint8_t *in_buf, uint8_t in_len, uint8_t *out_buf, uint8_t *out_len)
transceiver data
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* contactless_deinit)(void)
uint8_t(* contactless_transceiver)(uint8_t *in_buf, uint8_t in_len, uint8_t *out_buf, uint8_t *out_len)
uint8_t(* contactless_init)(void)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v
uint8_t minor_product_version
uint8_t major_product_version