Module atmega_hal::eeprom

source ·
Expand description

EEPROM

§Example

Complete example source code can be found in the repository: atmega2560-eeprom.rs

const BOOT_COUNT_OFFSET: u16 = 0;

let dp = atmega_hal::Peripherals::take().unwrap();
let mut eeprom = Eeprom::new(dp.EEPROM);

let mut boot_count = eeprom.read_byte(BOOT_COUNT_OFFSET);
boot_count = boot_count.wrapping_add(1);
eeprom.write_byte(BOOT_COUNT_OFFSET, boot_count);

ufmt::uwriteln!(&mut serial, "Boot count: {}", boot_count).unwrap();

Structs§

Traits§

  • Internal trait for low-level EEPROM peripherals.

Type Aliases§