Merge pull request #215 from Rotzbua/master

Add note for compatible ide
This commit is contained in:
Rotzbua
2016-08-26 00:39:23 +02:00
committed by GitHub
4 changed files with 66 additions and 13 deletions

5
.gitignore vendored
View File

@@ -1 +1,6 @@
MFRC522.zip MFRC522.zip
# ignore IDE files
.idea
cmake
CMakeLists.txt

View File

@@ -32,7 +32,8 @@ script:
# short the string comparison # short the string comparison
- stringContain() { [ -z "${2##*$1*}" ]; } - stringContain() { [ -z "${2##*$1*}" ]; }
# selectable board tests @Rotzbua # selectable board tests @Rotzbua
- board="arduino_avr"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=uno --board=megaatmega1280; else echo "skip board test of $board"; fi # prints only warnings and errors, to show all remove "1>/dev/null"
- board="arduino_arm"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=due --board=zero; else echo "skip board test of $board"; fi - board="arduino_avr"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=uno --board=megaatmega1280 1>/dev/null; else echo "skip board test of $board"; fi
- board="teensy"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=teensy31; else echo "skip board test of $board"; fi - board="arduino_arm"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=due --board=zero 1>/dev/null; else echo "skip board test of $board"; fi
- board="esp"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=d1_mini; else echo "skip board test of $board"; fi - board="teensy"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=teensy20 --board=teensy31 1>/dev/null; else echo "skip board test of $board"; fi
- board="esp"; if stringContain "$board" "$TESTBOARD"; then echo "check board $board"; platformio ci --lib=. --board=d1_mini 1>/dev/null; else echo "skip board test of $board"; fi

View File

@@ -12,6 +12,46 @@ Interface (SPI) interface.
Set the UID, write to sector 0, and unbrick Chinese UID changeable MIFARE cards. Set the UID, write to sector 0, and unbrick Chinese UID changeable MIFARE cards.
.. _development:
Development
----------
**The development by owner miguelbalboa has ended**. Further development will be done by community. This library is still maintained by miguelbalboa, so make pull request if you like some new features or fixes. Support/issues should be solved by community.
.. _what works and not:
What works and not?
----------
* **Works**
#. Communication (Crypto1) with MIFARE Classic (1k, 4k, Mini).
#. Communication (Crypto1) with MIFARE Classic compatible PICCs.
#. Firmware self check of MFRC522.
* **Partial**
#. Communication with MIFARE Ultralight.
* **Works not**
#. MIFARE DESFire, MIFARE DESFire EV1/EV2, not supported by software.
#. Communication with DES3 or AES, not supported by software.
#. Peer-to-peer (ISO/IEC 18092), not `supported by hardware`_.
#. Communication with smart phone, not `supported by hardware`_.
#. Card emulation, not `supported by hardware`_.
* **Need more?**
#. If software: code it and make a pull request.
#. If hardware: buy a more expensive like PN532 (supports NFC and many more, but costs about $15)
.. _compatible ide:
Compatible IDE
----------
This library works with Arduino IDE 1.6, older versions are **not supported** and will cause compile errors. The built-in library manager is supported.
If you use your own compiler, you have to enable ``c++11``-support.
.. _compatible boards: .. _compatible boards:
Compatible boards Compatible boards
@@ -19,6 +59,8 @@ Compatible boards
This library is compatible to Teensy and ESP8266, but not all examples are available for every board. Also you have to change pins, see `pin layout`_. This library is compatible to Teensy and ESP8266, but not all examples are available for every board. Also you have to change pins, see `pin layout`_.
Note that the main target/support of library is still Arduino.
.. _pin layout: .. _pin layout:
Pin Layout Pin Layout
@@ -202,3 +244,4 @@ It has been extended with functionality to alter sector 0 on Chinese UID changea
.. _iso/iec 14443-3\:2011 part 3: .. _iso/iec 14443-3\:2011 part 3:
.. _nxp mfrc522: http://www.nxp.com/documents/data_sheet/MFRC522.pdf .. _nxp mfrc522: http://www.nxp.com/documents/data_sheet/MFRC522.pdf
.. _broken: http://eprint.iacr.org/2008/166 .. _broken: http://eprint.iacr.org/2008/166
.. _supported by hardware: https://web.archive.org/web/20151210045625/http://www.nxp.com/documents/leaflet/939775017564.pdf

