This is a (relatively) proper implementation of enc28j60 driver for LWIP on ESP8266.
Both receive and transmit works properly now, but it hasn't been tested much yet. Code needs some major refactoring.
- Copy or symlink
driver/espenc.c
,driver/espenc.h
,driver/spi.c
,driver/spi_register.h
anddriver/spi.h
somewhere to your project. - Add
espenc_init()
in youruser_init()
- Connect ENC28J60 to ESP's SPI, connect INT pin to GPIO5 (or change it for
anything you like in
driver/spi.h
. - PROFIT.
- Move any framework specific code to separate headers
- Port & test on esp8266-arduino
- Port & test on Sming
- Check latency (70ms?!)
- Make it a little bit more stable
- Support for hardware RESET
- Does not work when wifi mode is set to
NULL_MODE
As enc28j60 handling code is mostly based on Ethercard, this shall be GPLv2.