Contiki-NG
Loading...
Searching...
No Matches
xmem.c File Reference

Device driver for the ST M25P16 40MHz 1Mbyte external memory. More...

#include <stdio.h>
#include <string.h>
#include "contiki.h"
#include "dev/spi-legacy.h"
#include "dev/xmem.h"
#include "dev/watchdog.h"

Go to the source code of this file.

Functions

void xmem_init (void)
 Initialize the external memory.
 
int xmem_pread (void *_p, int size, unsigned long offset)
 Read a number of bytes from an offset in the external memory.
 
int xmem_pwrite (const void *_buf, int size, unsigned long addr)
 
int xmem_erase (long size, unsigned long addr)
 Erase a sector in the flash memory.
 

Detailed Description

Device driver for the ST M25P16 40MHz 1Mbyte external memory.

Author
Björn Grönvall bg@si.nosp@m.cs.s.nosp@m.e Enric M. Calvo ecalv.nosp@m.o@zo.nosp@m.lerti.nosp@m.a.co.nosp@m.m

Data is written bit inverted (~-operator) to flash so that unwritten data will read as zeros (UNIX style).

Definition in file xmem.c.