#include // tcp API #include #include #include #include // One of them is to be declared in the main sketch // and passed to ethInitDHCP() or ethInitStatic(): // Wiznet5500lwIP eth(CSPIN); // Wiznet5100lwIP eth(CSPIN); // ENC28J60lwIP eth(CSPIN); void SPI4EthInit(); template bool ethInitDHCP(EthImpl& eth) { SPI4EthInit(); if (!eth.begin()) { // hardware not responding DEBUGV("ethInitDHCP: hardware not responding\n"); return false; } return true; } template bool ethInitStatic(EthImpl& eth, IPAddress IP, IPAddress gateway, IPAddress netmask, IPAddress dns1, IPAddress dns2 = IPADDR_NONE) { SPI4EthInit(); if (!eth.config(IP, gateway, netmask, dns1, dns2)) { // invalid arguments DEBUGV("ethInitStatic: invalid arguments\n"); return false; } if (!eth.begin()) { // hardware not responding DEBUGV("ethInitStatic: hardware not responding\n"); return false; } return true; }