3 releases (breaking)

0.2.0 Aug 5, 2024
0.1.0 Jan 11, 2024
0.0.0 Mar 7, 2023

#1014 in Embedded development

Download history 151/week @ 2024-08-07 119/week @ 2024-08-14 82/week @ 2024-08-21 68/week @ 2024-08-28 84/week @ 2024-09-04 82/week @ 2024-09-11 97/week @ 2024-09-18 134/week @ 2024-09-25 87/week @ 2024-10-02 58/week @ 2024-10-09 99/week @ 2024-10-16 100/week @ 2024-10-23 168/week @ 2024-10-30 110/week @ 2024-11-06 83/week @ 2024-11-13 84/week @ 2024-11-20

465 downloads per month
Used in cyw43-pio

MIT/Apache

520KB
11K SLoC

cyw43

Rust 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 (for power consumption optimization)

Running the examples

  • Install probe-rs following the instructions at https://probe.rs.
  • cd examples/rp

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 wifi_ap_tcp_server

Example 3: Connect to an existing network and create a server

  • cargo run --release --bin wifi_tcp_server

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

This 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.

Dependencies

~2.3–3MB
~55K SLoC