flashif.h 522 Bytes
#ifndef __flashif_h__
#define __flashif_h__

#define NO_ECC  0
#define YES_ECC 1

#define FLASHIF_DEFAULT_NUM_BLKS  (64*1024*1024/BB_FL_BLOCK_SIZE)

typedef struct {
    void *f;
    void* (*open)(void** f, const char* file, int create, int blocks);
    void (*close)(void* f);
    int (*blocks)(void* f);
    int (*read_block)(void* f, u32 addr, void* data, void* spare, int ecc);
    int (*write_block)(void* f, u32 addr, const void* data, const void* spare, int ecc);
} flashif_t;

flashif_t* new_fileif(void);

#endif