Added a new constructor for changing the selected SPI port and changed all of the SPI class acesses to an SPIClass pointer.
Increased compatibility with other devices that has multiple SPI ports (Such as ESP32 or STM32 boards)
Example usage:MFRC522 mfrc522(SS_PIN, RST_PIN, SPI); //Works the same as: MFRC522 mfrc522(SS_PIN, RST_PIN)
or
MFRC522 mfrc522(SS_PIN, RST_PIN, SPI2); //Given that you created another SPIClass named SPI2
Note:
You can still use it as before, like;
MFRC522 mfrc522(SS_PIN, RST_PIN);
or
MFRC522 mfrc522(RST_PIN);
Tested on Arduino UNO and STM32F103RB, works without a problem.
Added a new constructor for changing the selected SPI port and changed all of the SPI class acesses to an SPIClass pointer. Increased compatibility with other devices that has multiple SPI ports (Such as ESP32 or STM32 boards)
Example usage:
MFRC522 mfrc522(SS_PIN, RST_PIN, SPI); //Works the same as: MFRC522 mfrc522(SS_PIN, RST_PIN)
orMFRC522 mfrc522(SS_PIN, RST_PIN, SPI2); //Given that you created another SPIClass named SPI2
Note: You can still use it as before, like;
MFRC522 mfrc522(SS_PIN, RST_PIN);
orMFRC522 mfrc522(RST_PIN);
Tested on Arduino UNO and STM32F103RB, works without a problem.