62typedef enum : uint32_t {
82typedef enum : uint64_t {
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Minimal FAT12/FAT16/FAT32 filesystem adapter (read + write).
ra8_fs_alloc_const_t
Sentinels and bounds for the per-mount allocator state.
@ k_fs_fsinfo_absent
No usable FSInfo sector on this vol.
@ k_fs_alloc_slots
One state slot per mount slot.
@ k_fs_free_unknown
MS FAT spec sec 5: count not known.
ra8_err_t priv_fsinfo_seed(const ra8_fs_mount_t *m)
Validate FAT32's FSInfo sector and seed the hint and free count.
void priv_free_count_took(const ra8_fs_mount_t *m, uint32_t n)
Account n clusters as taken out of the volume's free space.
void priv_free_count_gave(const ra8_fs_mount_t *m, uint32_t n)
Account n clusters as returned to the volume's free space.
uint32_t priv_free_count_peek(const ra8_fs_mount_t *m)
Report the tracked free-cluster count, or k_fs_free_unknown.
void priv_alloc_hint_lower(const ra8_fs_mount_t *m, uint32_t cluster)
Pull the next-free hint back to cluster if it is further on.
void priv_alloc_state_bind(const ra8_fs_mount_t *m)
Claim and reset the allocator state slot for a freshly mounted volume.
void priv_fat_sector_wrote(const ra8_fs_mount_t *m, const uint8_t *buf, uint64_t lba)
Tell the cache that lba has just been written with buf.
void priv_alloc_hint_set(const ra8_fs_mount_t *m, uint32_t cluster)
Move the next-free hint forward to cluster.
ra8_err_t priv_fsinfo_flush(const ra8_fs_mount_t *m)
Write the tracked free count and next-free hint back into FSInfo.
ra8_err_t priv_fat_sector_read(const ra8_fs_mount_t *m, uint64_t lba, uint8_t *buf)
Read one FAT sector, through the shared one-sector cache.
ra8_err_t priv_exfat_bitmap_lba(const ra8_fs_mount_t *m, uint64_t *out_lba)
Resolve the exFAT allocation bitmap's first LBA, once per mount.
void priv_alloc_state_release(const ra8_fs_mount_t *m)
Release the allocator state slot held by m.
uint32_t priv_alloc_hint_get(const ra8_fs_mount_t *m)
Report the cluster a free-space scan should start from.
ra8_fs_alloc_lba_const_t
64-bit LBA sentinels for the per-mount allocator state.
@ k_fs_cache_empty
Cache holds no sector.
@ k_fs_bitmap_unknown
exFAT bitmap LBA not resolved yet.
void priv_free_count_cache(const ra8_fs_mount_t *m, uint32_t n)
Cache a freshly counted free-cluster total in the allocator slot.
Cached parse of one mounted FAT volume.