K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches

Public Headers

file  storage.h
 

Data Structures

struct  kfsw_storage_info
 

Macros

#define KFSW_STORAGE_MOUNT_POINT   "/kfsw"
 
#define KFSW_STORAGE_TMP_MOUNT_POINT   KFSW_STORAGE_MOUNT_POINT "/tmp"
 

Functions

int kfsw_storage_init (void)
 
int kfsw_storage_mount (void)
 
int kfsw_storage_unmount (void)
 
bool kfsw_storage_is_ready (void)
 
int kfsw_storage_get_info (struct kfsw_storage_info *info)
 
int kfsw_storage_tmp_mount (void)
 
int kfsw_storage_get_tmp_info (struct kfsw_storage_info *info)
 

Description

LittleFS setup, mount and capacity.

Initialize with kfsw_storage_init(), mount with kfsw_storage_mount(), and query state with kfsw_storage_get_info(). Services use Zephyr filesystem calls after kfsw_storage_is_ready() reports true.

Macro Documentation

◆ KFSW_STORAGE_TMP_MOUNT_POINT

#define KFSW_STORAGE_TMP_MOUNT_POINT   KFSW_STORAGE_MOUNT_POINT "/tmp"

#include <storage.h>

RAM scratch volume, empty after every boot.

Function Documentation

◆ kfsw_storage_get_info()

int kfsw_storage_get_info ( struct kfsw_storage_info *  info)

#include <storage.h>

Read current K-FSW storage information.

Capacity values are reported only while the volume is mounted.

Parameters
[out]infoStorage information.
Return values
0Information was returned successfully.
-EINVALinfo is NULL.
Returns
A negative errno value if mounted volume statistics cannot be read.

◆ kfsw_storage_get_tmp_info()

int kfsw_storage_get_tmp_info ( struct kfsw_storage_info *  info)

#include <storage.h>

Read the RAM scratch volume's information, as kfsw_storage_get_info().

Return values
-ENOTSUPThe composition has no RAM volume.

◆ kfsw_storage_init()

int kfsw_storage_init ( void  )

#include <storage.h>

Initialize the configured flash storage backend.

Repeated successful calls are harmless. This does not mount or format the filesystem.

Return values
0The backend is initialized and available.
Returns
A negative errno value on failure.

◆ kfsw_storage_is_ready()

bool kfsw_storage_is_ready ( void  )

#include <storage.h>

Returns
true when the K-FSW volume is mounted and usable.

◆ kfsw_storage_mount()

int kfsw_storage_mount ( void  )

#include <storage.h>

Mount the K-FSW storage volume.

Repeated successful calls are harmless. If the initial no-format mount reports a corrupt filesystem and every byte in the partition still has the flash erase value, the partition is treated as first-boot media, formatted, and mounted once more. Non-erased media is never automatically formatted.

Return values
0The volume is mounted and ready.
Returns
A negative errno value on failure.

◆ kfsw_storage_tmp_mount()

int kfsw_storage_tmp_mount ( void  )

#include <storage.h>

Format and mount the RAM scratch volume at KFSW_STORAGE_TMP_MOUNT_POINT.

It is formatted on every call, so it starts empty after a reset even where the RAM keeps its contents. Repeated calls while mounted are harmless.

Return values
0The volume is mounted and empty.
-ENOTSUPThe composition has no RAM volume.
Returns
A negative errno value on failure.

◆ kfsw_storage_unmount()

int kfsw_storage_unmount ( void  )

#include <storage.h>

Unmount the K-FSW storage volume.

Repeated calls while unmounted are harmless.

Return values
0The volume is unmounted.
Returns
A negative errno value on failure.