|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
examples/ek_ra8d2/hw_validated/manual/usb_host_file_ops/inc/usb_host_file_ops_steps.h More...
#include <stdint.h>#include "ra8_err.h"#include "ra8_fs.h"#include "ra8_usb.h"#include "ra8_usb_hmsc.h"Go to the source code of this file.
Functions | |
| ra8_err_t | fileops_print (const char *text) |
| Print a NUL-terminated ASCII string over the console. | |
| ra8_err_t | fileops_print_dec (uint64_t value) |
| Print a uint32_t as ASCII decimal. | |
| 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_fail (const char *what, ra8_err_t err) |
| Print "FAIL <what> err=0xNNNNNNNN" on its own line. | |
| 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_suite_create (ra8_fs_mount_t *mount) |
| Suite steps 1..5: cleanup, baseline listdir, write, verify, list. | |
| ra8_err_t | fileops_suite_mutate (ra8_fs_mount_t *mount) |
| Suite steps 6..9: rename, old-gone/new-intact, list, delete. | |
| void | fileops_probe_layout (void) |
| Dump the partition table + LBA1/LBA2 heads after a mount failure. | |
examples/ek_ra8d2/hw_validated/manual/usb_host_file_ops/inc/usb_host_file_ops_steps.h
Console helpers + ra8_fs file-op suite for the USB host file-ops app.
Declares the shared compile-time configuration enums, the polled-console print helpers, and the ra8_fs-over-USB-MSC suite routines that back the usb_host_file_ops manual HIL test. The definitions live in usb_host_file_ops_steps.c; main.c keeps only the boot/bring-up code and the retry ladder and calls into this interface.
Definition in file usb_host_file_ops_steps.h.
| enum usb_fileops_config_t : uint32_t |
Compile-time settings for the host file-ops suite.
Definition at line 41 of file usb_host_file_ops_steps.h.
| enum usb_fileops_hex_t : uint8_t |
Hex/decimal text-formatter sizing constants.
Definition at line 62 of file usb_host_file_ops_steps.h.
| enum usb_fileops_mask_t : uint32_t |
Bit-mask constants used by the text formatters.
| Enumerator | |
|---|---|
| k_fileops_nibble_mask | 4-bit nibble mask. |
| k_fileops_dec_radix | Base for decimal conversion. |
Definition at line 74 of file usb_host_file_ops_steps.h.
| enum usb_fileops_probe_t : uint32_t |
Sizing for the on-mount-failure disk-layout probe dump.
Definition at line 83 of file usb_host_file_ops_steps.h.
| enum usb_fileops_size_t : uint16_t |
Buffer sizing constants.
| Enumerator | |
|---|---|
| k_fileops_sector_bytes | One SCSI block / FAT sector. |
| k_fileops_name_cap | Listdir name compare bound. |
Definition at line 53 of file usb_host_file_ops_steps.h.
|
nodiscard |
Mount the attached drive through the USB-MSC backend.
| [out] | out_mount | Receives the mount handle on success. |
| k_ra8_ok | Volume mounted; the type line was printed. |
out_mount is non-NULL. Definition at line 272 of file usb_host_file_ops_steps.c.
References fileops_fs_type_name(), fileops_print(), fileops_print_dec(), fileops_print_fail(), k_fileops_target_lun, k_ra8_ok, ra8_fs_mount(), ra8_io_blockdev_as_fs_backend(), ra8_io_blockdev_usbmsc_init(), s_fileops_usb_dev, and s_fileops_usb_state.
Referenced by fileops_run_ladder().
|
nodiscard |
Print a NUL-terminated ASCII string over the console.
| [in] | text | String to print (CR/LF included by the caller). |
| k_ra8_ok | All bytes queued. |
text is non-NULL. text is NUL-terminated within k_fileops_print_cap bytes. Definition at line 146 of file usb_host_file_ops_steps.c.
References fileops_sci_write(), and fileops_str_len().
Referenced by fileops_dump_rows(), fileops_listdir_cb(), fileops_mount_volume(), fileops_print_attach(), fileops_print_fail(), fileops_probe_layout(), fileops_run_ladder(), fileops_step_listdir(), fileops_step_write(), fileops_suite_create(), fileops_suite_mutate(), and main().
|
nodiscard |
Print a uint32_t as ASCII decimal.
| [in] | value | Value to print. |
| k_ra8_ok | All bytes queued. |
Definition at line 151 of file usb_host_file_ops_steps.c.
References fileops_sci_write(), k_fileops_dec_chars_u64, and k_fileops_dec_radix.
Referenced by fileops_listdir_cb(), fileops_mount_volume(), fileops_probe_layout(), fileops_step_listdir(), and fileops_step_write().
Print "FAIL <what> err=0xNNNNNNNN" on its own line.
| [in] | what | Short description of the failed step. |
| [in] | err | Error code returned by the step. |
| k_ra8_ok | The diagnostic line is queued. |
what is NUL-terminated within the print cap. Definition at line 186 of file usb_host_file_ops_steps.c.
References fileops_print(), fileops_print_hex(), k_fileops_hex_chars_u32, and k_ra8_ok.
Referenced by fileops_expect_absent(), fileops_mount_volume(), fileops_read_back(), fileops_run_ladder(), fileops_step_listdir(), fileops_step_write(), fileops_suite_mutate(), and main().
|
nodiscard |
Print a value as fixed-width uppercase hex.
| [in] | value | Value to print. |
| [in] | digits | Hex digit count (4 for u16, 8 for u32). |
| k_ra8_ok | All bytes queued. |
digits is at most k_fileops_hex_chars_u32. Definition at line 172 of file usb_host_file_ops_steps.c.
References fileops_nibble_to_hex(), fileops_sci_write(), k_fileops_hex_chars_u32, k_fileops_nibble_bits, and k_fileops_nibble_mask.
Referenced by fileops_dump_rows(), fileops_print_attach(), and fileops_print_fail().
| void fileops_probe_layout | ( | void | ) |
Dump the partition table + LBA1/LBA2 heads after a mount failure.
Reads LBA 0 (MBR partition entries at 0x1BE), LBA 1, and LBA 2 straight through the USB backend and prints hex excerpts, so an unrecognized disk layout (e.g. GPT) can be identified from the log.
Definition at line 688 of file usb_host_file_ops_steps.c.
References fileops_dump_rows(), fileops_print(), fileops_print_dec(), k_fileops_probe_head_len, k_fileops_probe_lba_max, k_fileops_probe_tbl_len, k_fileops_probe_tbl_off, k_fileops_sector_bytes, k_ra8_ok, ra8_io_blockdev_read(), and s_fileops_usb_dev.
Referenced by fileops_run_ladder().
|
nodiscard |
Suite steps 1..5: cleanup, baseline listdir, write, verify, list.
| [in] | mount | Live mount handle. |
| k_ra8_ok | Steps 1-5 all passed and printed their verdicts. |
mount is a live handle from ra8_fs_mount. Definition at line 548 of file usb_host_file_ops_steps.c.
References fileops_print(), fileops_read_back(), fileops_step_listdir(), fileops_step_write(), k_fileops_name_a, k_fileops_name_b, k_ra8_board_led2, k_ra8_ok, ra8_board_led_toggle(), and ra8_fs_unlink().
Referenced by fileops_run_ladder().
|
nodiscard |
Suite steps 6..9: rename, old-gone/new-intact, list, delete.
| [in] | mount | Live mount handle. |
| k_ra8_ok | Steps 6-9 all passed and printed their verdicts. |
Definition at line 596 of file usb_host_file_ops_steps.c.
References fileops_expect_absent(), fileops_print(), fileops_print_fail(), fileops_read_back(), fileops_step_listdir(), k_fileops_name_a, k_fileops_name_b, k_ra8_board_led2, k_ra8_ok, ra8_board_led_toggle(), ra8_fs_rename(), and ra8_fs_unlink().
Referenced by fileops_run_ladder().