embedded-savegame
A no_std savegame library for embedded systems with power-fail safety and wear leveling.
⚠️ Work in progress: The on-disk format may still change with no migration path between versions.
Supported Flash Hardware
- AT24Cxx EEPROM (via
eeprom24xfeature) - W25Q NOR flash (via
w25qfeature) - Custom hardware (implement the
Flashtrait)
Quick Start
Add to your Cargo.toml:
[]
= "0.2"
# Enable support for your flash hardware:
# embedded-savegame = { version = "0.2", features = ["eeprom24x"] }
# embedded-savegame = { version = "0.2", features = ["w25q"] }
Usage Example
use ;
// Configure storage: 64-byte slots, 8 total slots
const SLOT_SIZE: usize = 64;
const SLOT_COUNT: usize = 8;
// Create storage manager with your flash device
let mut storage = new;
// Scan for existing savegame
if let Ok = storage.scan
// Write a new savegame
let mut game_data = serialize_game_state;
storage.append?;
License
MIT OR Apache-2.0