pub struct Eeprom24x<I2C, PS, AS, SN> { /* private fields */ }
Expand description
EEPROM24X driver
Implementations§
source§impl<I2C, E, PS, AS, SN> Eeprom24x<I2C, PS, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
impl<I2C, E, PS, AS, SN> Eeprom24x<I2C, PS, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
Common methods
sourcepub fn write_byte(&mut self, address: u32, data: u8) -> Result<(), Error<E>>
pub fn write_byte(&mut self, address: u32, data: u8) -> Result<(), Error<E>>
Write a single byte in an address.
After writing a byte, the EEPROM enters an internally-timed write cycle to the nonvolatile memory. During this time all inputs are disabled and the EEPROM will not respond until the write is complete.
source§impl<I2C, E, PS, AS, SN> Eeprom24x<I2C, PS, AS, SN>where
I2C: I2c<Error = E>,
impl<I2C, E, PS, AS, SN> Eeprom24x<I2C, PS, AS, SN>where
I2C: I2c<Error = E>,
Specialization for platforms which implement embedded_hal::blocking::i2c::Read
sourcepub fn read_current_address(&mut self) -> Result<u8, Error<E>>
pub fn read_current_address(&mut self) -> Result<u8, Error<E>>
Read the contents of the last address accessed during the last read or write operation, incremented by one.
Note: This may not be available on your platform.
source§impl<I2C, E> Eeprom24x<I2C, No, OneByte, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, No, OneByte, No>where
I2C: I2c<Error = E>,
Specialization for devices without page access (e.g. 24C00)
source§impl<I2C, E> Eeprom24x<I2C, B8, OneByte, Yes>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B8, OneByte, Yes>where
I2C: I2c<Error = E>,
sourcepub fn new_24csx01(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24csx01(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24CSx01 device (e.g. 24CS01)
source§impl<I2C, E> Eeprom24x<I2C, B8, OneByte, Yes>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B8, OneByte, Yes>where
I2C: I2c<Error = E>,
sourcepub fn new_24csx02(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24csx02(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24CSx02 device (e.g. 24CS02)
source§impl<I2C, E> Eeprom24x<I2C, B8, OneByte, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B8, OneByte, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24x02e48(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x02e48(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x02E48 device (e.g. 24AA02E48)
source§impl<I2C, E> Eeprom24x<I2C, B8, OneByte, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B8, OneByte, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24x02e64(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x02e64(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x02E64 device (e.g. 24AA02E64)
source§impl<I2C, E, AS, SN> Eeprom24x<I2C, B8, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
impl<I2C, E, AS, SN> Eeprom24x<I2C, B8, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
sourcepub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
pub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
Write up to a page starting in an address.
The maximum amount of data that can be written depends on the page
size of the device and its overall capacity. If too much data is passed,
the error Error::TooMuchData
will be returned.
After writing a byte, the EEPROM enters an internally-timed write cycle to the nonvolatile memory. During this time all inputs are disabled and the EEPROM will not respond until the write is complete.
source§impl<I2C, E> Eeprom24x<I2C, B16, OneByte, Yes>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B16, OneByte, Yes>where
I2C: I2c<Error = E>,
sourcepub fn new_24csx04(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24csx04(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24CSx04 device (e.g. AT24CS04)
source§impl<I2C, E> Eeprom24x<I2C, B16, OneByte, Yes>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B16, OneByte, Yes>where
I2C: I2c<Error = E>,
sourcepub fn new_24csx08(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24csx08(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24CSx08 device (e.g. AT24CS08)
source§impl<I2C, E> Eeprom24x<I2C, B16, OneByte, Yes>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B16, OneByte, Yes>where
I2C: I2c<Error = E>,
sourcepub fn new_24csx16(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24csx16(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24CSx16 device (e.g. AT24CS16)
source§impl<I2C, E> Eeprom24x<I2C, B16, OneByte, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B16, OneByte, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24x025e48(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x025e48(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x025E48 device (e.g. 24AA025E48)
source§impl<I2C, E> Eeprom24x<I2C, B16, OneByte, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B16, OneByte, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24x025e64(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x025e64(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x025E64 device (e.g. 24AA025E64)
source§impl<I2C, E> Eeprom24x<I2C, B16, OneByte, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B16, OneByte, No>where
I2C: I2c<Error = E>,
sourcepub fn new_m24x01(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_m24x01(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a M24C01 device (e.g. M24C01)
source§impl<I2C, E> Eeprom24x<I2C, B16, OneByte, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B16, OneByte, No>where
I2C: I2c<Error = E>,
sourcepub fn new_m24x02(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_m24x02(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a M24C02 device (e.g. M24C02)
source§impl<I2C, E, AS, SN> Eeprom24x<I2C, B16, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
impl<I2C, E, AS, SN> Eeprom24x<I2C, B16, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
sourcepub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
pub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
Write up to a page starting in an address.
The maximum amount of data that can be written depends on the page
size of the device and its overall capacity. If too much data is passed,
the error Error::TooMuchData
will be returned.
After writing a byte, the EEPROM enters an internally-timed write cycle to the nonvolatile memory. During this time all inputs are disabled and the EEPROM will not respond until the write is complete.
source§impl<I2C, E> Eeprom24x<I2C, B32, TwoBytes, Yes>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B32, TwoBytes, Yes>where
I2C: I2c<Error = E>,
sourcepub fn new_24csx32(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24csx32(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24CSx32 device (e.g. AT24CS32)
source§impl<I2C, E> Eeprom24x<I2C, B32, TwoBytes, Yes>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B32, TwoBytes, Yes>where
I2C: I2c<Error = E>,
sourcepub fn new_24csx64(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24csx64(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24CSx64 device (e.g. AT24CS64)
source§impl<I2C, E, AS, SN> Eeprom24x<I2C, B32, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
impl<I2C, E, AS, SN> Eeprom24x<I2C, B32, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
sourcepub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
pub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
Write up to a page starting in an address.
The maximum amount of data that can be written depends on the page
size of the device and its overall capacity. If too much data is passed,
the error Error::TooMuchData
will be returned.
After writing a byte, the EEPROM enters an internally-timed write cycle to the nonvolatile memory. During this time all inputs are disabled and the EEPROM will not respond until the write is complete.
source§impl<I2C, E> Eeprom24x<I2C, B64, TwoBytes, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B64, TwoBytes, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24x128(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x128(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x128 device (e.g. AT24C128)
source§impl<I2C, E> Eeprom24x<I2C, B64, TwoBytes, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B64, TwoBytes, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24x256(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x256(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x256 device (e.g. AT24C256)
source§impl<I2C, E, AS, SN> Eeprom24x<I2C, B64, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
impl<I2C, E, AS, SN> Eeprom24x<I2C, B64, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
sourcepub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
pub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
Write up to a page starting in an address.
The maximum amount of data that can be written depends on the page
size of the device and its overall capacity. If too much data is passed,
the error Error::TooMuchData
will be returned.
After writing a byte, the EEPROM enters an internally-timed write cycle to the nonvolatile memory. During this time all inputs are disabled and the EEPROM will not respond until the write is complete.
source§impl<I2C, E> Eeprom24x<I2C, B128, TwoBytes, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B128, TwoBytes, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24x512(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x512(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x512 device (e.g. AT24C512)
source§impl<I2C, E, AS, SN> Eeprom24x<I2C, B128, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
impl<I2C, E, AS, SN> Eeprom24x<I2C, B128, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
sourcepub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
pub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
Write up to a page starting in an address.
The maximum amount of data that can be written depends on the page
size of the device and its overall capacity. If too much data is passed,
the error Error::TooMuchData
will be returned.
After writing a byte, the EEPROM enters an internally-timed write cycle to the nonvolatile memory. During this time all inputs are disabled and the EEPROM will not respond until the write is complete.
source§impl<I2C, E> Eeprom24x<I2C, B256, TwoBytes, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B256, TwoBytes, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24xm01(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24xm01(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24xM01 device (e.g. AT24CM01)
source§impl<I2C, E> Eeprom24x<I2C, B256, TwoBytes, No>where
I2C: I2c<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B256, TwoBytes, No>where
I2C: I2c<Error = E>,
sourcepub fn new_24xm02(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24xm02(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24xM02 device (e.g. AT24CM02)
source§impl<I2C, E, AS, SN> Eeprom24x<I2C, B256, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
impl<I2C, E, AS, SN> Eeprom24x<I2C, B256, AS, SN>where
I2C: I2c<Error = E>,
AS: MultiSizeAddr,
sourcepub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
pub fn write_page(&mut self, address: u32, data: &[u8]) -> Result<(), Error<E>>
Write up to a page starting in an address.
The maximum amount of data that can be written depends on the page
size of the device and its overall capacity. If too much data is passed,
the error Error::TooMuchData
will be returned.
After writing a byte, the EEPROM enters an internally-timed write cycle to the nonvolatile memory. During this time all inputs are disabled and the EEPROM will not respond until the write is complete.
source§impl<I2C, PS, E> Eeprom24x<I2C, PS, OneByte, Yes>where
I2C: I2c<Error = E>,
impl<I2C, PS, E> Eeprom24x<I2C, PS, OneByte, Yes>where
I2C: I2c<Error = E>,
Methods for interacting with the factory-programmed unique serial number for devices with one byte addresses. e.g. 24CSx01, 24CSx02,24CSx04, 24CSx08, and 24CSx16.