Skip to main content

Platform

Trait Platform 

Source
pub trait Platform: TimeProvider + Logger {
    // Required methods
    fn name(&self) -> &'static str;
    fn cpu_frequency_hz(&self) -> u32;
    fn available_memory_bytes(&self) -> usize;

    // Provided method
    fn uptime_ms(&self) -> u64 { ... }
}
Expand description

Convenience trait combining common platform capabilities

Most embedded platforms will implement this trait by combining TimeProvider, SerialIO, GpioProvider, and Logger.

Required Methods§

Source

fn name(&self) -> &'static str

Get platform name (e.g., “ESP32”, “Arduino Due”, “STM32F4”)

Source

fn cpu_frequency_hz(&self) -> u32

Get CPU frequency in Hz

Source

fn available_memory_bytes(&self) -> usize

Get available memory in bytes

Provided Methods§

Source

fn uptime_ms(&self) -> u64

Get platform uptime in milliseconds

Implementors§