ChaosDMX
Open-Source DMX-Interface
Loading...
Searching...
No Matches
storage.h File Reference
#include "esp_err.h"
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for storage.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  storage_info_t
 Storage information structure. More...

Functions

esp_err_t storage_init (void)
 Initialize and mount LittleFS filesystem.
bool storage_is_mounted (void)
 Check if the storage is mounted and ready.
const char * storage_get_mount_point (void)
 Get the mount point for the LittleFS filesystem.
const char * storage_get_partition_label (void)
 Get the partition label for the LittleFS filesystem.
esp_err_t storage_get_info (storage_info_t *info)
 Get comprehensive storage information.
void storage_print_info (void)
 Print storage information to the log.
size_t storage_get_total_bytes (void)
 Get the total size of the storage in bytes.
size_t storage_get_used_bytes (void)
 Get the used size of the storage in bytes.
size_t storage_get_free_bytes (void)
 Get the free size of the storage in bytes.

Function Documentation

◆ storage_get_free_bytes()

size_t storage_get_free_bytes ( void )

Get the free size of the storage in bytes.

Returns
Free size in bytes, or 0 on error

Definition at line 121 of file storage.c.

References storage_info_t::free_bytes, and storage_get_info().

Here is the call graph for this function:

◆ storage_get_info()

esp_err_t storage_get_info ( storage_info_t * info)

Get comprehensive storage information.

Parameters
[out]infoPointer to storage_info_t structure to fill
Returns
ESP_OK on success, error code otherwise

Definition at line 58 of file storage.c.

References storage_info_t::free_bytes, is_mounted, LITTLEFS_PARTITION_LABEL, storage_info_t::total_bytes, and storage_info_t::used_bytes.

Referenced by storage_get_free_bytes(), storage_get_total_bytes(), storage_get_used_bytes(), and storage_print_info().

Here is the caller graph for this function:

◆ storage_get_mount_point()

const char * storage_get_mount_point ( void )

Get the mount point for the LittleFS filesystem.

Returns
Pointer to the mount point string (e.g., "/data")

Definition at line 52 of file storage.c.

References LITTLEFS_MOUNT_POINT.

Referenced by static_file_handler().

Here is the caller graph for this function:

◆ storage_get_partition_label()

const char * storage_get_partition_label ( void )

Get the partition label for the LittleFS filesystem.

Returns
Pointer to the partition label string

Definition at line 54 of file storage.c.

References LITTLEFS_PARTITION_LABEL.

◆ storage_get_total_bytes()

size_t storage_get_total_bytes ( void )

Get the total size of the storage in bytes.

Returns
Total size in bytes, or 0 on error

Definition at line 105 of file storage.c.

References storage_get_info(), and storage_info_t::total_bytes.

Here is the call graph for this function:

◆ storage_get_used_bytes()

size_t storage_get_used_bytes ( void )

Get the used size of the storage in bytes.

Returns
Used size in bytes, or 0 on error

Definition at line 113 of file storage.c.

References storage_get_info(), and storage_info_t::used_bytes.

Here is the call graph for this function:

◆ storage_init()

esp_err_t storage_init ( void )

Initialize and mount LittleFS filesystem.

Returns
ESP_OK on success, error code otherwise

Definition at line 15 of file storage.c.

References is_mounted, LITTLEFS_MOUNT_POINT, LITTLEFS_PARTITION_LABEL, LOGE, and LOGI.

Referenced by webserver_start().

Here is the caller graph for this function:

◆ storage_is_mounted()

bool storage_is_mounted ( void )

Check if the storage is mounted and ready.

Returns
true if mounted, false otherwise

Definition at line 50 of file storage.c.

References is_mounted.

◆ storage_print_info()

void storage_print_info ( void )

Print storage information to the log.

Definition at line 80 of file storage.c.

References storage_info_t::free_bytes, is_mounted, LITTLEFS_MOUNT_POINT, LITTLEFS_PARTITION_LABEL, LOGE, LOGI, storage_get_info(), storage_info_t::total_bytes, and storage_info_t::used_bytes.

Referenced by app_main().

Here is the call graph for this function:
Here is the caller graph for this function: