ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
usb_host_file_ops_steps.h
Go to the documentation of this file.
1
22
23#pragma once
24
25#include <stdint.h>
26
27#include "ra8_err.h"
28#include "ra8_fs.h"
29#include "ra8_usb.h"
30#include "ra8_usb_hmsc.h"
31
32/* =============================================================================
33 * Compile-time configuration (shared between main.c and the steps TU)
34 * =============================================================================
35 */
36
48
53typedef enum : uint16_t {
57
69
74typedef enum : uint32_t {
78
90
91/* =============================================================================
92 * Console helpers
93 * =============================================================================
94 */
95
109[[nodiscard]] ra8_err_t fileops_print(const char* text);
110
124[[nodiscard]] ra8_err_t fileops_print_dec(uint64_t value);
125
140[[nodiscard]] ra8_err_t fileops_print_hex(uint32_t value, uint8_t digits);
141
156[[nodiscard]] ra8_err_t fileops_print_fail(const char* what, ra8_err_t err);
157
158/* =============================================================================
159 * Mount + suite + probe
160 * =============================================================================
161 */
162
177[[nodiscard]] ra8_err_t fileops_mount_volume(ra8_fs_mount_t** out_mount);
178
192[[nodiscard]] ra8_err_t fileops_suite_create(ra8_fs_mount_t* mount);
193
207[[nodiscard]] ra8_err_t fileops_suite_mutate(ra8_fs_mount_t* mount);
208
223void fileops_probe_layout(void);
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Minimal FAT12/FAT16/FAT32 filesystem adapter (read + write).
Native USB controller driver public API (device + host modes).
Native USB host-side MSC (Mass Storage Class) class layer.
Cached parse of one mounted FAT volume.
void fileops_probe_layout(void)
Dump the partition table + LBA1/LBA2 heads after a mount failure.
ra8_err_t fileops_print_dec(uint64_t value)
Print a uint32_t as ASCII decimal.
usb_fileops_probe_t
Sizing for the on-mount-failure disk-layout probe dump.
@ k_fileops_probe_lba_max
Probe reads LBAs 0..2.
@ k_fileops_probe_tbl_off
LBA0 dump start (partition table).
@ k_fileops_probe_head_len
LBA1/LBA2 head dump length.
@ k_fileops_probe_row
Hex bytes per dump row.
@ k_fileops_probe_tbl_len
LBA0 dump length (incl.
usb_fileops_size_t
Buffer sizing constants.
@ k_fileops_name_cap
Listdir name compare bound.
@ k_fileops_sector_bytes
One SCSI block / FAT sector.
ra8_err_t fileops_suite_mutate(ra8_fs_mount_t *mount)
Suite steps 6..9: rename, old-gone/new-intact, list, delete.
ra8_err_t fileops_suite_create(ra8_fs_mount_t *mount)
Suite steps 1..5: cleanup, baseline listdir, write, verify, list.
usb_fileops_config_t
Compile-time settings for the host file-ops suite.
@ k_fileops_idle_ms
Idle tick in the parked main loop.
@ k_fileops_retry_ms
Pause between ladder retries.
@ k_fileops_target_lun
Exercise LUN 0 (typical stick).
@ k_fileops_baud
J-Link OB CDC log baud.
@ k_fileops_print_cap
Bound for console-string scans.
usb_fileops_hex_t
Hex/decimal text-formatter sizing constants.
@ k_fileops_hex_chars_u32
32-bit value -> "ABCDEF01".
@ k_fileops_hex_digit_split
Threshold between '0-9'/'A-F'.
@ k_fileops_nibble_bits
Bits per hex nibble.
@ k_fileops_hex_chars_u16
16-bit value -> "ABCD".
@ k_fileops_dec_chars_u64
Max digits for a 64-bit count.
ra8_err_t fileops_mount_volume(ra8_fs_mount_t **out_mount)
Mount the attached drive through the USB-MSC backend.
ra8_err_t fileops_print_fail(const char *what, ra8_err_t err)
Print "FAIL <what> err=0xNNNNNNNN" on its own line.
ra8_err_t fileops_print_hex(uint32_t value, uint8_t digits)
Print a value as fixed-width uppercase hex.
ra8_err_t fileops_print(const char *text)
Print a NUL-terminated ASCII string over the console.
usb_fileops_mask_t
Bit-mask constants used by the text formatters.
@ k_fileops_nibble_mask
4-bit nibble mask.
@ k_fileops_dec_radix
Base for decimal conversion.