miguelbalboa / rfid

Arduino RFID Library for MFRC522
The Unlicense
2.75k stars 1.43k forks source link

Allow use of any pins by implementing Soft SPI #499

Closed ricardojlrufino closed 4 years ago

ricardojlrufino commented 4 years ago
Q A
Bug fix? no
New feature? yes
Doc update? yes
BC yes
Deprecations? no
Fixed tickets #...

This change allows the use of any pin by implementing communication via software.

Due to the poor design of the SPI class, the only way I could do this integration was by creating a new define (MFRC522_SOFTSPI), which needs to be enabled in the file: MFRC522.h

I added a new example that demonstrates the use: DumpInfo_SoftSPI

Tests:

Q A
DumpInfo yes
rfid_write_personal_data yes
rfid_read_personal_data yes

This enables direct stacking of NANO and PRO MICRO arduinos, as in the example:

Seleção_047

ricardojlrufino commented 4 years ago

This can be merged ?

Rotzbua commented 4 years ago

A software based SPI should be an extra library and not a part of a rfid library. Injectable SPI is available at the fork.