-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WIZnet W55RP20-EVB-Pico board (#2555)
- Loading branch information
1 parent
0d26c5e
commit b0e7ad3
Showing
16 changed files
with
2,098 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
libraries/lwIP_w55rp20/examples/WiFiClient-W55RP20/WiFiClient-W55RP20.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
This sketch establishes a TCP connection to a "quote of the day" service. | ||
It sends a "hello" message, and then prints received data. | ||
*/ | ||
|
||
#include <W55RP20lwIP.h> | ||
|
||
const char* host = "djxmmx.net"; | ||
const uint16_t port = 17; | ||
|
||
Wiznet55rp20lwIP eth(1 /* chip select */); | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
delay(5000); | ||
Serial.println(); | ||
Serial.println(); | ||
Serial.println("Starting Ethernet port"); | ||
|
||
// Start the Ethernet port | ||
if (!eth.begin()) { | ||
Serial.println("No wired Ethernet hardware detected. Check pinouts, wiring."); | ||
while (1) { | ||
delay(1000); | ||
} | ||
} | ||
|
||
while (!eth.connected()) { | ||
Serial.print("."); | ||
delay(500); | ||
} | ||
|
||
Serial.println(""); | ||
Serial.println("Ethernet connected"); | ||
Serial.println("IP address: "); | ||
Serial.println(eth.localIP()); | ||
} | ||
|
||
void loop() { | ||
static bool wait = false; | ||
|
||
Serial.print("connecting to "); | ||
Serial.print(host); | ||
Serial.print(':'); | ||
Serial.println(port); | ||
|
||
// Use WiFiClient class to create TCP connections | ||
WiFiClient client; | ||
if (!client.connect(host, port)) { | ||
Serial.println("connection failed"); | ||
delay(5000); | ||
return; | ||
} | ||
|
||
// This will send a string to the server | ||
Serial.println("sending data to server"); | ||
if (client.connected()) { | ||
client.println("hello from RP2040"); | ||
} | ||
|
||
// wait for data to be available | ||
unsigned long timeout = millis(); | ||
while (client.available() == 0) { | ||
if (millis() - timeout > 5000) { | ||
Serial.println(">>> Client Timeout !"); | ||
client.stop(); | ||
delay(60000); | ||
return; | ||
} | ||
} | ||
|
||
// Read all the lines of the reply from server and print them to Serial | ||
Serial.println("receiving from remote server"); | ||
// not testing 'client.connected()' since we do not need to send data here | ||
while (client.available()) { | ||
char ch = static_cast<char>(client.read()); | ||
Serial.print(ch); | ||
} | ||
|
||
// Close the connection | ||
Serial.println(); | ||
Serial.println("closing connection"); | ||
client.stop(); | ||
|
||
if (wait) { | ||
delay(300000); // execute once every 5 minutes, don't flood remote service | ||
} | ||
wait = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
####################################### | ||
# Syntax Coloring Map | ||
####################################### | ||
|
||
####################################### | ||
# Library (KEYWORD1) | ||
####################################### | ||
|
||
W55RP20lwIP KEYWORD1 | ||
Wiznet55rp20lwIP KEYWORD1 | ||
|
||
####################################### | ||
# Methods and Functions (KEYWORD2) | ||
####################################### | ||
|
||
####################################### | ||
# Constants (LITERAL1) | ||
####################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name=lwIP_w55rp20 | ||
version=1 | ||
author=Nicholas Humfrey | ||
maintainer=esp8266/Arduino | ||
sentence=Ethernet driver | ||
paragraph=Wiznet55rp20 ethernet drivers for lwIP and esp8266 Arduino from https://github.com/njh/W5500MacRaw | ||
category=Communication | ||
url=https://github.com/esp8266/Arduino | ||
architectures=rp2040 | ||
dot_a_linkage=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
#include <LwipIntfDev.h> | ||
#include <utility/w55rp20.h> | ||
#include <LwipEthernet.h> | ||
#include <WiFi.h> | ||
|
||
using Wiznet55rp20lwIP = LwipIntfDev<Wiznet55rp20>; |
Oops, something went wrong.