RtcNvram

Trait RtcNvram 

Source
pub trait RtcNvram: Rtc {
    // Required methods
    fn read_nvram(
        &mut self,
        offset: u8,
        buffer: &mut [u8],
    ) -> Result<(), Self::Error>;
    fn write_nvram(
        &mut self,
        offset: u8,
        data: &[u8],
    ) -> Result<(), Self::Error>;
    fn nvram_size(&self) -> u16;
}
Expand description

RTC with non-volatile memory (NVRAM/SRAM) access

Required Methods§

Source

fn read_nvram( &mut self, offset: u8, buffer: &mut [u8], ) -> Result<(), Self::Error>

Read data from NVRAM starting at the given offset

§Parameters
  • offset - NVRAM offset (0 = first NVRAM byte, up to device-specific max)
  • buffer - Buffer to store the read data
§Returns
  • Ok(()) on success
  • Err(Self::Error) if offset or length is invalid, or read fails
Source

fn write_nvram(&mut self, offset: u8, data: &[u8]) -> Result<(), Self::Error>

Write data to NVRAM starting at the given offset

§Parameters
  • offset - NVRAM offset (0 = first NVRAM byte, up to device-specific max)
  • data - Data to write to NVRAM
§Returns
  • Ok(()) on success
  • Err(Self::Error) if offset or length is invalid, or write fails
Source

fn nvram_size(&self) -> u16

Get the size of available NVRAM in bytes

§Returns

Total NVRAM size (e.g., 56 for DS1307, 0 for DS3231)

Implementors§