Non-volatile RAM

Non-volatile RAM interface.

This API is designed around non-volatile memories which do not need blockwise erase, such as ferro-electric RAM (FRAM) or magneto-resistive RAM (MRAM).

This interface is not suitable for flash memories.

struct nvram nvram_t

Device descriptor for generic NVRAM devices.

struct nvram

Device descriptor for generic NVRAM devices.

int(* read()

Pointer to device-specific read function.

Copy data from system memory to NVRAM.

Parameters

dev:Pointer to NVRAM device descriptor
dst:Pointer to the first byte in the system memory address space
src:Starting address in the NVRAM device address space
len:Number of bytes to copy

Return values

  • Number of bytes read on success
  • <0 on errors
int(* write()

Pointer to device-specific write function.

Copy data from NVRAM to system memory.

Parameters

dev:Pointer to NVRAM device descriptor
src:Pointer to the first byte in the system memory address space
dst:Starting address in the NVRAM device address space
len:Number of bytes to copy

Return values

  • Number of bytes written on success
  • <0 on errors
msp430_types.h::size_t size

Device capacity.

void * extra

Device-specific parameters, if any.