I want to use Grade HSPI
instead of Grade VSPI
and I don't know how to
do it. I did a bit of
searching but I couldn't
find anything.
#include <SPI.h>
#include <MFRC522.h>
#define RST_PIN 4 // Configurable, see typical pin layout above
#define SS_PIN 2 // Configurable, see typical pin layout above
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
//*****************************************************************************************//
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println("Read personal data on a MIFARE PICC:"); //shows in serial that it is ready to read
}
//*****************************************************************************************//
void loop() {
if ( mfrc522.PICC_IsNewCardPresent()) {
if ( mfrc522.PICC_ReadCardSerial()) {
Serial.println(F("**tag:**"));
for (byte i = 0; i < mfrc522.uid.size; i++){
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i],HEX);
}
Serial.println();
mfrc522.PICC_HaltA();
}
}
}
The object that will be using HSVI will need to be able to accept the SPI ref object to be used as a startup parameter.
Also, the SPI device must not put any data or cause a state change on the ESP32 GPIO13 (HSVPI MOSI), which is also known as the TCK pin, during program upload.