Skip to content

Commit a7380a5

Browse files
authored
Add support for W6300-EVB-Pico and W6300-EVB-Pico2 boards (#2999)
1 parent 878271e commit a7380a5

File tree

19 files changed

+2835
-2
lines changed

19 files changed

+2835
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
121121
* WIZnet W5500-EVB-Pico
122122
* WIZnet W5500-EVB-Pico2
123123
* WIZnet W55RP20-EVB-Pico
124+
* WIZnet W6300-EVB-Pico
125+
* WIZnet W6300-EVB-Pico2
124126
* WIZnet WizFi360-EVB-Pico
125127
* Generic RP2040 (configurable flash, I/O pins)
126128
* Generic RP2350 (configurable flash, I/O pins)
@@ -131,7 +133,7 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
131133
* Bluetooth Classic and BLE HID master mode (connect to BT keyboard, mouse, or joystick)
132134
* Generic Arduino USB Serial, Keyboard, Joystick, and Mouse emulation
133135
* WiFi (Pico W, ESP32-based ESPHost, Atmel WINC1500)
134-
* Ethernet (Wired WizNet W6100, WizNet W5500, WizNet W5100, ENC28J60)
136+
* Ethernet (Wired WizNet W6300, WizNet W6100, WizNet W5500, WizNet W5100, ENC28J60)
135137
* HTTP client and server (WebServer)
136138
* SSL/TLS/HTTPS
137139
* Over-the-Air (OTA) upgrades

boards.txt

Lines changed: 485 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
This sketch establishes a TCP connection to a "quote of the day" service.
3+
It sends a "hello" message, and then prints received data.
4+
*/
5+
6+
#include <W6300lwIP.h>
7+
8+
const char* host = "djxmmx.net";
9+
const uint16_t port = 17;
10+
11+
Wiznet6300lwIP eth(1 /* chip select */);
12+
13+
void setup() {
14+
// Set up SPI pinout to match your HW
15+
SPI.setRX(0);
16+
SPI.setCS(1);
17+
SPI.setSCK(2);
18+
SPI.setTX(3);
19+
20+
Serial.begin(115200);
21+
delay(5000);
22+
Serial.println();
23+
Serial.println();
24+
Serial.println("Starting Ethernet port");
25+
26+
// Start the Ethernet port
27+
if (!eth.begin()) {
28+
Serial.println("No wired Ethernet hardware detected. Check pinouts, wiring.");
29+
while (1) {
30+
delay(1000);
31+
}
32+
}
33+
34+
while (!eth.connected()) {
35+
Serial.print(".");
36+
delay(500);
37+
}
38+
39+
Serial.println("");
40+
Serial.println("Ethernet connected");
41+
Serial.println("IP address: ");
42+
Serial.println(eth.localIP());
43+
}
44+
45+
void loop() {
46+
static bool wait = false;
47+
48+
Serial.print("connecting to ");
49+
Serial.print(host);
50+
Serial.print(':');
51+
Serial.println(port);
52+
53+
// Use WiFiClient class to create TCP connections
54+
WiFiClient client;
55+
if (!client.connect(host, port)) {
56+
Serial.println("connection failed");
57+
delay(5000);
58+
return;
59+
}
60+
61+
// This will send a string to the server
62+
Serial.println("sending data to server");
63+
if (client.connected()) {
64+
client.println("hello from RP2040");
65+
}
66+
67+
// wait for data to be available
68+
unsigned long timeout = millis();
69+
while (client.available() == 0) {
70+
if (millis() - timeout > 5000) {
71+
Serial.println(">>> Client Timeout !");
72+
client.stop();
73+
delay(60000);
74+
return;
75+
}
76+
}
77+
78+
// Read all the lines of the reply from server and print them to Serial
79+
Serial.println("receiving from remote server");
80+
// not testing 'client.connected()' since we do not need to send data here
81+
while (client.available()) {
82+
char ch = static_cast<char>(client.read());
83+
Serial.print(ch);
84+
}
85+
86+
// Close the connection
87+
Serial.println();
88+
Serial.println("closing connection");
89+
client.stop();
90+
91+
if (wait) {
92+
delay(300000); // execute once every 5 minutes, don't flood remote service
93+
}
94+
wait = true;
95+
}

libraries/lwIP_w6300/keywords.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#######################################
2+
# Syntax Coloring Map
3+
#######################################
4+
5+
#######################################
6+
# Library (KEYWORD1)
7+
#######################################
8+
9+
W6100lwIP KEYWORD1
10+
Wiznet6100lwIP KEYWORD1
11+
12+
#######################################
13+
# Methods and Functions (KEYWORD2)
14+
#######################################
15+
16+
#######################################
17+
# Constants (LITERAL1)
18+
#######################################
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name=lwIP_w6300
2+
version=1
3+
author=Stefan Nuernberger
4+
maintainer=esp8266/Arduino
5+
sentence=Ethernet driver
6+
paragraph=Wiznet6300 ethernet drivers for lwIP and esp8266 Arduino from https://github.com/njh/W5100MacRaw
7+
category=Communication
8+
url=https://github.com/esp8266/Arduino
9+
architectures=rp2040
10+
dot_a_linkage=true

libraries/lwIP_w6300/src/W6300lwIP.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#pragma once
2+
3+
#include <LwipIntfDev.h>
4+
#include <utility/w6300.h>
5+
#include <LwipEthernet.h>
6+
#include <WiFi.h>
7+
8+
using Wiznet6300lwIP = LwipIntfDev<Wiznet6300>;

0 commit comments

Comments
 (0)