38typedef enum : uint8_t {
59typedef enum : uint16_t {
78typedef enum : uint32_t {
91typedef enum : uint8_t {
101typedef enum : uint8_t {
115typedef enum : uint8_t {
442typedef enum : uint8_t {
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_fs_fat_limit_t
The FAT12/16/32 per-file size ceiling.
@ k_ra8_fs_fat_max_file_bytes
4 GiB - 1: max DIR_FileSize.
ra8_fs_partition_sel_t
Sentinel partition index requesting auto-selection.
@ k_ra8_fs_partition_auto
Auto-select the first mountable partition.
ra8_fs_type_t
FAT variant detected from the BPB cluster-count rule.
@ k_ra8_fs_type_fat12
count_of_clusters < 4085.
@ k_ra8_fs_type_fat32
count_of_clusters >= 65525.
@ k_ra8_fs_type_exfat
exFAT (read + streaming write + format).
@ k_ra8_fs_type_fat16
4085 <= count_of_clusters < 65525.
@ k_ra8_fs_type_unknown
Not yet detected / mount failed.
ra8_fs_attr_t
8-bit FAT attribute byte (MS FAT spec sec 6 "DIR_Attr").
@ k_ra8_fs_attr_lfn
Long-file-name marker (we skip).
@ k_ra8_fs_attr_volume_id
MS FAT spec sec 6 "ATTR_VOLUME_ID".
@ k_ra8_fs_attr_system
MS FAT spec sec 6 "ATTR_SYSTEM".
@ k_ra8_fs_attr_directory
MS FAT spec sec 6 "ATTR_DIRECTORY".
@ k_ra8_fs_attr_archive
MS FAT spec sec 6 "ATTR_ARCHIVE".
@ k_ra8_fs_attr_read_only
MS FAT spec sec 6 "ATTR_READ_ONLY".
@ k_ra8_fs_attr_hidden
MS FAT spec sec 6 "ATTR_HIDDEN".
ra8_fs_limits_t
Static-allocation limits for the FAT filesystem adapter.
@ k_ra8_fs_short_name_len
8.3 short name "AAAAAAAA.EXT" + NUL.
@ k_ra8_fs_max_mounts
Max concurrent mount points.
@ k_ra8_fs_max_files
Max concurrent open file handles.
ra8_fs_mode_t
File-open modes accepted by ra8_fs_open().
@ k_ra8_fs_mode_append
Open at EOF for writing.
@ k_ra8_fs_mode_read
Read-only, must exist.
@ k_ra8_fs_mode_write
Truncate (or create) for writing.
void(* ra8_fs_listdir_cb_t)(const char *name, uint8_t attr, uint64_t size, void *ctx)
Callback invoked once per directory entry by ra8_fs_listdir().
ra8_fs_byte_sizes_t
Byte-size constants used by the FAT layout.
@ k_ra8_fs_dir_name_cap
Longest listed UTF-8 name plus NUL.
@ k_ra8_fs_dir_entry_bytes
MS FAT spec sec 6 "Directory Entry".
@ k_ra8_fs_sector_max
Largest supported sector size (4Kn).
@ k_ra8_fs_dir_state_bytes
Opaque caller-owned cursor state.
@ k_ra8_fs_sector_min
Smallest supported sector size.
Block-device interface that ra8_fs runs on top of.
ra8_err_t(* read_block)(void *ctx, uint64_t lba, uint32_t count, uint8_t *buf)
Read count consecutive blocks starting at lba.
ra8_err_t(* write_block)(void *ctx, uint64_t lba, uint32_t count, const uint8_t *buf)
Write count consecutive blocks starting at lba.
ra8_err_t(* erase_blocks)(void *ctx, uint64_t lba, uint64_t count)
OPTIONAL: bulk-erase count blocks at lba to all-zero bytes.
void * ctx
Caller-owned context passed back into the function pointers.
ra8_err_t(* get_capacity)(void *ctx, uint64_t *block_count, uint32_t *block_size)
Report the device size.
Broken-down civil date and time used at the filesystem boundary.
uint8_t hour
Hour of day, 0..23.
uint8_t minute
Minute of hour, 0..59.
int16_t utc_offset_min
Offset of the civil fields from UTC, in minutes.
uint8_t second
Second of minute, 0..59.
uint8_t month
Month of year, 1..12.
uint8_t centisecond
Hundredths within second, 0..99.
uint16_t year
Full civil year, e.g.
uint8_t day
Day of month, 1..31.
Caller-owned opaque directory cursor.
uint8_t state[k_ra8_fs_dir_state_bytes]
Opaque cursor state.
bool is_open
Facade lifecycle guard.
Stable directory-entry value copied by ra8_fs_dir_next.
char name[k_ra8_fs_dir_name_cap]
NUL-terminated visible leaf.
uint8_t attr
On-disk FAT attributes.
uint64_t size_bytes
File bytes; zero for dirs.
uint32_t entry_set_cluster
exFAT: dir cluster of the File entry.
uint32_t tail_cluster
exFAT: last cluster of the allocation.
uint64_t size_bytes
File size (DIR_FileSize / DataLength).
uint64_t valid_bytes
exFAT ValidDataLength (bytes written).
uint64_t offset
Current read/write offset.
uint32_t alloc_clusters
exFAT: clusters currently allocated.
uint32_t first_cluster
Head of the file's cluster chain.
uint32_t entry_set_count
exFAT: 1 + SecondaryCount.
uint8_t in_use
0 = slot free, 1 = open.
uint32_t dir_entry_idx
FAT: byte offset of the entry in it.
uint32_t walk_cache_cluster
Cluster at walk_cache_idx; < 2 = no cache.
ra8_fs_mode_t mode
Open mode.
uint8_t no_fat_chain
exFAT contiguous file (no FAT walk).
uint32_t cur_cluster
Cluster the offset currently points into.
uint8_t dirty
1 once written; drives the close mtime.
uint32_t entry_set_index
exFAT: entry index of the File entry.
uint64_t dir_entry_lba
FAT: sector containing the dir entry.
ra8_fs_mount_t * mount
Owning mount point.
uint32_t walk_cache_idx
Chain index whose cluster is cached below.
Cached parse of one mounted FAT volume.
uint32_t reserved_sectors
BPB BPB_RsvdSecCnt.
uint32_t root_cluster
BPB BPB_RootClus (FAT32 only).
uint8_t exfat_upcase_ok
exFAT: volume's up-case table is ours.
ra8_fs_type_t type
FAT12 / FAT16 / FAT32.
uint32_t bytes_per_sector
Sector size (BPB / VBR == backend).
uint32_t root_entries
BPB BPB_RootEntCnt (FAT12/16).
uint64_t total_sectors
BPB TotSec / exFAT VolumeLength.
uint32_t sectors_per_cluster
BPB BPB_SecPerClus.
uint32_t num_fats
BPB BPB_NumFATs.
ra8_fs_backend_t backend
Block-device backend.
uint32_t fat_size_sectors
BPB BPB_FATSz16 / BPB_FATSz32.
uint64_t first_root_lba
FAT12/16 fixed root-dir start.
uint64_t partition_base_lba
MBR/GPT partition start (0 = superfloppy).
uint32_t count_of_clusters
Per MS spec: data_sectors / SPC.
uint64_t first_data_lba
First sector of the data region.
uint64_t first_fat_lba
Computed: first FAT sector.
uint8_t in_use
0 = slot free, 1 = mounted.
What ra8_fs_stat() read out of a directory entry.
ra8_fs_timestamp_t accessed
Last-accessed timestamp (date-only on FAT).
uint32_t first_cluster
Head of the entry's cluster chain (0 if empty).
uint8_t attr
The entry's own FAT attribute byte.
uint64_t size_bytes
File length in bytes; 0 for a directory.
ra8_fs_timestamp_t modified
Last-modified timestamp.
bool is_directory
true => the ATTR_DIRECTORY bit is set.
ra8_fs_timestamp_t created
Creation timestamp, or invalid for the root.
One decoded on-disk timestamp plus availability facts.
ra8_fs_datetime_t value
Decoded civil date/time.
bool valid
true => the on-disk date is legal.
bool utc_offset_valid
true => utc_offset_min is known.