SPI.h compilation errors / RFID reader

Hi all,

I would like to use a Velleman VMA211 RFID reader together with an Arduino system. As I want to upload RFID scan actions to an online server I thought it would be handy to use an Arduino WiFi Rev 2 board as it has onboard WiFi so I can connect to a local WiFi network and upload the RFID data.

Unfortunately after reading the tutorial at the Velleman and using the two header files from their website (SPI.h and PN532.h), I get errors in the header files. The RFID shield works (compiles) fine when selecting the Arduino Uno instead of the Arduino Uno Wifi Rev2 board.

I found out the microcontroller differs between both models:

"while the common UNO uses an ATmega328P, the Wifi Rev 2 uses a ATmega4809 which is quite a different chip. The SPI registers are different, so any code referring directly to ATmega328P SPI registers won't compile for ATmega4809." (source: Adafruit customer service forums • View topic - ILI9341 sketch generates compile errors)

I managed to get the RDIF shield working with my Uno, but I keep getting compiler errors in both header files when compiling for the Wifi version.

Any ideas how to solve this problem?