PN532 driver for ESP-IDF which works through HSU

Your Name 55dcf75598 typo fix 2 years ago
components f69b25e9db initial commit 2 years ago
main f69b25e9db initial commit 2 years ago
CMakeLists.txt f69b25e9db initial commit 2 years ago
LICENSE f69b25e9db initial commit 2 years ago
README.md 55dcf75598 typo fix 2 years ago

README.md

PN532-HSU ESP-IDF Component

It is a simple driver for esp-idf with PN532 support which works through HSU.

Features

It has nothing except initialization and passive ID reads. Anyways:

  • It is an UART device which takes only 2 pins
  • Passive mode for ids reading.

Configuration

It is simple, you should specify uart port and pins using menuconfig.

Usage

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.

License

GPLv2