Nut/OS  4.10.3
API Reference
nvmem_at45d.h File Reference
#include <sys/types.h>
Include dependency graph for nvmem_at45d.h:
This graph shows which files directly or indirectly include this file:

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.

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, 0 is returned.

Definition at line 134 of file nvmem_at45d.c.

References SpiAt45dPageSize().

Referenced by ShowHardwareConfiguration(), SpiAt45dConfigRead(), and SpiAt45dConfigWrite().

Here is the call graph for this function:

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

Load configuration parameters from flash memory.

Parameters:
posStart location within configuration sector.
dataPoints to a buffer that receives the contents.
lenNumber of bytes to read.
Returns:
0 on success or -1 in case of an error.

Definition at line 157 of file nvmem_at45d.c.

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

Referenced by NutNvMemLoad().

Here is the call graph for this function:

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

Store configuration parameters in flash memory.

Parameters:
posStart location within configuration sector.
dataPoints to a buffer that contains the bytes to store.
lenNumber 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(), SpiAt45dPageSize(), SpiAt45dPageWrite(), and wsize.

Referenced by NutNvMemSave().

Here is the call graph for this function: