Arduino Event driven Ethernet library for W5100

components
Hardware Components
Software Apps and online services
Event driven Ethernet library
initial release
Project Description
This library is to facilitate your usage of W5100S-EVB-Pico board with the onboard Wiznet W5100S chip, using [**Arduino-mbed RP2040** core](https://github.com/arduino/ArduinoCore-mbed)
In case you are looking for an event driven approach of receiving Ethernet data/status, rather than the traditional polling method, this library may be one of choices for you.
Events to be dispatched to: void (*EthernetEventCallback)(uint8_t ir, uint8_t ir2, uint8_t slir);
1. Interrupt Register (IR)
     EthernetEventApi::Ir::CONFLICT
     EthernetEventApi::Ir::UNREACH
     EthernetEventApi::Ir::PPPTERM
   note: NO Sn_INT events in EthernetEventCallback. User should use Sn_IR in SocketEventCallback
2. Interrupt Register 2 (IR2)
     EthernetEventApi::Ir2::WOL
3. SOCKET-less Interrupt Register (SLIR)
     EthernetEventApi::Slir::TIMEOUT
     EthernetEventApi::Slir::ARP
     EthernetEventApi::Slir::PING
Events to be dispatched to: void (*SocketEventCallback)(uint8_t sn_ir);
1. SOCKET n Interrupt Register (Sn_IR)
    SnIR::SEND_OK
    SnIR::TIMEOUT
    SnIR::RECV
    SnIR::DISCON
    SnIR::CON
### User's Code comparison:
#### Using [EventEthernet](https://github.com/teamprof/arduino-eventethernet)
############################################################################
#include <EventEthernet.h>
void setup() {
  Ethernet.init(17, 21); // W5100S-EVB-Pico: nCS pin = GPIO17, Intn pin = GPIO21
  while (Ethernet.begin(mac, ir, ir2, slir, onEthernetEvent) == 0)
  {
    LOG_DEBUG("Failed to configure Ethernet using DHCP");
    delay(1000);
  }
}
############################################################################
#### Using original [WIZnet-ArduinoEthernet](https://github.com/WIZnet-ArduinoEthernet/Ethernet)
############################################################################
#include <Ethernet.h>
//#include <EventEthernet.h> // note: you can use EventEthernet lib on existing code with polling method
void setup() {
  Ethernet.init(17); // W5100S-EVB-Pico: nCS pin = GPIO17
  while (Ethernet.begin(mac) == 0)
  {
    LOG_DEBUG("Failed to configure Ethernet using DHCP");
    delay(1000);
  }
}
documents
Code
Event Driver Ethernet library
initial release
Event Driver Ethernet library zip file
initial release
Others
screenshot-arduino-ide
screenshot on arduino ide
screenshot-terminals
screenshot on linux terminals

1
COMMENTS

Please Login to comment
1 Comment authors
ronpang Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
ronpang
Member

Hi teamprof,
I’m Ron from WIZnet HK. Could I post your article to our WIZnet HK instagram account?

BTW, do you have a instagram account that I could tag you?

Best Regards,
Ron