Ethernet_Generic Library now supporting custom SPI, such as SPI2, etc.

Working libraries, libraries being ported and related hardware
Post Reply
khoih-prog
Posts: 102
Joined: Thu Feb 27, 2020 7:54 am
Location: Toronto

Ethernet_Generic Library now supporting custom SPI, such as SPI2, etc.

Post by khoih-prog »

Ethernet_Generic Library

How To Install Using Arduino Library Manager


This Ethernet_Generic Library is a port and modification to merge, as many as possible, the features of the following libraries
- Ethernet Library
- EthernetLarge Library
- Ethernet2 Library
- Ethernet3 Library

for AVR, Portenta_H7, Teensy, SAM DUE, Arduino SAMD21, Adafruit SAMD21/SAMD51, Adafruit nRF52, ESP32/ESP8266, STM32, RP2040-based, etc. boards using Ethernet W5x00 shields.

The h-only library now supports SPI2, most of EthernetLarge, Ethernet2 and Ethernet3 features by simply changing definitions in the sketch.


Releases v2.0.0

1. Initial porting and coding to merge, as many as possible, the features of the following libraries :
- Ethernet Library
- EthernetLarge Library
- Ethernet2 Library
- Ethernet3 Library
2. Add support to ESP32 SPI2
3. Convert to h-only library
4. Add debug feature
5. Optimize code to reduce compiled binary size
6. Add Packages' Patches



Debug Terminal Output Sample


This is terminal debug output when running WebClientRepeating on STM32F7 NUCLEO_F767ZI with W5500 using Ethernet_Generic Library.

Code: Select all

Starting WebClientRepeating on NUCLEO_F767ZI with W5x00 using Ethernet_Generic Library
Ethernet_Generic v2.0.0
=========================
Currently Used SPI pinout:
MOSI:11
MISO:12
SCK:13
SS:10
=========================
Using mac index = 5
Connected! IP address: 192.168.2.94
Speed: 100 MB, Duplex: FULL DUPLEX, Link status: LINK

Connecting...
HTTP/1.1 200 OK
Server: nginx/1.4.2
Date: Fri, 01 Apr 2022 19:11:53 GMT
Content-Type: text/plain
Content-Length: 2317
Last-Modified: Thu, 24 Feb 2022 11:33:32 GMT
Connection: close
Vary: Accept-Encoding
ETag: "62176d0c-90d"
Accept-Ranges: bytes

