|
14 | 14 |
|
15 | 15 | // Debug Level from 0 to 4
|
16 | 16 | #define _ETHERNET_WEBSERVER_LOGLEVEL_ 3
|
17 |
| -#define _TZ_LOGLEVEL_ 1 |
| 17 | +#define _TZ_LOGLEVEL_ 2 |
18 | 18 |
|
19 | 19 | #if ( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) )
|
20 | 20 |
|
|
227 | 227 | #if defined(ARDUINO_TEENSY41)
|
228 | 228 | #define BOARD_TYPE "TEENSY 4.1"
|
229 | 229 | // Use true for NativeEthernet Library, false if using other Ethernet libraries
|
230 |
| - #define USE_NATIVE_ETHERNET true |
| 230 | + #define USE_QN_ETHERNET true |
| 231 | + #define USE_NATIVE_ETHERNET false |
231 | 232 | #elif defined(ARDUINO_TEENSY40)
|
232 | 233 | #define BOARD_TYPE "TEENSY 4.0"
|
233 | 234 | #else
|
|
319 | 320 |
|
320 | 321 | #include <SPI.h>
|
321 | 322 |
|
322 |
| -//#define USE_ETHERNET_WRAPPER true |
323 |
| -#define USE_ETHERNET_WRAPPER false |
324 |
| - |
325 | 323 | // Use true for ENC28J60 and UIPEthernet library (https://github.com/UIPEthernet/UIPEthernet)
|
326 | 324 | // Use false for W5x00 and Ethernetx library (https://www.arduino.cc/en/Reference/Ethernet)
|
327 | 325 |
|
|
342 | 340 | #define USE_ETHERNET_ESP8266 false
|
343 | 341 | #define USE_ETHERNET_ENC false
|
344 | 342 | #define USE_CUSTOM_ETHERNET false
|
345 |
| - |
346 |
| - #if !USE_ETHERNET_WRAPPER |
347 |
| - |
348 |
| - #if ( USE_ETHERNET_GENERIC || USE_ETHERNET_ESP8266 || USE_ETHERNET_ENC || \ |
349 |
| - USE_NATIVE_ETHERNET || USE_ETHERNET_PORTENTA_H7 ) |
350 |
| - #ifdef USE_CUSTOM_ETHERNET |
351 |
| - #undef USE_CUSTOM_ETHERNET |
352 |
| - #endif |
353 |
| - #define USE_CUSTOM_ETHERNET false |
| 343 | + |
| 344 | + #if ( USE_ETHERNET_GENERIC || USE_ETHERNET_ESP8266 || USE_ETHERNET_ENC || \ |
| 345 | + USE_NATIVE_ETHERNET || USE_QN_ETHERNET || USE_ETHERNET_PORTENTA_H7 ) |
| 346 | + #ifdef USE_CUSTOM_ETHERNET |
| 347 | + #undef USE_CUSTOM_ETHERNET |
354 | 348 | #endif
|
| 349 | + #define USE_CUSTOM_ETHERNET false |
| 350 | + #endif |
355 | 351 |
|
356 |
| - #if USE_ETHERNET_PORTENTA_H7 |
357 |
| - #include <Portenta_Ethernet.h> |
358 |
| - #include <Ethernet.h> |
359 |
| - #warning Using Portenta_Ethernet lib for Portenta_H7. |
360 |
| - #define SHIELD_TYPE "Ethernet using Portenta_Ethernet Library" |
361 |
| - #elif USE_NATIVE_ETHERNET |
362 |
| - #include "NativeEthernet.h" |
363 |
| - #warning Using NativeEthernet lib for Teensy 4.1. Must also use Teensy Packages Patch or error |
364 |
| - #define SHIELD_TYPE "Custom Ethernet using Teensy 4.1 NativeEthernet Library" |
365 |
| - #elif USE_ETHERNET_GENERIC |
366 |
| - #if (ESP32) |
367 |
| - #include <soc/spi_pins.h> |
368 |
| - |
369 |
| - // Optional SPI2 |
370 |
| - #define USING_SPI2 true |
371 |
| - |
372 |
| - #if USING_SPI2 |
373 |
| - #define PIN_MISO HSPI_IOMUX_PIN_NUM_MISO |
374 |
| - #define PIN_MOSI HSPI_IOMUX_PIN_NUM_MOSI |
375 |
| - #define PIN_SCK HSPI_IOMUX_PIN_NUM_CLK |
376 |
| - #define PIN_SS HSPI_IOMUX_PIN_NUM_CS |
| 352 | + #if USE_ETHERNET_PORTENTA_H7 |
| 353 | + #include <Portenta_Ethernet.h> |
| 354 | + #include <Ethernet.h> |
| 355 | + #warning Using Portenta_Ethernet lib for Portenta_H7. |
| 356 | + #define SHIELD_TYPE "Ethernet using Portenta_Ethernet Library" |
| 357 | + #elif USE_QN_ETHERNET |
| 358 | + #include "QNEthernet.h" // https://github.com/ssilverman/QNEthernet |
| 359 | + using namespace qindesign::network; |
| 360 | + #warning Using QNEthernet lib for Teensy 4.1. Must also use Teensy Packages Patch or error |
| 361 | + #define SHIELD_TYPE "QNEthernet" |
| 362 | + #elif USE_NATIVE_ETHERNET |
| 363 | + #include "NativeEthernet.h" |
| 364 | + #warning Using NativeEthernet lib for Teensy 4.1. Must also use Teensy Packages Patch or error |
| 365 | + #define SHIELD_TYPE "NativeEthernet" |
| 366 | + #elif USE_ETHERNET_GENERIC |
| 367 | + #if (ESP32) |
| 368 | + #include <soc/spi_pins.h> |
377 | 369 |
|
378 |
| - #define SHIELD_TYPE "W5x00 using Ethernet_Generic Library on SPI2" |
379 |
| - |
380 |
| - #else |
381 |
| - |
382 |
| - #define PIN_MISO MISO |
383 |
| - #define PIN_MOSI MOSI |
384 |
| - #define PIN_SCK SCK |
385 |
| - #define PIN_SS SS |
| 370 | + // Optional SPI2 |
| 371 | + #define USING_SPI2 true |
| 372 | + |
| 373 | + #if USING_SPI2 |
| 374 | + #define PIN_MISO HSPI_IOMUX_PIN_NUM_MISO |
| 375 | + #define PIN_MOSI HSPI_IOMUX_PIN_NUM_MOSI |
| 376 | + #define PIN_SCK HSPI_IOMUX_PIN_NUM_CLK |
| 377 | + #define PIN_SS HSPI_IOMUX_PIN_NUM_CS |
| 378 | + |
| 379 | + #define SHIELD_TYPE "W5x00 using Ethernet_Generic Library on SPI2" |
386 | 380 |
|
387 |
| - #define SHIELD_TYPE "W5x00 using Ethernet_Generic Library on SPI" |
388 |
| - |
389 |
| - #endif |
390 |
| - |
391 | 381 | #else
|
392 |
| - #define SHIELD_TYPE "W5x00 using Ethernet_Generic Library" |
| 382 | + |
| 383 | + #define PIN_MISO MISO |
| 384 | + #define PIN_MOSI MOSI |
| 385 | + #define PIN_SCK SCK |
| 386 | + #define PIN_SS SS |
| 387 | + |
| 388 | + #define SHIELD_TYPE "W5x00 using Ethernet_Generic Library on SPI" |
| 389 | + |
393 | 390 | #endif
|
394 | 391 |
|
395 |
| - #define ETHERNET_LARGE_BUFFERS |
396 |
| - |
397 |
| - #define _ETG_LOGLEVEL_ 1 |
398 |
| - |
399 |
| - #include "Ethernet_Generic.h" |
400 |
| - #warning Using Ethernet_Generic lib |
401 |
| - |
402 |
| - #elif USE_ETHERNET_ESP8266 |
403 |
| - #include "Ethernet_ESP8266.h" |
404 |
| - #warning Using Ethernet_ESP8266 lib |
405 |
| - #define SHIELD_TYPE "W5x00 using Ethernet_ESP8266 Library" |
406 |
| - #elif USE_ETHERNET_ENC |
407 |
| - #include "EthernetENC.h" |
408 |
| - #warning Using EthernetENC lib |
409 |
| - #define SHIELD_TYPE "ENC28J60 using EthernetENC Library" |
410 |
| - #elif USE_CUSTOM_ETHERNET |
411 |
| - //#include "Ethernet_XYZ.h" |
412 |
| - #include "EthernetENC.h" |
413 |
| - #warning Using Custom Ethernet library. You must include a library and initialize. |
414 |
| - #define SHIELD_TYPE "Custom Ethernet using Ethernet_XYZ Library" |
415 | 392 | #else
|
416 |
| - #ifdef USE_ETHERNET_GENERIC |
417 |
| - #undef USE_ETHERNET_GENERIC |
418 |
| - #endif |
419 |
| - #define USE_ETHERNET_GENERIC true |
420 |
| - #include "Ethernet_Generic.h" |
421 |
| - #warning Using default Ethernet_Generic lib |
422 |
| - #define SHIELD_TYPE "W5x00 using default Ethernet_Generic Library" |
| 393 | + #define SHIELD_TYPE "W5x00 using Ethernet_Generic Library" |
423 | 394 | #endif
|
| 395 | + |
| 396 | + #define ETHERNET_LARGE_BUFFERS |
| 397 | + |
| 398 | + #define _ETG_LOGLEVEL_ 1 |
424 | 399 |
|
425 |
| - // Ethernet_Shield_W5200, EtherCard, EtherSia not supported |
426 |
| - // Select just 1 of the following #include if uncomment #define USE_CUSTOM_ETHERNET |
427 |
| - // Otherwise, standard Ethernet library will be used for W5x00 |
| 400 | + #include "Ethernet_Generic.h" |
| 401 | + #warning Using Ethernet_Generic lib |
| 402 | + |
| 403 | + #elif USE_ETHERNET_ESP8266 |
| 404 | + #include "Ethernet_ESP8266.h" |
| 405 | + #warning Using Ethernet_ESP8266 lib |
| 406 | + #define SHIELD_TYPE "W5x00 using Ethernet_ESP8266 Library" |
| 407 | + #elif USE_ETHERNET_ENC |
| 408 | + #include "EthernetENC.h" |
| 409 | + #warning Using EthernetENC lib |
| 410 | + #define SHIELD_TYPE "ENC28J60 using EthernetENC Library" |
| 411 | + #elif USE_CUSTOM_ETHERNET |
| 412 | + //#include "Ethernet_XYZ.h" |
| 413 | + #include "EthernetENC.h" |
| 414 | + #warning Using Custom Ethernet library. You must include a library and initialize. |
| 415 | + #define SHIELD_TYPE "Custom Ethernet using Ethernet_XYZ Library" |
| 416 | + #else |
| 417 | + #ifdef USE_ETHERNET_GENERIC |
| 418 | + #undef USE_ETHERNET_GENERIC |
| 419 | + #endif |
| 420 | + #define USE_ETHERNET_GENERIC true |
| 421 | + #include "Ethernet_Generic.h" |
| 422 | + #warning Using default Ethernet_Generic lib |
| 423 | + #define SHIELD_TYPE "W5x00 using default Ethernet_Generic Library" |
| 424 | + #endif |
| 425 | + |
| 426 | + // Ethernet_Shield_W5200, EtherCard, EtherSia not supported |
| 427 | + // Select just 1 of the following #include if uncomment #define USE_CUSTOM_ETHERNET |
| 428 | + // Otherwise, standard Ethernet library will be used for W5x00 |
428 | 429 |
|
429 |
| - #endif // USE_ETHERNET_WRAPPER |
430 | 430 | #elif USE_UIP_ETHERNET
|
431 | 431 | #include "UIPEthernet.h"
|
432 | 432 | #warning Using UIPEthernet library
|
@@ -467,9 +467,11 @@ byte mac[][NUMBER_OF_MAC] =
|
467 | 467 | };
|
468 | 468 |
|
469 | 469 | // Select the IP address according to your local network
|
470 |
| -IPAddress ip(192, 168, 2, 222); |
| 470 | +IPAddress myIP(192, 168, 2, 222); |
| 471 | +IPAddress myNetmask(255, 255, 255, 0); |
| 472 | +IPAddress myGW(192, 168, 2, 1); |
471 | 473 |
|
472 | 474 | // Google DNS Server IP
|
473 |
| -IPAddress myDns(8, 8, 8, 8); |
| 475 | +IPAddress mydnsServer(8, 8, 8, 8); |
474 | 476 |
|
475 | 477 | #endif //defines_h
|
0 commit comments