|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Synthesized FAT16 volume helpers for the USB-HS MRAM MSC demo. More...
#include <stdint.h>#include "tx_api.h"#include "ux_api.h"Go to the source code of this file.
Enumerations | |
| enum | demo_config_t : uint32_t { k_demo_thread_stack = 4096U , k_demo_usbx_pool_bytes = 32768U , k_demo_block_size = 512U , k_demo_idle_ticks = 50U } |
| Compile-time settings for the worker thread + USBX pool + RAM-disk geometry. More... | |
| enum | demo_fat_geom_t : uint32_t { k_fat_reserved_sectors = 1U , k_fat_num_fats = 1U , k_fat_fat_sectors = 17U , k_fat_root_entries = 512U , k_fat_root_sectors = 32U , k_fat_data_sectors = 4096U , k_fat_fat_lba = 1U , k_fat_root_lba = 18U , k_fat_data_lba = 50U , k_fat_total_sectors = 4146U , k_fat_first_cluster = 2U , k_fat_mram_clusters = 2048U , k_fat_last_mram_clus = 2049U , k_fat_entries_per_sec = 256U , k_fat_eoc = 0xFFFFU , k_fat_entry0 = 0xFFF8U } |
| Synthesized FAT16 volume geometry (MS FAT spec 1.03). More... | |
Functions | |
| void | demo_fat_fill_sector (uint32_t lba, UCHAR *out) |
| Synthesize one 512-byte sector of the read-only volume. | |
Synthesized FAT16 volume helpers for the USB-HS MRAM MSC demo.
Declares the read-only FAT16 sector-synthesis API shared between the application entry (main.c) and its implementation sibling (usb_msc_mram_hs_steps.c). The volume's boot sector, FAT, and root directory are generated on the fly; data clusters map 1:1 onto the chip's 1 MiB MRAM window at 0x02000000, exposed as a single root file MRAM.BIN. Only demo_fat_fill_sector() is called from the MSC media-read callback in main.c; the lower-level fillers stay private to the sibling. The shared geometry/config enums live here so both translation units agree on the volume layout and block size.
Definition in file usb_msc_mram_hs_steps.h.
| enum demo_config_t : uint32_t |
Compile-time settings for the worker thread + USBX pool + RAM-disk geometry.
Definition at line 35 of file usb_msc_mram_hs_steps.h.
| enum demo_fat_geom_t : uint32_t |
Synthesized FAT16 volume geometry (MS FAT spec 1.03).
One 512-byte sector per cluster. The data region is padded to 4096 clusters so the cluster count crosses the 4085 FAT16 threshold; only the first 2048 clusters (1 MiB) are backed by MRAM, and nothing references the rest. FAT16 needs 2 bytes per entry for 4098 entries = 8196 bytes = 17 sectors. The root directory holds 512 entries = 32 sectors.
Definition at line 53 of file usb_msc_mram_hs_steps.h.
| void demo_fat_fill_sector | ( | uint32_t | lba, |
| UCHAR * | out ) |
Synthesize one 512-byte sector of the read-only volume.
Dispatches on the LBA: boot sector, FAT, root directory, or data region. Data sectors inside the MRAM.BIN chain are copied straight out of the 1 MiB MRAM window; padding clusters past the chain read as zeros.
| [in] | lba | Logical block address inside the volume. |
| [out] | out | 512-byte destination buffer. |
lba is below k_fat_total_sectors (caller-checked). out has 512 writable bytes. out holds the synthesized sector content. Definition at line 199 of file usb_msc_mram_steps.c.
References demo_fat_fill_boot(), demo_fat_fill_fat(), demo_fat_fill_root(), k_demo_block_size, k_fat_data_lba, k_fat_fat_lba, k_fat_first_cluster, k_fat_last_mram_clus, k_fat_root_lba, k_mram_base_addr, memcpy(), and memset().