19
19
#include < WiFiNINA.h>
20
20
#include < FlashStorage.h>
21
21
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
+
22
31
#define SDU_START 0x2000
23
32
#define SDU_SIZE 0x4000
24
33
@@ -38,13 +47,20 @@ int main() {
38
47
39
48
delay (1 );
40
49
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);
47
62
digitalWrite (NINA_RESETN, HIGH);
63
+ #endif
48
64
49
65
if (WiFi.status () == WL_NO_SHIELD) {
50
66
goto boot;
0 commit comments