X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=mware%2Fprog.h;h=76685c8775f53f0579840481ccb5378e643e006f;hb=c2fdd9fdabea8688dfe7d841c53b842a1ebe8a35;hp=f197975d5d86a571864f6c2f2f141f64a182763e;hpb=594bfc507f2901777e93ca03fa34f4245a752b35;p=bertos.git diff --git a/mware/prog.h b/mware/prog.h index f197975d..76685c87 100755 --- a/mware/prog.h +++ b/mware/prog.h @@ -1,17 +1,17 @@ /** * \file * * * \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 * \author Daniele Basile @@ -21,24 +21,19 @@ #define PROG_H #include -#include -#include - -/** - * 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); +#include /** - * 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 */