Non-volatile memory support using Atmel AT45 serial DataFlash memory chips. More...
#include <cfg/eeprom.h>
#include <cfg/memory.h>
#include <dev/board.h>
#include <dev/spi_at45d.h>
#include <sys/nutdebug.h>
#include <stdlib.h>
#include <string.h>
#include <memdebug.h>
#include <dev/nvmem_at45d.h>
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. |
Non-volatile memory support using Atmel AT45 serial DataFlash memory chips.
* $Id: nvmem_at45d.c 3560 2011-08-16 10:53:31Z haraldkipp $ *
Definition in file nvmem_at45d.c.
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.
Definition at line 134 of file nvmem_at45d.c.
References SpiAt45dPageSize().
Referenced by ShowHardwareConfiguration(), SpiAt45dConfigRead(), and SpiAt45dConfigWrite().
int SpiAt45dConfigRead | ( | size_t | pos, |
void * | data, | ||
size_t | len | ||
) |
Load configuration parameters from flash memory.
pos | Start location within configuration sector. |
data | Points to a buffer that receives the contents. |
len | Number of bytes to read. |
Definition at line 157 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.
pos | Start location within configuration sector. |
data | Points to a buffer that contains the bytes to store. |
len | Number of bytes to store. |
Definition at line 187 of file nvmem_at45d.c.
References free(), malloc(), memcmp(), memcpy(), SpiAt45dConfigSize(), SpiAt45dPageRead(), SpiAt45dPageSize(), SpiAt45dPageWrite(), and wsize.
Referenced by NutNvMemSave().