nvmem_at45d.c File Reference

Non-volatile memory support using Atmel AT45 serial DataFlash memory chips. More...

Go to the source code of this file.

Functions

size_t SpiAt45dConfigSize (void)
 Get size of configuration area.
int SpiAt45dConfigRead (size_t pos, void *data, size_t len)
 Load configuration parameters from flash memory.
int SpiAt45dConfigWrite (size_t pos, CONST void *data, size_t len)
 Store configuration parameters in flash memory.

Detailed Description

Non-volatile memory support using Atmel AT45 serial DataFlash memory chips.

 * $Id: nvmem_at45d.c 2463 2009-02-13 14:52:05Z haraldkipp $
 * 

Definition in file nvmem_at45d.c.


Function Documentation

size_t SpiAt45dConfigSize ( void   ) 

Get size of configuration area.

A part of the DataFlash may be used to store configuration parameters, like the network interface MAC address, the local hostname etc. The size of this area may be configured by defining NUT_CONFIG_AT45D_SIZE. Otherwise one full page is used.

Returns:
The number of bytes available for configuration data. In case of an error, -1 is returned.

Definition at line 134 of file nvmem_at45d.c.

References NUTASSERT, and SpiAt45dPageSize().

Referenced by SpiAt45dConfigRead(), and SpiAt45dConfigWrite().

int SpiAt45dConfigRead ( size_t  pos,
void *  data,
size_t  len 
)

Load configuration parameters from flash memory.

Parameters:
pos Start location within configuration sector.
data Points to a buffer that receives the contents.
len Number of bytes to read.
Returns:
0 on success or -1 in case of an error.

Definition at line 158 of file nvmem_at45d.c.

References free, malloc, memcpy(), SpiAt45dConfigSize(), and SpiAt45dPageRead().

Referenced by NutNvMemLoad().

int SpiAt45dConfigWrite ( size_t  pos,
CONST void *  data,
size_t  len 
)

Store configuration parameters in flash memory.

Parameters:
pos Start location within configuration sector.
data Points to a buffer that contains the bytes to store.
len Number of bytes to store.
Returns:
0 on success or -1 in case of an error.

Definition at line 187 of file nvmem_at45d.c.

References free, malloc, memcmp(), memcpy(), SpiAt45dConfigSize(), SpiAt45dPageRead(), and SpiAt45dPageWrite().

Referenced by NutNvMemSave().


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/