Merge from triface.
[bertos.git] / mware / prog.h
1 /**
2  * \file
3  * <!--
4  * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
5  * All Rights Reserved.
6  * -->
7  *
8  * \brief Generic program read/write routines interface
9  *
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.
13  *
14  *
15  * \version $Id$
16  * \author Francesco Sacchi <batt@develer.com>
17  * \author Daniele Basile <asterix@develer.com>
18  */
19
20 #ifndef PROG_H
21 #define PROG_H
22
23 #include <cfg/compiler.h>
24 #include <kern/kfile.h>
25
26 /**
27  * Prototype of function for manage read/write on
28  * flash memory.
29  *\{
30  */
31 size_t  prog_write(struct _KFile *fd, const void *buf, size_t size);
32 bool prog_open(struct _KFile *fd, UNUSED_ARG(const char *, name), UNUSED_ARG(int, mode));
33 bool prog_close(struct _KFile *fd);
34 bool prog_seek(struct _KFile *fd, int32_t offset);
35 size_t  prog_read(struct _KFile *fd, void *buf, size_t size);
36 bool prog_test(void);
37 /* \} */
38
39 #endif /* PROG_H */