Skip to main content

Crate st67w611

Crate st67w611 

Source
Expand description

ST67W611 WiFi Module Driver

An async, no_std driver for ST67W611 WiFi modules using the Embassy framework.

§Firmware Architectures

This driver supports two firmware architectures:

§T01 Firmware (default, mission-t01 feature)

The TCP/IP stack runs on the ST67W611 module. The host communicates via AT commands for socket operations, HTTP, MQTT, etc.

Features:

  • WiFi connectivity (station and AP modes)
  • TCP/UDP sockets via AT commands
  • TLS/SSL with certificate management
  • HTTP/HTTPS client
  • MQTT client with QoS
  • DNS, SNTP, Ping utilities
  • Power management

§T02 Firmware (mission-t02 feature)

The TCP/IP stack runs on the host MCU using embassy-net. The module acts as a WiFi MAC/PHY only, passing raw Ethernet frames.

Features:

  • embassy-net integration
  • Full control over TCP/IP stack
  • WiFi configuration via AT commands
  • Raw Ethernet frame transport

§Example (T01 Firmware)

use st67w611::{
    at::processor::AtProcessor, bus::SpiTransport, Config, Driver,
    NetworkDevice, TlsManager, WiFiManager, WiFiMode, SocketProtocol,
};
use embassy_executor::Spawner;

#[embassy_executor::main]
async fn main(spawner: Spawner) {
    // Create static resources (see examples for complete setup)
    let driver = /* create driver with make_static! */;

    // Spawn background tasks
    spawner.spawn(rx_task(driver)).unwrap();
    spawner.spawn(ipd_task(driver)).unwrap();

    // Initialize WiFi
    driver.init_wifi(WiFiMode::Station).await.unwrap();
    driver.wifi_connect("SSID", "password").await.unwrap();

    // Use HTTP client
    let http = driver.http_client();
    let response = http.get(spi, "https://api.example.com").await.unwrap();
}

§Example (T02 Firmware with embassy-net)

use st67w611::net::{new_driver, State, MTU};
use embassy_net::{Stack, StackResources};

#[embassy_executor::main]
async fn main(spawner: Spawner) {
    // Create driver state
    let state = make_static!(State::<MTU, 4, 4>::new());
    let (device, runner) = new_driver(spi, cs, state);

    // Spawn the runner task
    spawner.spawn(wifi_runner(runner)).unwrap();

    // Use with embassy-net
    let stack = Stack::new(device, config, resources, seed);
}

See the examples/ directory for complete working code.

Re-exports§

pub use config::Config;
pub use error::Error;
pub use error::Result;
pub use at::AtCommand;
pub use at::AtResponse;
pub use bus::SpiTransport;
pub use http::HttpClient;
pub use http::HttpMethod;
pub use http::HttpRequest;
pub use http::HttpResponse;
pub use mqtt::MqttClient;
pub use mqtt::MqttConfig;
pub use mqtt::MqttMessage;
pub use net::NetworkDevice;
pub use sync::TmMutex;
pub use tls::CertificateType;
pub use tls::TlsManager;
pub use wifi::WiFiManager;
pub use types::*;

Modules§

advanced
Advanced networking features
at
AT command layer
bus
Bus layer - SPI communication with the ST67W611 module
config
Driver configuration
error
Error types for the ST67W611 driver
http
HTTP client implementation
mqtt
MQTT client implementation
net
Network layer
power
Power management
sync
Synchronization primitives
tls
TLS/SSL certificate management
types
Common types used throughout the driver
util
Utility functions and helpers
wifi
WiFi management API

Macros§

make_static
Helper macro to create static resources

Structs§

Driver
Main driver instance (T01 firmware only)
Duration
Represents the difference between two Instants