first pseudo flash filesystem code (not working yet)
[my-code/arm.git] / betty / pffs.h
diff --git a/betty/pffs.h b/betty/pffs.h
new file mode 100644 (file)
index 0000000..92b4821
--- /dev/null
@@ -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