Contiki-NG
|
Functions | |
void | xmem_init (void) |
Initialize the external memory. | |
int | xmem_pread (void *buf, int nbytes, unsigned long offset) |
Read a number of bytes from an offset in the external memory. | |
int | xmem_pwrite (const void *buf, int nbytes, unsigned long offset) |
int | xmem_erase (long nbytes, unsigned long offset) |
Erase a sector in the flash memory. | |
The Xmem API module contains functionality to use external flash memories of NOR or NAND type. It us typically used as a back-end for the CFS module.
int xmem_erase | ( | long | nbytes, |
unsigned long | offset ) |
Erase a sector in the flash memory.
nbytes | The number of bytes to erase. |
offset | The offset in the flash memory at which to start erasing. |
Both parameters may have to be a multiple of a value that depends on the particular flash memory used.
Definition at line 128 of file xmem.c.
References addr, ext_flash_close(), ext_flash_erase(), ext_flash_open(), and watchdog_periodic().
int xmem_pread | ( | void * | buf, |
int | nbytes, | ||
unsigned long | offset ) |
Read a number of bytes from an offset in the external memory.
buf | The buffer where the read data is stored. |
nbytes | The number of bytes to read. |
offset | The offset to read from in the flash memory. |
Definition at line 64 of file xmem.c.
References addr, ext_flash_close(), ext_flash_open(), and ext_flash_read().
int xmem_pwrite | ( | const void * | buf, |
int | nbytes, | ||
unsigned long | offset ) |
buf | The buffer that contains the data to write. |
nbytes | The number of bytes to write. |
offset | The offset to write to in the flash memory. |
Definition at line 94 of file xmem.c.
References addr, ext_flash_close(), ext_flash_open(), and ext_flash_write().