[−][src]Struct microchip_eeprom_25lcxx::Eeprom25x
Implementations
impl<SPI, CS, WP, HOLD, SpiError, PinError> Eeprom25x<SPI, CS, WP, HOLD> where
SPI: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
CS: OutputPin<Error = PinError>,
WP: OutputPin<Error = PinError>,
HOLD: OutputPin<Error = PinError>,
[src]
SPI: Transfer<u8, Error = SpiError> + Write<u8, Error = SpiError>,
CS: OutputPin<Error = PinError>,
WP: OutputPin<Error = PinError>,
HOLD: OutputPin<Error = PinError>,
pub fn new(
spi: SPI,
cs: CS,
wp: WP,
hold: HOLD
) -> Result<Self, Error<SpiError, PinError>>
[src]
spi: SPI,
cs: CS,
wp: WP,
hold: HOLD
) -> Result<Self, Error<SpiError, PinError>>
Initializes the EEPROM device
Checks if the manufacturer ID is correct otherwise returns an error. Makes sure that you can't write to the status register and also that the device is in deep sleep mode. Also the chip hold is removed
pub fn status(&mut self) -> Result<Status, Error<SpiError, PinError>>
[src]
Returns the status of the chip
pub fn set_array_write_protection(
&mut self,
level: WriteProtection
) -> Result<(), Error<SpiError, PinError>>
[src]
&mut self,
level: WriteProtection
) -> Result<(), Error<SpiError, PinError>>
Set the array write protection level It can be the first 1/4, 1/2 or whole chip length Will return the chip in writing to status register disabled
pub fn error_on_writing(&mut self) -> Result<Status, Error<SpiError, PinError>>
[src]
Returns the status of the chip or an error if it is busy writing
pub fn erase(
&mut self,
address: u32,
erase: Erase
) -> Result<(), Error<SpiError, PinError>>
[src]
&mut self,
address: u32,
erase: Erase
) -> Result<(), Error<SpiError, PinError>>
Erase parts of the chip. Can be a page, a sector or the whole chip
pub fn hold_transfer(
&mut self,
enabled: bool
) -> Result<(), Error<SpiError, PinError>>
[src]
&mut self,
enabled: bool
) -> Result<(), Error<SpiError, PinError>>
Keep the device from clocking out data, or enable it to do so
pub fn release_from_deep_sleep_and_get_manufacturer_id(
&mut self
) -> Result<u8, Error<SpiError, PinError>>
[src]
&mut self
) -> Result<u8, Error<SpiError, PinError>>
Wake up the chip and also return the manufacturer ID
pub fn deep_sleep(&mut self) -> Result<(), Error<SpiError, PinError>>
[src]
Put the device in deep sleep mode
pub fn disable_write_to_status(
&mut self
) -> Result<(), Error<SpiError, PinError>>
[src]
&mut self
) -> Result<(), Error<SpiError, PinError>>
Disable writing to the status register
pub fn enable_write_to_status(
&mut self
) -> Result<(), Error<SpiError, PinError>>
[src]
&mut self
) -> Result<(), Error<SpiError, PinError>>
Enable writing to the status register
pub fn write_enable(&mut self) -> Result<(), Error<SpiError, PinError>>
[src]
Put the write protection down
pub fn write_disable(&mut self) -> Result<(), Error<SpiError, PinError>>
[src]
Enable write protection
pub fn transfer(
&mut self,
bytes: &mut [u8]
) -> Result<(), Error<SpiError, PinError>>
[src]
&mut self,
bytes: &mut [u8]
) -> Result<(), Error<SpiError, PinError>>
Transfer over the SPI
Auto Trait Implementations
impl<SPI, CS, WP, HOLD> Send for Eeprom25x<SPI, CS, WP, HOLD> where
CS: Send,
HOLD: Send,
SPI: Send,
WP: Send,
CS: Send,
HOLD: Send,
SPI: Send,
WP: Send,
impl<SPI, CS, WP, HOLD> Sync for Eeprom25x<SPI, CS, WP, HOLD> where
CS: Sync,
HOLD: Sync,
SPI: Sync,
WP: Sync,
CS: Sync,
HOLD: Sync,
SPI: Sync,
WP: Sync,
impl<SPI, CS, WP, HOLD> Unpin for Eeprom25x<SPI, CS, WP, HOLD> where
CS: Unpin,
HOLD: Unpin,
SPI: Unpin,
WP: Unpin,
CS: Unpin,
HOLD: Unpin,
SPI: Unpin,
WP: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,