{"id":15145203,"url":"https://github.com/libdriver/ntag21x","last_synced_at":"2026-01-25T18:13:53.319Z","repository":{"id":40699366,"uuid":"496503954","full_name":"libdriver/ntag21x","owner":"libdriver","description":"NTAG21X(NTAG213, NTAG215, NTAG216) full-featured driver library for general-purpose MCU and Linux.","archived":false,"fork":false,"pushed_at":"2025-04-17T17:30:34.000Z","size":3852,"stargazers_count":37,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-23T22:35:09.261Z","etag":null,"topics":["c","full-featured-driver","linux","mcu","ntag213","ntag215","ntag216","rf"],"latest_commit_sha":null,"homepage":"https://www.libdriver.com","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libdriver.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-26T06:16:44.000Z","updated_at":"2025-09-28T03:09:28.000Z","dependencies_parsed_at":"2022-07-12T18:03:03.482Z","dependency_job_id":"786ca4ca-a3e4-4485-bd96-bc5f0b640ea5","html_url":"https://github.com/libdriver/ntag21x","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.3793103448275862,"last_synced_commit":"1293eb6a2a4d9972a74ff74341a2a4d0348521e7"},"previous_names":["libdriver/ntag21x","hepingood/ntag21x"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/libdriver/ntag21x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fntag21x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fntag21x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fntag21x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fntag21x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libdriver","download_url":"https://codeload.github.com/libdriver/ntag21x/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fntag21x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28756433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","full-featured-driver","linux","mcu","ntag213","ntag215","ntag216","rf"],"created_at":"2024-09-26T11:21:01.133Z","updated_at":"2026-01-25T18:13:53.307Z","avatar_url":"https://github.com/libdriver.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[English](/README.md) | [ 简体中文](/README_zh-Hans.md) | [繁體中文](/README_zh-Hant.md) | [日本語](/README_ja.md) | [Deutsch](/README_de.md) | [한국어](/README_ko.md)\n\n\u003cdiv align=center\u003e\n\u003cimg src=\"/doc/image/logo.svg\" width=\"400\" height=\"150\"/\u003e\n\u003c/div\u003e\n\n## LibDriver NTAG21X\n\n[![MISRA](https://img.shields.io/badge/misra-compliant-brightgreen.svg)](/misra/README.md) [![API](https://img.shields.io/badge/api-reference-blue.svg)](https://www.libdriver.com/docs/ntag21x/index.html) [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](/LICENSE)\n\nNTAG 213, NTAG 215, and NTAG 216 have been developed by NXP® Semiconductors as standard NFC tag ICs to be used in mass-market applications such as retail, gaming, and consumer electronics, in combination with NFC devices or NFC-compliant Proximity Coupling Devices. NTAG 213, NTAG 215, and NTAG 216 (from now on, generally called NTAG 21x) are designed to fully comply to NFC Forum Type 2 Tag and ISO/IEC14443 Type A specifications.Target applications include Out-of-Home and print media smart advertisement, SoLoMo applications, product authentication, NFC shelf labels, and mobile companion tags.Target use cases include Out-of-Home smart advertisement, product authentication, mobile companion tags, Bluetooth® or Wi-Fi pairing, electronic shelf labels, and business cards. NTAG 21x memory can also be segmented to implement multiple applications at the same time.Thanks to the high input capacitance, NTAG 21x tag ICs are particularly tailored for applications requiring small footprints, without compromise on performance. Small NFC tags can be more easily embedded into, e.g., product labels or electronic devices.The mechanical and electrical specifications of NTAG 21x are tailored to meet the requirements of inlay and tag manufacturers.\n\nLibDriver NTAG21X is a full-featured driver for NTAG21X, launched by LibDriver.It provides page reading, page writing and additional features. LibDriver is MISRA compliant.\n\nThis repository includes submodule and you shold add \"--recursive\" to clone the whole project.\n\n```shell\ngit clone https://github.com/libdriver/ntag21x.git --recursive\n```\n\n### Table of Contents\n\n  - [Instruction](#Instruction)\n  - [Install](#Install)\n  - [Usage](#Usage)\n    - [example basic](#example-basic)\n  - [Document](#Document)\n  - [Contributing](#Contributing)\n  - [License](#License)\n  - [Contact Us](#Contact-Us)\n\n### Instruction\n\n/src includes LibDriver NTAG21X source files.\n\n/interface includes LibDriver NTAG21X RF platform independent template.\n\n/test includes LibDriver NTAG21X driver test code and this code can test the chip necessary function simply.\n\n/example includes LibDriver NTAG21X sample code.\n\n/doc includes LibDriver NTAG21X offline document.\n\n/datasheet includes NTAG21X datasheet.\n\n/project includes the common Linux and MCU development board sample code. All projects use the shell script to debug the driver and the detail instruction can be found in each project's README.md.\n\n/misra includes the LibDriver MISRA code scanning results.\n\n### Install\n\nReference /interface RF platform independent template and finish your platform RF driver.\n\nAdd the /src directory, the interface driver for your platform, and your own drivers to your project, if you want to use the default example drivers, add the /example directory to your project.\n\n### Usage\n\nYou can refer to the examples in the /example directory to complete your own driver. If you want to use the default programming examples, here's how to use them.\n\n#### example basic\n\n```C\n#include \"driver_ntag21x_basic.h\"\n\nuint8_t res;\nuint8_t i;\nuint8_t id[8];\nntag21x_capability_container_t type;\nntag21x_version_t version;\nuint32_t cnt;\nuint8_t signature[32];\nuint8_t number[7];\nuint8_t data[16];\nuint16_t len;\nuint8_t pwd[4];\nuint8_t pack[2];\n\n/* init */\nres = ntag21x_basic_init();\nif (res != 0)\n{\n    return 1;\n}\n\n/* search */\nres = ntag21x_basic_search(\u0026type, id, 50);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\n\n/* ouput the type */\nif (type == NTAG21X_CAPABILITY_CONTAINER_144_BYTE_NTAG213)\n{\n    ntag21x_interface_debug_print(\"ntag21x: find ntag213 card.\\n\");\n}\nelse if (type == NTAG21X_CAPABILITY_CONTAINER_496_BYTE_NTAG215)\n{\n    ntag21x_interface_debug_print(\"ntag21x: find ntag215 card.\\n\");\n}\nelse if (type == NTAG21X_CAPABILITY_CONTAINER_872_BYTE_NTAG216)\n{\n    ntag21x_interface_debug_print(\"ntag21x: find ntag216 card.\\n\");\n}\nelse\n{\n    ntag21x_interface_debug_print(\"ntag21x: invalid type.\\n\");\n}\nntag21x_interface_debug_print(\"ntag21x: id is \");\nfor (i = 0; i \u003c 8; i++)\n{\n    ntag21x_interface_debug_print(\"0x%02X \", id[i]);\n}\nntag21x_interface_debug_print(\"\\n\");\n\n...\n    \n/* get the version */\nres = ntag21x_basic_get_version(\u0026version);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\nntag21x_interface_debug_print(\"ntag21x: fixed_header is 0x%02X\\n\", version.fixed_header);\nntag21x_interface_debug_print(\"ntag21x: vendor_id is 0x%02X\\n\", version.vendor_id);\nntag21x_interface_debug_print(\"ntag21x: product_type is 0x%02X\\n\", version.product_type);\nntag21x_interface_debug_print(\"ntag21x: product_subtype is 0x%02X\\n\", version.product_subtype);\nntag21x_interface_debug_print(\"ntag21x: major_product_version is 0x%02X\\n\", version.major_product_version);\nntag21x_interface_debug_print(\"ntag21x: minor_product_version is 0x%02X\\n\", version.minor_product_version);\nntag21x_interface_debug_print(\"ntag21x: storage_size is 0x%02X\\n\", version.storage_size);\nntag21x_interface_debug_print(\"ntag21x: protocol_type is 0x%02X\\n\", version.protocol_type);\n\n...\n\n/* read the counter */\nres = ntag21x_basic_read_counter(\u0026cnt);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\nntag21x_interface_debug_print(\"read counter %d.\\n\", cnt);\n\n...\n\n/* read the signature */\nres = ntag21x_basic_read_signature(signature);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\nntag21x_interface_debug_print(\"ntag21x: signature is \");\nfor (i = 0; i \u003c 32; i++)\n{\n    ntag21x_interface_debug_print(\"0x%02X \", signature[i]);\n}\nntag21x_interface_debug_print(\"\\n\");\n\n...\n\n/* get the serial number */\nres = ntag21x_basic_get_serial_number(number);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\nntag21x_interface_debug_print(\"ntag21x: serial number is \");\nfor (i = 0; i \u003c 7; i++)\n{\n    ntag21x_interface_debug_print(\"0x%02X \", id[i]);\n}\nntag21x_interface_debug_print(\"\\n\");\n\n...\n\n/* read data */\nres = ntag21x_basic_read(0, data);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\nntag21x_interface_debug_print(\"ntag21x: read page %d: \", 0);\nfor (i = 0; i \u003c 4; i++)\n{\n    ntag21x_interface_debug_print(\"0x%02X \", data[i]);\n}\nntag21x_interface_debug_print(\"\\n\");\n\n...\n\n/* write data */\nres = ntag21x_basic_write(20, data);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\nntag21x_interface_debug_print(\"ntag21x: write page %d: \", 20);\nfor (i = 0; i \u003c 4; i++)\n{\n    ntag21x_interface_debug_print(\"0x%02X \", data[i]);\n}\nntag21x_interface_debug_print(\"\\n\");\n\n...\n    \n/* read data */\nres = ntag21x_basic_read_four_pages(0, data);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\nntag21x_interface_debug_print(\"ntag21x: read page %d: \", 0);\nfor (i = 0; i \u003c 16; i++)\n{\n    ntag21x_interface_debug_print(\"0x%02X \", data[i]);\n}\nntag21x_interface_debug_print(\"\\n\");\n\n...\n\n/* read pages */\nlen = 16;\nres = ntag21x_basic_read_pages(0, 0, data, \u0026len);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\nntag21x_interface_debug_print(\"ntag21x: read pages %d - %d: \", 0, 0);\nfor (i = 0; i \u003c len; i++)\n{\n    ntag21x_interface_debug_print(\"0x%02X \", data[i]);\n}\nntag21x_interface_debug_print(\"\\n\");\n\n...\n\n/* authenticate */\nres = ntag21x_basic_authenticate(pwd, pack);\nif (res != 0)\n{\n    (void)ntag21x_basic_deinit();\n\n    return 1;\n}\n\n...\n    \n(void)ntag21x_basic_deinit();\n\nreturn 0;\n```\n\n### Document\n\nOnline documents: [https://www.libdriver.com/docs/ntag21x/index.html](https://www.libdriver.com/docs/ntag21x/index.html).\n\nOffline documents: /doc/html/index.html.\n\n### Contributing\n\nPlease refer to CONTRIBUTING.md.\n\n### License\n\nCopyright (c) 2015 - present LibDriver All rights reserved\n\n\n\nThe MIT License (MIT) \n\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n\nof this software and associated documentation files (the \"Software\"), to deal\n\nin the Software without restriction, including without limitation the rights\n\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\ncopies of the Software, and to permit persons to whom the Software is\n\nfurnished to do so, subject to the following conditions: \n\n\n\nThe above copyright notice and this permission notice shall be included in all\n\ncopies or substantial portions of the Software. \n\n\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\nSOFTWARE. \n\n### Contact Us\n\nPlease send an e-mail to lishifenging@outlook.com.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibdriver%2Fntag21x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibdriver%2Fntag21x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibdriver%2Fntag21x/lists"}