|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ra8_emulator command-line parsing (usage text + option decoding) More...
#include <stdint.h>#include "board_periph.h"#include "emu_run.h"#include "emu_trace.h"#include "ra8_attributes.h"Go to the source code of this file.
Data Structures | |
| struct | emu_args_t |
| Every value the ra8_emulator CLI parse produces for the setup phase. More... | |
Functions | |
| bool | emu_args_parse (int argc, char **argv, emu_args_t *out) |
Parse the ra8_emulator command line into out (or print usage). | |
ra8_emulator command-line parsing (usage text + option decoding)
Decodes the ra8_emulator CLI into one emu_args_t bundle: the firmware image path, presentation options (–view / –ppm / –record / –rotate / –panel / –size), input injectors (–click / –touch-seq / –input / –keys / –usb-in / –button / –battery), storage attachments (–sd / –sd-new / –save-sd / –fast-sd / –eink / –modem), the probe family (–dump-sym / –stop-sym / –trace-sym), the TrustZone second image (–ns), and the device / core / power model selectors. Options that attach a peripheral model or set a global model knob take effect during the parse, exactly as the original inline loop did.
Split out of the ra8_emulator main translation unit; behaviour unchanged.
Definition in file emu_args.h.
| bool emu_args_parse | ( | int | argc, |
| char ** | argv, | ||
| emu_args_t * | out ) |
Parse the ra8_emulator command line into out (or print usage).
With no firmware argument the full usage text is printed to injected error sink and false is returned (the caller exits 2). Otherwise the option loop decodes argv[2..] into out with the original loop's exact semantics, including the parse-time side effects: –sd / –sd-new attach the SD model, –eink / –modem attach their device models, –fast-sd enables the block seam, and –low-power / –primary-core set the core-model knobs.
| [in] | argc | Argument count from main(). |
| [in] | argv | Argument vector from main(); strings are aliased by out. |
| [out] | out | Receives every decoded option (fully overwritten). |
| true | out is populated; parse-time attachments are in effect. |
| false | No firmware argument; usage was printed, nothing decoded. |
argv has argc entries that outlive the run (main's argv). out is non-null. out->elf_path is argv[1] and all fields hold their defaults or decoded values. out is untouched.Definition at line 485 of file emu_args.c.
References internal_args_defaults(), internal_args_print_usage(), internal_args_try_control(), internal_args_try_display(), internal_args_try_input(), internal_args_try_mode(), internal_args_try_sd(), and internal_args_try_sym().
Referenced by main().