View File

@@ -20,8 +20,8 @@
* Signal Pin Pin Pin Pin Pin Pin * Signal Pin Pin Pin Pin Pin Pin
* ----------------------------------------------------------------------------------------- * -----------------------------------------------------------------------------------------
* RST/Reset RST 9 5 D9 RESET/ICSP-5 RST * RST/Reset RST 9 5 D9 RESET/ICSP-5 RST
* SPI SS 1 SDA(SS) 10 53 D10 10 10 * SPI SS 1 SDA(SS) ** custom, take a unused pin, only HIGH/LOW required **
* SPI SS 2 SDA(SS) 2 53 D10 10 10 * SPI SS 2 SDA(SS) ** custom, take a unused pin, only HIGH/LOW required **
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16 * SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14 * SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15 * SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
@@ -31,9 +31,9 @@
#include <SPI.h> #include <SPI.h>
#include <MFRC522.h> #include <MFRC522.h>
#define RST_PIN 10 // Configurable, see typical pin layout above #define RST_PIN 9 // Configurable, see typical pin layout above
#define SS_1_PIN 5 // Configurable, see typical pin layout above #define SS_1_PIN 10 // Configurable, take a unused pin, only HIGH/LOW required, must be diffrent to SS 2
#define SS_2_PIN 3 // Configurable, see typical pin layout above #define SS_2_PIN 8 // Configurable, take a unused pin, only HIGH/LOW required, must be diffrent to SS 1
#define NR_OF_READERS 2 #define NR_OF_READERS 2
@@ -46,13 +46,17 @@ MFRC522 mfrc522[NR_OF_READERS]; // Create MFRC522 instance.
*/ */
void setup() { void setup() {
Serial.begin(115200); // Initialize serial communications with the PC Serial.begin(9600); // Initialize serial communications with the PC
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4) while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
SPI.begin(); // Init SPI bus SPI.begin(); // Init SPI bus
for (uint8_t reader = 0; reader < NR_OF_READERS; reader++) { for (uint8_t reader = 0; reader < NR_OF_READERS; reader++) {
mfrc522[reader].PCD_Init(ssPins[reader], RST_PIN); // Init each MFRC522 card mfrc522[reader].PCD_Init(ssPins[reader], RST_PIN); // Init each MFRC522 card
Serial.print(F("Reader "));
Serial.print(reader);
Serial.print(F(": "));
mfrc522[reader].PCD_DumpVersionToSerial();
} }
} }
@@ -61,14 +65,14 @@ void setup() {
*/ */
void loop() { void loop() {
for (uint8_t reader = 0; reader < NR_OF_READERS; reader++) { for (uint8_t reader = 0; reader < NR_OF_READERS; reader++) {
// Look for new cards // Look for new cards
if (mfrc522[reader].PICC_IsNewCardPresent() && mfrc522[reader].PICC_ReadCardSerial()) { if (mfrc522[reader].PICC_IsNewCardPresent() && mfrc522[reader].PICC_ReadCardSerial()) {
Serial.print(F("Reader: ")); Serial.print(F("Reader "));
Serial.print(reader); Serial.print(reader);
// Show some details of the PICC (that is: the tag/card) // Show some details of the PICC (that is: the tag/card)
Serial.print(F(" Card UID:")); Serial.print(F(": Card UID:"));
dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size); dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size);
Serial.println(); Serial.println();
Serial.print(F("PICC type: ")); Serial.print(F("PICC type: "));