TB2026-YDS Firmware
Toggle main menu visibility
Loading...
Searching...
No Matches
storage.h
Go to the documentation of this file.
1
20
#pragma once
21
22
#include "esp_err.h"
23
#include <stddef.h>
24
#include <stdbool.h>
25
#include <stdint.h>
26
33
35
#define STORAGE_MAX_TRACKS 512
36
38
#define STORAGE_PATH_MAX 320
39
50
esp_err_t
storage_init
(
void
);
51
59
esp_err_t
storage_rescan
(
void
);
60
69
esp_err_t
storage_unmount
(
void
);
70
75
bool
storage_ready
(
void
);
76
78
size_t
storage_count
(
void
);
79
91
esp_err_t
storage_get_usage
(uint64_t *total_bytes, uint64_t *used_bytes);
92
98
const
char
*
storage_track_path
(
size_t
index);
99
105
const
char
*
storage_track_name
(
size_t
index);
106
119
esp_err_t
storage_scan_dir
(
const
char
*root);
120
125
esp_err_t
storage_deinit
(
void
);
126
storage_track_name
const char * storage_track_name(size_t index)
Display name of a track (file name, no directory prefix).
Definition
storage.c:197
storage_deinit
esp_err_t storage_deinit(void)
Unmount the card and free the index.
Definition
storage.c:207
storage_track_path
const char * storage_track_path(size_t index)
Full POSIX path of a track, ready for decoder_open().
Definition
storage.c:189
storage_scan_dir
esp_err_t storage_scan_dir(const char *root)
Scan an arbitrary directory for playable tracks, rebuilding the index.
Definition
storage.c:87
storage_ready
bool storage_ready(void)
Whether the card is mounted and a scan has completed.
Definition
storage.c:169
storage_init
esp_err_t storage_init(void)
Mount the SD card and scan its root for playable tracks.
Definition
storage.c:117
storage_count
size_t storage_count(void)
Number of tracks in the index (0 before any successful scan).
Definition
storage.c:174
storage_get_usage
esp_err_t storage_get_usage(uint64_t *total_bytes, uint64_t *used_bytes)
Total and used size of the mounted FAT volume, in bytes.
Definition
storage.c:179
storage_unmount
esp_err_t storage_unmount(void)
Unmount the card and invalidate the index, after a card removal.
Definition
storage.c:158
storage_rescan
esp_err_t storage_rescan(void)
Re-scan the (already mounted) card root, rebuilding the track index.
Definition
storage.c:142
components
services
storage
storage.h
Generated by
1.17.0