This repository contains ESP-IDF library (component) for communication with RFID cards using MFRC522 reader.

Library takes care of polling the cards and managing the card lifecycle. It also fires events when a card is detected, removed, or when the card changes to any state described in ISO-14443. Additionally, it provides an API for reading and writing to card memory blocks.
To install latest version of this component to your project, run:
Bash
idf.py add-dependency "abobija/rc522"
Read more about esp-idf component manager in official documentation.
MIFARE 1K, MIFARE 4K, MIFARE MiniGET_VERSION, READ, FAST_READ, WRITE, READ_CNT,
READ_SIG, PWD_AUTHINCR_CNT, WRITE_SIG, LOCK_SIG, AUTHENTICATE,
COMPAT_WRITE, VCSLSPI and I2CSee examples for example projects.
Tip
To find more interesting examples (like memory_dump), go to examples folder.
To run basic example, create it as follows:
Bash
idf.py create-project-from-example "abobija/rc522:basic"
Then build and flash it as usual:
Bash
cd basic
idf.py build flash monitor
Pin layout is configurable by the user. To configure the GPIOs, check the #define statements in the basic example. If you are not using the RST pin, you can connect it to the 3.3V.
To run unit tests, go to test directory and set target to linux:
Bash
cd test
idf.py --preview set-target linux
Then build the project and run tests:
Bash
idf.py build && ./build/test.elf
| Term | Description |
|---|---|
| PCD | Proximity Coupling Device (the card reader). In our case this is MFRC522 module |
| PICC | Proximity Integrated Circuit Card (e.g: rfid card, tag, ...) |
This component is provided under Apache 2.0 license, see LICENSE file for details.
470a66e6ea4aca568a0caf6c69e3885e82b22c6f
idf.py add-dependency "abobija/rc522^3.3.2"