update credits
[librepilot.git] / flight / pios / inc / pios_flashfs.h
blob05ade924e6005a8195ac61b8bb2e66fe07f7b73f
1 /**
2 ******************************************************************************
3 * @file pios_flashfs.h
4 * @author PhoenixPilot, http://github.com/PhoenixPilot, Copyright (C) 2012
5 * @addtogroup PIOS PIOS Core hardware abstraction layer
6 * @{
7 * @addtogroup PIOS_FLASHFS Flash Filesystem API Definition
8 * @{
9 * @brief Flash Filesystem API Definition
10 *****************************************************************************/
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef PIOS_FLASHFS_H
28 #define PIOS_FLASHFS_H
30 #include <stdint.h>
32 struct PIOS_FLASHFS_Stats {
33 uint16_t num_free_slots; /* slots in free state */
34 uint16_t num_active_slots; /* slots in active state */
37 // define logfs subdirectory of a yaffs flash device
38 #define PIOS_LOGFS_DIR "logfs"
40 int32_t PIOS_FLASHFS_Format(uintptr_t fs_id);
41 int32_t PIOS_FLASHFS_ObjSave(uintptr_t fs_id, uint32_t obj_id, uint16_t obj_inst_id, uint8_t *obj_data, uint16_t obj_size);
42 int32_t PIOS_FLASHFS_ObjLoad(uintptr_t fs_id, uint32_t obj_id, uint16_t obj_inst_id, uint8_t *obj_data, uint16_t obj_size);
43 int32_t PIOS_FLASHFS_ObjDelete(uintptr_t fs_id, uint32_t obj_id, uint16_t obj_inst_id);
44 int32_t PIOS_FLASHFS_GetStats(uintptr_t fs_id, struct PIOS_FLASHFS_Stats *stats);
45 #endif /* PIOS_FLASHFS_H */