mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
Modern embedded framework, using Rust and async.
f46e0eb5f2
Mode was being set to 2 (PM2_POWERSAVE_MODE), should be 0 (NO_POWERSAVE_MODE). Setting None mode failed with a panic: 85.707099 DEBUG set pm2_sleep_ret = [00, 00, 00, 00] └─ cyw43::control::{impl#0}::set_iovar_v::{async_fn#0} @ cyw43/src/fmt.rs:127 85.710469 ERROR panicked at 'IOCTL error -29' |
||
---|---|---|
.github/workflows | ||
.vscode | ||
cyw43-pio | ||
examples/rpi-pico-w | ||
firmware | ||
src | ||
.gitignore | ||
Cargo.toml | ||
ci.sh | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
rust-toolchain.toml | ||
rustfmt.toml |
cyw43
WIP driver for the CYW43439 wifi chip, used in the Raspberry Pi Pico W. Implementation based on Infineon/wifi-host-driver.
Current status
Working:
- Station mode (joining an AP).
- AP mode (creating an AP)
- Scanning
- Sending and receiving Ethernet frames.
- Using the default MAC address.
embassy-net
integration.- RP2040 PIO driver for the nonstandard half-duplex SPI used in the Pico W.
- Using IRQ for device events
- GPIO support (for LED on the Pico W)
TODO:
- Setting a custom MAC address.
- Bus sleep (unclear what the benefit is. Is it needed for IRQs? or is it just power consumption optimization?)
Running the example
cargo install probe-rs-cli
cd examples/rpi-pico-w
WIFI_NETWORK=MyWifiNetwork WIFI_PASSWORD=MyWifiPassword cargo run --release
After a few seconds, you should see that DHCP picks up an IP address like this
11.944489 DEBUG Acquired IP configuration:
11.944517 DEBUG IP address: 192.168.0.250/24
11.944620 DEBUG Default gateway: 192.168.0.33
11.944722 DEBUG DNS server 0: 192.168.0.33
The example implements a TCP echo server on port 1234. You can try connecting to it with:
nc 192.168.0.250 1234
Send it some data, you should see it echoed back and printed in the firmware's logs.
License
This work is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.