4 * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
8 * \brief Generic program read/write routines interface
10 * This module implements an interface function for programming
11 * a CPU flash memory. To guarantee correct memory writing, we
12 * use a rotating hash algorithm.
16 * \author Francesco Sacchi <batt@develer.com>
17 * \author Daniele Basile <asterix@develer.com>
23 #include <cfg/compiler.h>
24 #include <kern/kfile.h>
25 #include <algos/rotating_hash.h>
28 * Generic interface of progress status function.
29 * \param value is current progress value
30 * \param max is max progress value
31 * \return True if programming should continue
32 * \return False to stop programming
34 typedef bool (*progress_func_t) (int value, int max);
37 * Generic interface for programming a CPU flash memory.
38 * \param *file is the Kfile pointer to write
39 * \param progress is progress fuction pointer, can be NULL if not used
40 * \return rotating hash of file written
42 rotating_t prog_write(struct _KFile *file, progress_func_t progress);