pub struct Eeprom24x<I2C, PS> { /* private fields */ }
Expand description
EEPROM24X driver
Implementations
sourceimpl<I2C, E, PS> Eeprom24x<I2C, PS>where
I2C: Write<Error = E> + WriteRead<Error = E>,
impl<I2C, E, PS> Eeprom24x<I2C, PS>where
I2C: Write<Error = E> + WriteRead<Error = E>,
Common methods
sourcepub fn write_byte(&mut self, address: [u8; 2], data: u8) -> Result<(), Error<E>>
pub fn write_byte(&mut self, address: [u8; 2], 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.
sourceimpl<I2C, E, PS> Eeprom24x<I2C, PS>where
I2C: Read<Error = E>,
impl<I2C, E, PS> Eeprom24x<I2C, PS>where
I2C: Read<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.
sourceimpl<I2C, E> Eeprom24x<I2C, No>where
I2C: Write<Error = E> + WriteRead<Error = E>,
impl<I2C, E> Eeprom24x<I2C, No>where
I2C: Write<Error = E> + WriteRead<Error = E>,
Specialization for devices without page access (e.g. 24C00)
sourceimpl<I2C, E> Eeprom24x<I2C, B8>where
I2C: Write<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B8>where
I2C: Write<Error = E>,
Specialization for devices with a page size of 8 bytes.
sourcepub fn new_24x01(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x01(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x01 device (e.g. AT24C01)
sourcepub fn new_24x02(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x02(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x02 device (e.g. AT24C02)
sourcepub fn write_page(
&mut self,
address: [u8; 2],
data: &[u8]
) -> Result<(), Error<E>>
pub fn write_page(
&mut self,
address: [u8; 2],
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. 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.
sourceimpl<I2C, E> Eeprom24x<I2C, B16>where
I2C: Write<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B16>where
I2C: Write<Error = E>,
Specialization for devices with a page size of 16 bytes.
sourcepub fn new_24x04(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x04(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x04 device (e.g. AT24C04)
sourcepub fn new_24x08(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x08(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x08 device (e.g. AT24C08)
sourcepub fn new_24x16(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x16(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x16 device (e.g. AT24C16)
sourcepub fn write_page(
&mut self,
address: [u8; 2],
data: &[u8]
) -> Result<(), Error<E>>
pub fn write_page(
&mut self,
address: [u8; 2],
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. 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.
sourceimpl<I2C, E> Eeprom24x<I2C, B32>where
I2C: Write<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B32>where
I2C: Write<Error = E>,
Specialization for devices with a page size of 32 bytes.
sourcepub fn new_24x32(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x32(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x32 device (e.g. AT24C32)
sourcepub fn new_24x64(i2c: I2C, address: SlaveAddr) -> Self
pub fn new_24x64(i2c: I2C, address: SlaveAddr) -> Self
Create a new instance of a 24x64 device (e.g. AT24C64)
sourcepub fn write_page(
&mut self,
address: [u8; 2],
data: &[u8]
) -> Result<(), Error<E>>
pub fn write_page(
&mut self,
address: [u8; 2],
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. 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.
sourceimpl<I2C, E> Eeprom24x<I2C, B64>where
I2C: Write<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B64>where
I2C: Write<Error = E>,
Specialization for devices with a page size of 64 bytes.
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)
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)
sourcepub fn write_page(
&mut self,
address: [u8; 2],
data: &[u8]
) -> Result<(), Error<E>>
pub fn write_page(
&mut self,
address: [u8; 2],
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. 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.
sourceimpl<I2C, E> Eeprom24x<I2C, B128>where
I2C: Write<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B128>where
I2C: Write<Error = E>,
Specialization for devices with a page size of 128 bytes.
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)
sourcepub fn write_page(
&mut self,
address: [u8; 2],
data: &[u8]
) -> Result<(), Error<E>>
pub fn write_page(
&mut self,
address: [u8; 2],
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. 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.
sourceimpl<I2C, E> Eeprom24x<I2C, B256>where
I2C: Write<Error = E>,
impl<I2C, E> Eeprom24x<I2C, B256>where
I2C: Write<Error = E>,
Specialization for devices with a page size of 256 bytes.
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)
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)
sourcepub fn write_page(
&mut self,
address: [u8; 2],
data: &[u8]
) -> Result<(), Error<E>>
pub fn write_page(
&mut self,
address: [u8; 2],
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. 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.