Sequential-storage

crates.io Documentation

A crate for storing key-value pairs in flash with minimal erase cycles.

Basic API:

```rust,ignore enum MyCustomType { X, Y, // ... }

impl StorageItem for MyCustomType { // ... }

let mut flash = SomeFlashChip::new(); let flash_range = 0x1000..0x2000; // These are the flash addresses in which the crate will operate

asserteq!( fetchitem::( &mut flash, flash_range.clone(), 0 ).unwrap(), None );

storeitem::( &mut flash, flashrange.clone(), MyCustomType::X ).unwrap();

asserteq!( fetchitem::( &mut flash, flash_range.clone(), 0 ).unwrap(), Some(MyCustomType::X) ); ```