X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Farm.git;a=blobdiff_plain;f=betty%2Fpffs.h;fp=betty%2Fpffs.h;h=92b4821013fdb366185056be1a56d917b93a2228;hp=0000000000000000000000000000000000000000;hb=94909b5b893d5c60bc44bbafec8de1b3c86d9595;hpb=5da509dc909c60d63c5fba98e7ced43040eb6827 diff --git a/betty/pffs.h b/betty/pffs.h new file mode 100644 index 0000000..92b4821 --- /dev/null +++ b/betty/pffs.h @@ -0,0 +1,40 @@ +/* + * pfs.h - pseudo flash filesystem header file + * + * author: hackbard@hackdaworld.org + * + */ + +#ifndef PFFS_H +#define PFFS_H + +#include "lpc2xxx.h" +#include "types.h" + +/* defines */ + +#define PFFS_REGISTERED (1<<0) + +/* type definitions */ + +typedef struct s_pffs { + /* flash specs */ + u32 base_addr; + u8 sec_num; + u32 *sec_addr; + /* flash write, read and sector erase function pointers */ + int (*fw)(u32 addr,u16 *buf,int len); + int (*fr)(u32 addr,u16 *buf,int len); + int (*fe)(u32 addr); + /* pffs internal variables */ + u8 state; + u8 sec_num_data_min; + u8 sec_num_data_max; + u8 sec_num_index[2]; + u32 data_ptr; + u32 index_ptr; +} t_pffs; + +/* function prototypes */ + +#endif