1919#include < WiFiNINA.h>
2020#include < FlashStorage.h>
2121
22+ #ifdef ARDUINO_SAMD_MKRVIDOR4000
23+ #include < VidorPeripherals.h>
24+ #endif /* ARDUINO_SAMD_MKRVIDOR4000 */
25+
26+ #ifdef ARDUINO_SAMD_MKRVIDOR4000
27+ #define NINA_GPIO0 FPGA_NINA_GPIO0
28+ #define NINA_RESETN FPGA_SPIWIFI_RESET
29+ #endif /* ARDUINO_SAMD_MKRVIDOR4000 */
30+
2231#define SDU_START 0x2000
2332#define SDU_SIZE 0x4000
2433
@@ -38,13 +47,20 @@ int main() {
3847
3948 delay (1 );
4049
41- // NINA - SPI boot
42- pinMode (NINA_GPIO0, OUTPUT);
43- digitalWrite (NINA_GPIO0, HIGH);
44-
45- // disable NINA
46- pinMode (NINA_RESETN, OUTPUT);
50+ #if defined(ARDUINO_SAMD_MKRVIDOR4000)
51+ FPGA.begin ();
52+ /* NINA select SPI mode and enable (by setting RESETN = '1') */
53+ FPGA.pinMode (NINA_GPIO0, OUTPUT);
54+ FPGA.digitalWrite (NINA_GPIO0, HIGH);
55+ FPGA.pinMode (NINA_RESETN, OUTPUT);
56+ FPGA.digitalWrite (NINA_RESETN, HIGH);
57+ #elif defined(ARDUINO_SAMD_MKRWIFI1010)
58+ /* NINA select SPI mode and enable (by setting RESETN = '1') */
59+ pinMode (NINA_GPIO0, OUTPUT);
60+ digitalWrite (NINA_GPIO0, HIGH);
61+ pinMode (NINA_RESETN, OUTPUT);
4762 digitalWrite (NINA_RESETN, HIGH);
63+ #endif
4864
4965 if (WiFi.status () == WL_NO_SHIELD) {
5066 goto boot;
0 commit comments