X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=mware%2Fprog.h;fp=mware%2Fprog.h;h=76685c8775f53f0579840481ccb5378e643e006f;hb=732f02c7bf4bb42dec29af588556a76bde861508;hp=ee9c6caef4a935e39eb481c69a6297776ad6b7c1;hpb=4b45b32f0e5a6ac043c8d80aac8576b25f24fdd9;p=bertos.git diff --git a/mware/prog.h b/mware/prog.h index ee9c6cae..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 @@ -22,23 +22,18 @@ #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); /** - * 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 */