embassy/cyw43/README.md

58 lines
1.8 KiB
Markdown
Raw Normal View History

2022-07-11 20:53:57 +00:00
# cyw43
2022-07-16 22:34:41 +00:00
WIP driver for the CYW43439 wifi chip, used in the Raspberry Pi Pico W. Implementation based on [Infineon/wifi-host-driver](https://github.com/Infineon/wifi-host-driver).
## Current status
Working:
- Station mode (joining an AP).
2023-05-01 16:47:09 +00:00
- AP mode (creating an AP)
- Scanning
2022-07-16 22:34:41 +00:00
- Sending and receiving Ethernet frames.
- Using the default MAC address.
- [`embassy-net`](https://embassy.dev) integration.
2023-03-27 20:34:48 +00:00
- 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)
2022-07-16 22:34:41 +00:00
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?)
2023-05-24 07:22:05 +00:00
## Running the examples
2022-07-16 22:34:41 +00:00
2023-04-26 16:10:39 +00:00
- `cargo install probe-rs-cli`
2022-07-16 22:34:41 +00:00
- `cd examples/rpi-pico-w`
2023-05-24 07:22:05 +00:00
### Example 1: Scan the wifi stations
- `cargo run --release --bin wifi_scan`
### Example 2: Create an access point (IP and credentials in the code)
- `cargo run --release --bin tcp_server_ap`
### Example 3: Connect to an existing network and create a server
- `WIFI_NETWORK=MyWifiNetwork WIFI_PASSWORD=MyWifiPassword cargo run --release`
2022-07-16 22:34:41 +00:00
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
```
2023-05-24 07:22:05 +00:00
This example implements a TCP echo server on port 1234. You can try connecting to it with:
2022-07-16 22:34:41 +00:00
```
nc 192.168.0.250 1234
```
Send it some data, you should see it echoed back and printed in the firmware's logs.
2022-07-11 20:53:57 +00:00
## License
This work is licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
<http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
at your option.