Merge from triface.
[bertos.git] / mware / prog.h
index ee9c6caef4a935e39eb481c69a6297776ad6b7c1..76685c8775f53f0579840481ccb5378e643e006f 100755 (executable)
@@ -1,17 +1,17 @@
 /**
  * \file
  * <!--
- * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
  * All Rights Reserved.
  * -->
  *
  * \brief Generic program read/write routines interface
- * 
+ *
  * This module implements an interface function for programming
  * a CPU flash memory. To guarantee correct memory writing, we
  * use a rotating hash algorithm.
- * 
- * 
+ *
+ *
  * \version $Id$
  * \author Francesco Sacchi <batt@develer.com>
  * \author Daniele Basile <asterix@develer.com>
 
 #include <cfg/compiler.h>
 #include <kern/kfile.h>
-#include <algos/rotating_hash.h>
-
-/**
- * Generic interface of progress status function.
- * \param value is current progress value
- * \param max is max progress value
- * \return True if programming should continue
- * \return False to stop programming
- */
-typedef bool (*progress_func_t) (int value, int max);
 
 /**
- * Generic interface for programming a CPU flash memory.
- * \param *file is the Kfile pointer to write
- * \param progress is progress fuction pointer, can be NULL if not used
- * \return rotating hash of file written
+ * Prototype of function for manage read/write on
+ * flash memory.
+ *\{
  */
-rotating_t prog_write(struct _KFile *file, progress_func_t progress);
+size_t prog_write(struct _KFile *fd, const void *buf, size_t size);
+bool prog_open(struct _KFile *fd, UNUSED_ARG(const char *, name), UNUSED_ARG(int, mode));
+bool prog_close(struct _KFile *fd);
+bool prog_seek(struct _KFile *fd, int32_t offset);
+size_t prog_read(struct _KFile *fd, void *buf, size_t size);
+bool prog_test(void);
+/* \} */
 
 #endif /* PROG_H */