attiny_hal/
eeprom.rs
1pub use avr_hal_generic::eeprom::{EepromOps, OutOfBoundsError};
22
23pub type Eeprom = avr_hal_generic::eeprom::Eeprom<crate::Attiny, crate::pac::EEPROM>;
24
25#[cfg(feature = "attiny2313")]
26avr_hal_generic::impl_eeprom_attiny! {
27 hal: crate::Attiny,
28 peripheral: crate::pac::EEPROM,
29 capacity: 128,
30 addr_width: u8,
31 set_address: |peripheral, address| {
32 peripheral.eear.write(|w| w.bits(address));
33 },
34}
35
36#[cfg(any(feature = "attiny167", feature = "attiny85"))]
37avr_hal_generic::impl_eeprom_attiny! {
38 hal: crate::Attiny,
39 peripheral: crate::pac::EEPROM,
40 capacity: 512,
41 addr_width: u16,
42 set_address: |peripheral, address| {
43 peripheral.eear.write(|w| w.bits(address));
44 },
45}
46
47#[cfg(feature = "attiny88")]
48avr_hal_generic::impl_eeprom_attiny! {
49 hal: crate::Attiny,
50 peripheral: crate::pac::EEPROM,
51 capacity: 64,
52 addr_width: u8,
53 set_address: |peripheral, address| {
54 peripheral.eearl.write(|w| w.bits(address));
55 },
56}