PN532 driver for ESP-IDF which works through HSU
Your Name 55dcf75598 typo fix | %!s(int64=2) %!d(string=hai) anos | |
---|---|---|
components | %!s(int64=2) %!d(string=hai) anos | |
main | %!s(int64=2) %!d(string=hai) anos | |
CMakeLists.txt | %!s(int64=2) %!d(string=hai) anos | |
LICENSE | %!s(int64=2) %!d(string=hai) anos | |
README.md | %!s(int64=2) %!d(string=hai) anos |
It is a simple driver for esp-idf with PN532
support which works through HSU.
It has nothing except initialization and passive ID
reads.
Anyways:
It is simple, you should specify uart port and pins using menuconfig
.
The device must be initialized using
int pn532_init()
Then it could be possible to read values like this:
while (1) {
if ((len = pn532_read(buf, 64)) != ESP_FAIL) {
len = pn532_decode_card(buf, len, card);
printf("Card Detected: ");
printbuf(card, len);
puts("");
vTaskDelay(500 / portTICK_PERIOD_MS);
}
vTaskDelay(100 / portTICK_PERIOD_MS);
}
The pn532_decode_card()
is an improvisation which is intended to cut id values
using packet provided length. There's no magic.
See main.c for a complete example.
GPLv2