K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches
storage.h File Reference
#include <stdbool.h>
#include <stdint.h>

Data Structures

struct  kfsw_storage_info
 

Macros

#define KFSW_STORAGE_MOUNT_POINT   "/kfsw"
 

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)
 

Description

LittleFS setup, mount and capacity API.

Function Documentation

◆ kfsw_storage_get_info()

int kfsw_storage_get_info ( struct kfsw_storage_info *  info)

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_init()

int kfsw_storage_init ( void  )

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  )
Returns
true when the K-FSW volume is mounted and usable.

◆ kfsw_storage_mount()

int kfsw_storage_mount ( void  )

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_unmount()

int kfsw_storage_unmount ( void  )

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.