pub trait SpmiDevice {
// Required methods
async fn read_reg(&self, address: u16, size: u32) -> Result<Vec<u8>, Error>;
async fn write_reg(&self, address: u16, data: &[u8]) -> Result<(), Error>;
}Expand description
Trait for SPMI devices to abstract register read/write operations.
This trait allows the Register and spmi_register_block! macros to
interact with any underlying hardware interface or mock device that
implements these basic SPMI read and write operations.
Implementations must handle the low-level transport (e.g., FIDL calls to a Fuchsia SPMI driver) and handle error mapping.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".