move embassy-net-w5500 to subdir.

This commit is contained in:
Dario Nieuwenhuis
2023-05-31 00:54:20 +02:00
parent 6c1137177f
commit 7f0e778145
22 changed files with 17 additions and 450 deletions

View File

@ -1,8 +0,0 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-rs-cli run --chip RP2040"
[build]
target = "thumbv6m-none-eabi"
[env]
DEFMT_LOG = "info"

View File

@ -1,70 +0,0 @@
[package]
name = "embassy-net-w5500-examples"
version = "0.1.0"
edition = "2021"
[dependencies]
embassy-executor = { version = "0.2.0", features = ["defmt", "integrated-timers", "executor-thread", "arch-cortex-m"] }
embassy-time = { version = "0.1.0", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver"] }
embassy-net = { version = "0.1.0", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet", "unstable-traits", "nightly"] }
embassy-sync = { version = "0.1.0" }
embassy-futures = { version = "0.1.0" }
embassy-net-driver = { version = "0.1.0" }
embassy-net-driver-channel = { version = "0.1.0" }
atomic-polyfill = "0.1.5"
static_cell = "1.0"
defmt = "=0.3.2"
defmt-rtt = "0.3"
panic-probe = { version = "0.3", features = ["print-defmt"] }
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7.0"
embedded-io = { version = "0.4.0", features = ["async", "defmt"] }
heapless = "0.7.15"
embedded-hal = { version = "1.0.0-alpha.10" }
embedded-hal-async = { version = "=0.2.0-alpha.1" }
rand = { version = "0.8.5", default-features = false }
embassy-net-w5500 = { path = "../" }
[patch.crates-io]
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "e179e7cf85810f0aa7ef8027d8d48f6d21f64dac" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "e179e7cf85810f0aa7ef8027d8d48f6d21f64dac" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "e179e7cf85810f0aa7ef8027d8d48f6d21f64dac" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "e179e7cf85810f0aa7ef8027d8d48f6d21f64dac" }
embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "e179e7cf85810f0aa7ef8027d8d48f6d21f64dac" }
embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "e179e7cf85810f0aa7ef8027d8d48f6d21f64dac" }
embassy-net-driver = { git = "https://github.com/embassy-rs/embassy", rev = "e179e7cf85810f0aa7ef8027d8d48f6d21f64dac" }
embassy-net-driver-channel = { git = "https://github.com/embassy-rs/embassy", rev = "e179e7cf85810f0aa7ef8027d8d48f6d21f64dac" }
[profile.dev]
debug = 2
debug-assertions = true
opt-level = 1
overflow-checks = true
[profile.release]
codegen-units = 1
debug = 1
debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 'z'
overflow-checks = false
# do not optimize proc-macro crates = faster builds from scratch
[profile.dev.build-override]
codegen-units = 8
debug = false
debug-assertions = false
opt-level = 0
overflow-checks = false
[profile.release.build-override]
codegen-units = 8
debug = false
debug-assertions = false
opt-level = 0
overflow-checks = false

View File

@ -1,33 +0,0 @@
# Examples for the rp2040 `WIZnet W5500-EVB-Pico` board
Examples are written for the [`WIZnet W5500-EVB-Pico`](https://www.wiznet.io/product-item/w5500-evb-pico/) board.
## Prerequisites
```bash
cargo install probe-rs-cli
```
## TCP server example
```bash
cargo run --bin tcp-server --release
```
This example implements a TCP echo server on port 1234 and using DHCP.
Send it some data, you should see it echoed back and printed in the console.
## Multi-socket example
```bash
cargo run --bin multisocket --release
```
This example shows how you can allow multiple simultaneous TCP connections, by having multiple sockets listening on the same port.
## TCP client example
```bash
cargo run --bin tcp-client --release
```
This example implements a TCP client that attempts to connect to a host on port 1234 and send it some data once per second.
## UDP server example
```bash
cargo run --bin udp --release
```
This example implements a UDP server listening on port 1234 and echoing back the data.

View File

@ -1,36 +0,0 @@
//! This build script copies the `memory.x` file from the crate root into
//! a directory where the linker can always find it at build time.
//! For many projects this is optional, as the linker always searches the
//! project root directory -- wherever `Cargo.toml` is. However, if you
//! are using a workspace or have a more complicated build setup, this
//! build script becomes required. Additionally, by requesting that
//! Cargo re-run the build script whenever `memory.x` is changed,
//! updating `memory.x` ensures a rebuild of the application with the
//! new memory settings.
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
fn main() {
// Put `memory.x` in our output directory and ensure it's
// on the linker search path.
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
File::create(out.join("memory.x"))
.unwrap()
.write_all(include_bytes!("memory.x"))
.unwrap();
println!("cargo:rustc-link-search={}", out.display());
// By default, Cargo will re-run a build script whenever
// any file in the project changes. By specifying `memory.x`
// here, we ensure the build script is only re-run when
// `memory.x` is changed.
println!("cargo:rerun-if-changed=memory.x");
println!("cargo:rustc-link-arg-bins=--nmagic");
println!("cargo:rustc-link-arg-bins=-Tlink.x");
println!("cargo:rustc-link-arg-bins=-Tlink-rp.x");
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
}

View File

@ -1,5 +0,0 @@
MEMORY {
BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100
FLASH : ORIGIN = 0x10000100, LENGTH = 1024K - 0x100
RAM : ORIGIN = 0x20000000, LENGTH = 256K
}

View File

@ -1,3 +1,7 @@
//! This example shows how you can allow multiple simultaneous TCP connections, by having multiple sockets listening on the same port.
//!
//! Example written for the [`WIZnet W5500-EVB-Pico`](https://www.wiznet.io/product-item/w5500-evb-pico/) board.
#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]

View File

@ -1,3 +1,7 @@
//! This example implements a TCP client that attempts to connect to a host on port 1234 and send it some data once per second.
//!
//! Example written for the [`WIZnet W5500-EVB-Pico`](https://www.wiznet.io/product-item/w5500-evb-pico/) board.
#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]

View File

@ -1,3 +1,8 @@
//! This example implements a TCP echo server on port 1234 and using DHCP.
//! Send it some data, you should see it echoed back and printed in the console.
//!
//! Example written for the [`WIZnet W5500-EVB-Pico`](https://www.wiznet.io/product-item/w5500-evb-pico/) board.
#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]

View File

@ -1,3 +1,7 @@
//! This example implements a UDP server listening on port 1234 and echoing back the data.
//!
//! Example written for the [`WIZnet W5500-EVB-Pico`](https://www.wiznet.io/product-item/w5500-evb-pico/) board.
#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]