Please use http://arduino.tips/asciilogo.txt via HTTP

           `:;;;,`                      .:;;:.           
        .;;;;;;;;;;;`                :;;;;;;;;;;:     TM 
      `;;;;;;;;;;;;;;;`            :;;;;;;;;;;;;;;;      
     :;;;;;;;;;;;;;;;;;;         `;;;;;;;;;;;;;;;;;;     
    ;;;;;;;;;;;;;;;;;;;;;       .;;;;;;;;;;;;;;;;;;;;    
   ;;;;;;;;:`   `;;;;;;;;;     ,;;;;;;;;.`   .;;;;;;;;   
  .;;;;;;,         :;;;;;;;   .;;;;;;;          ;;;;;;;  
  ;;;;;;             ;;;;;;;  ;;;;;;,            ;;;;;;. 
 ,;;;;;               ;;;;;;.;;;;;;`              ;;;;;; 
 ;;;;;.                ;;;;;;;;;;;`      ```       ;;;;;`
 ;;;;;                  ;;;;;;;;;,       ;;;       .;;;;;
`;;;;:                  `;;;;;;;;        ;;;        ;;;;;
,;;;;`    `,,,,,,,,      ;;;;;;;      .,,;;;,,,     ;;;;;
:;;;;`    .;;;;;;;;       ;;;;;,      :;;;;;;;;     ;;;;;
:;;;;`    .;;;;;;;;      `;;;;;;      :;;;;;;;;     ;;;;;
.;;;;.                   ;;;;;;;.        ;;;        ;;;;;
 ;;;;;                  ;;;;;;;;;        ;;;        ;;;;;
 ;;;;;                 .;;;;;;;;;;       ;;;       ;;;;;,
 ;;;;;;               `;;;;;;;;;;;;                ;;;;; 
 `;;;;;,             .;;;;;; ;;;;;;;              ;;;;;; 
  ;;;;;;:           :;;;;;;.  ;;;;;;;            ;;;;;;  
   ;;;;;;;`       .;;;;;;;,    ;;;;;;;;        ;;;;;;;:  
    ;;;;;;;;;:,:;;;;;;;;;:      ;;;;;;;;;;:,;;;;;;;;;;   
    `;;;;;;;;;;;;;;;;;;;.        ;;;;;;;;;;;;;;;;;;;;    
      ;;;;;;;;;;;;;;;;;           :;;;;;;;;;;;;;;;;:     
       ,;;;;;;;;;;;;;,              ;;;;;;;;;;;;;;       
         .;;;;;;;;;`                  ,;;;;;;;;:         
                                                         
                                                         
                                                         
                                                         
    ;;;   ;;;;;`  ;;;;:  .;;  ;; ,;;;;;, ;;. `;,  ;;;;   
    ;;;   ;;:;;;  ;;;;;; .;;  ;; ,;;;;;: ;;; `;, ;;;:;;  
   ,;:;   ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;,`;, ;;  ;;  
   ;; ;:  ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;;`;, ;;  ;;. 
   ;: ;;  ;;;;;:  ;;  ;; .;;  ;;   ,;,   ;;`;;;, ;;  ;;` 
  ,;;;;;  ;;`;;   ;;  ;; .;;  ;;   ,;,   ;; ;;;, ;;  ;;  
  ;;  ,;, ;; .;;  ;;;;;:  ;;;;;: ,;;;;;: ;;  ;;, ;;;;;;  
  ;;   ;; ;;  ;;` ;;;;.   `;;;:  ,;;;;;, ;;  ;;,  ;;;;   

Last edited by khoih-prog on Wed May 04, 2022 12:58 am, edited 1 time in total.
khoih-prog
Posts: 102
Joined: Thu Feb 27, 2020 7:54 am
Location: Toronto

Re: Ethernet_Generic Library

Post by khoih-prog »

Releases v2.2.0

1. Add support to STM32 boards using Arduino_Core_STM32
2. Add support to any board with core supporting custom hardware / software SPI, for example STM32.

Releases v2.1.0

1. Add support to WIZNet W5100S. Check Wiznet W5100S #56


Releases v2.0.1

1. Add support to SPI1 for RP2040 using arduino-pico core
2. Add example WebClientRepeating_RP2040_SPI1 to demo the new feature
3. Update Packages' Patches


Debug Terminal Output Sample


This is terminal debug output when running WebClientRepeating on STM32L5 NUCLEO_L552ZE_Q with W5500 using Ethernet_Generic Library and SPI2

Code: Select all

Starting WebClientRepeating on NUCLEO_L552ZE_Q with W5x00 using Ethernet_Generic Library with Large Buffer
Ethernet_Generic v2.2.0
[ETG] Default SPI pinout:
[ETG] MOSI: 22
[ETG] MISO: 25
[ETG] SCK: 23
[ETG] SS: 24
[ETG] =========================
[ETG] Board : NUCLEO_L552ZE_Q , setCsPin: 24
[ETG] W5100 init, using SS_PIN_DEFAULT = 10 , new ss_pin =  10 , W5100Class::ss_pin =  24
[ETG] Chip is W5500
[ETG] W5100::init: W5500, SSIZE = 8192
[ETG] Currently Used SPI pinout:
[ETG] MOSI: 22
[ETG] MISO: 25
[ETG] SCK: 23
[ETG] SS: 24
[ETG] =========================
Using mac index = 2
Connected! IP address: 192.168.2.87
Connecting...
HTTP/1.1 200 OK
Date: Tue, 03 May 2022 03:29:23 GMT
Content-Type: text/plain
Content-Length: 2263
Connection: close
x-amz-id-2: hTDsnSDzBDuANGakAC6oWpB9/CLTHr2x+mYr7lUEkbepdyX1tr5mmHVc2xf6kGIvPzIHqflvQ9U=
x-amz-request-id: 4KV3147AHPAJPRT1
Last-Modified: Wed, 23 Feb 2022 14:56:42 GMT
ETag: "667cf48afcc12c38c8c1637947a04224"
CF-Cache-Status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=KNDyM3NWal0%2FUwycKJT6Be7UpuQlz3ErhhxwurP0LXda2puk5nEzHpOP%2Budp4MtSJAfA%2FPVM8Uc2IUFDQPnemvpzPo7ocsFH22%2Fw3GQfQ4AjOuJpMhO4TddqfQl1qT4%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 7055e97729bba228-YYZ
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400


           `:;;;,`                      .:;;:.           
        .;;;;;;;;;;;`                :;;;;;;;;;;:     TM 
      `;;;;;;;;;;;;;;;`            :;;;;;;;;;;;;;;;      
     :;;;;;;;;;;;;;;;;;;         `;;;;;;;;;;;;;;;;;;     
    ;;;;;;;;;;;;;;;;;;;;;       .;;;;;;;;;;;;;;;;;;;;    
   ;;;;;;;;:`   `;;;;;;;;;     ,;;;;;;;;.`   .;;;;;;;;   
  .;;;;;;,         :;;;;;;;   .;;;;;;;          ;;;;;;;  
  ;;;;;;             ;;;;;;;  ;;;;;;,            ;;;;;;. 
 ,;;;;;               ;;;;;;.;;;;;;`              ;;;;;; 
 ;;;;;.                ;;;;;;;;;;;`      ```       ;;;;;`
 ;;;;;                  ;;;;;;;;;,       ;;;       .;;;;;
