capsules_extra

Module at24c_eeprom

Source
Expand description

Driver for the AT24C32/64 EEPROM memory. Built on top of the I2C interface. Provides interface for the NonvolatileToPages driver.

Datasheet: https://ww1.microchip.com/downloads/en/devicedoc/doc0336.pdf

The AT24C32/64 provides 32,768/65,536 bits of serial electrically erasable and programmable read only memory (EEPROM) organized as 4096/8192 words of 8 bits each. The device’s cascadable feature allows up to 8 devices to share a common 2- wire bus. The device is optimized for use in many industrial and commercial applications where low power and low voltage operation are essential. The AT24C32/64 is available in space saving 8-pin JEDEC PDIP, 8-pin JEDEC SOIC, 8-pin EIAJ SOIC, and 8-pin TSSOP (AT24C64) packages and is accessed via a 2-wire serial interface.

§Usage

let i2cmux = I2CMuxComponent::new(i2c0, None).finalize(components::i2c_mux_component_static!());

let at24c_buffer = static_init!([u8; 34], [0; 34]);

let at24c_i2c_device = static_init!(I2CDevice, I2CDevice::new(i2cmux, 0x50));
let at24c_capsule = static_init!(capsules_extra::at24c_eeprom::AT24C,capsules_extra::at24c_eeprom::AT24C::new(
            at24c_i2c_device,
            at24c_buffer,
        ) );
at24c_i2c_device.set_client(at24c_capsule);

let nonvolatile_storage = components::nonvolatile_storage::NonvolatileStorageComponent::new(
        board_kernel,
        capsules_extra::nonvolatile_storage_driver::DRIVER_NUM,
        at24c_capsule,
        0x0,
        0x10000,
        0x0,
        0x0,
    ).finalize(components::nonvolatile_storage_component_static!(capsules_extra::at24c_eeprom::AT24C));

Structs§