2 ******************************************************************************
3 * @file pios_flashfs_logfs_priv.h
4 * @author PhoenixPilot, http://github.com/PhoenixPilot, Copyright (C) 2012
5 * @addtogroup PIOS PIOS Core hardware abstraction layer
7 * @addtogroup PIOS_FLASHFS Flash Filesystem Function
9 * @brief Log Structured Filesystem for internal or external NOR Flash
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
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_LOGFS_PRIV_H
28 #define PIOS_FLASHFS_LOGFS_PRIV_H
31 #include "pios_flash.h" /* struct pios_flash_driver */
33 struct flashfs_logfs_cfg
{
35 uint32_t total_fs_size
; /* Total size of all generations of the filesystem */
36 uint32_t arena_size
; /* Max size of one generation of the filesystem */
37 uint32_t slot_size
; /* Max size of a "file" */
39 uint32_t start_offset
; /* Offset into flash where this filesystem starts */
40 uint32_t sector_size
; /* Size of a flash erase block */
41 uint32_t page_size
; /* Maximum flash burst write size */
44 int32_t PIOS_FLASHFS_Logfs_Init(uintptr_t *fs_id
, const struct flashfs_logfs_cfg
*cfg
, const struct pios_flash_driver
*driver
, uintptr_t flash_id
);
46 int32_t PIOS_FLASHFS_Logfs_Destroy(uintptr_t fs_id
);
48 #endif /* PIOS_FLASHFS_LOGFS_PRIV_H */