`;;;;:                  `;;;;;;;;        ;;;        ;;;;;
,;;;;`    `,,,,,,,,      ;;;;;;;      .,,;;;,,,     ;;;;;
:;;;;`    .;;;;;;;;       ;;;;;,      :;;;;;;;;     ;;;;;
:;;;;`    .;;;;;;;;      `;;;;;;      :;;;;;;;;     ;;;;;
.;;;;.                   ;;;;;;;.        ;;;        ;;;;;
 ;;;;;                  ;;;;;;;;;        ;;;        ;;;;;
 ;;;;;                 .;;;;;;;;;;       ;;;       ;;;;;,
 ;;;;;;               `;;;;;;;;;;;;                ;;;;; 
 `;;;;;,             .;;;;;; ;;;;;;;              ;;;;;; 
  ;;;;;;:           :;;;;;;.  ;;;;;;;            ;;;;;;  
   ;;;;;;;`       .;;;;;;;,    ;;;;;;;;        ;;;;;;;:  
    ;;;;;;;;;:,:;;;;;;;;;:      ;;;;;;;;;;:,;;;;;;;;;;   
    `;;;;;;;;;;;;;;;;;;;.        ;;;;;;;;;;;;;;;;;;;;    
      ;;;;;;;;;;;;;;;;;           :;;;;;;;;;;;;;;;;:     
       ,;;;;;;;;;;;;;,              ;;;;;;;;;;;;;;       
         .;;;;;;;;;`                  ,;;;;;;;;:         
                                                         
                                                         
                                                         
                                                         
    ;;;   ;;;;;`  ;;;;:  .;;  ;; ,;;;;;, ;;. `;,  ;;;;   
    ;;;   ;;:;;;  ;;;;;; .;;  ;; ,;;;;;: ;;; `;, ;;;:;;  
   ,;:;   ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;,`;, ;;  ;;  
   ;; ;:  ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;;`;, ;;  ;;. 
   ;: ;;  ;;;;;:  ;;  ;; .;;  ;;   ,;,   ;;`;;;, ;;  ;;` 
  ,;;;;;  ;;`;;   ;;  ;; .;;  ;;   ,;,   ;; ;;;, ;;  ;;  
  ;;  ,;, ;; .;;  ;;;;;:  ;;;;;: ,;;;;;: ;;  ;;, ;;;;;;  
  ;;   ;; ;;  ;;` ;;;;.   `;;;:  ,;;;;;, ;;  ;;,  ;;;;   
Post Reply

Return to “Libraries & Hardware”