You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
726 B

/*
* cfi_flash
*
*/
#ifndef __CFI_FLASH_H__
#define __CFI_FLASH_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
struct cfi_flash {
const char *name;
unsigned int flash_id;
unsigned int size;
unsigned int sector_count;
unsigned long *start;
};
struct cfi_flash_operations {
int (*init)(struct cfi_flash *);
int (*erase)(struct cfi_flash *, int sector);
int (*write)(struct cfi_flash *, unsigned int off, const void *buf, int len);
};
int cfi_flash_make_current(const char *name, struct cfi_flash_operations *xop);
int cfi_flash_erase(unsigned int off, int size);
int cfi_flash_write(unsigned int off, const void *buf, int size);
#ifdef __cplusplus
}
#endif
#endif /* __CFI_FLASH_H__ */