ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
emu_view.c
Go to the documentation of this file.
1
16
17#include "emu_view.h"
18
19#include <stdio.h>
20#include <stdlib.h>
21#include <string.h>
22
23#include "board_console.h"
24#include "board_periph.h"
25#include "board_periph_sd.h"
26#include "board_usb.h"
27#include "emu_exc.h"
29#include "emu_mmio.h"
31
32/* Touch on the EK-RA8D2 is now modelled end-to-end: the firmware's real
33 * ra8_touch_open / ra8_touch_read run unchanged and drive the GoodIX GT911 over
34 * ra8_i3c_transfer (the I3C peripheral in legacy I2C mode), which board_periph
35 * models as an I2C bus with a GT911 device. ra8_emulator feeds --click / window
36 * clicks into that device (board_periph_touch_inject), so a tap returns through
37 * the genuine ra8_touch -> I3C -> GT911 path -- there is no function-level stub. */
38
39/* Run-state telemetry the board view shows (updated by the run loop each
40 * present): the current PC, the emulation-chunk counter, and whether the run
41 * loop is still live (set false once the run parks / faults / exits). */
42static uint32_t s_view_pc;
43static uint32_t s_view_chunks;
44static bool s_view_running = true;
45/* Console scrollback state, Arduino-Serial-Monitor style. s_view_scroll is the
46 * offset in lines back from the newest line (0 = the live tail). When
47 * s_view_autoscroll is true the view follows the tail (offset pinned to 0);
48 * scrolling up pauses autoscroll and the view holds its ABSOLUTE lines as new
49 * output arrives (the offset is advanced by each frame's new-line delta, tracked
50 * via s_view_log_seen). Scrolling back down to the tail re-enables autoscroll. */
51static uint32_t s_view_scroll;
52static bool s_view_autoscroll = true;
53static uint32_t s_view_log_seen;
54/* Active console tab: which board_console channel the console panel shows. The
55 * tab bar (ALL | UART | ITM | SPI | I2C) switches it on a click; switching
56 * resets the scrollback to the live tail of the newly selected channel. */
58
59/* Core-control state (#152 dual-core CLI/GUI asks). s_primary_core gates the
60 * M85-only instruction seams and relabels telemetry; s_low_power shrinks the
61 * run-chunk budget to model the M33's 4:1-slower clock (Model A), and the GUI
62 * low-power button + the --low-power flag both drive it. */
64static bool s_low_power = false;
65
76RA8_INTERNAL static void internal_fill_status_hw(board_status_t* st, const char* app_name)
77{
78 static const char* const k_led_labels[k_overlay_led_count] = {"LED1", "LED2", "LED3"};
79 *st = (board_status_t){};
80 for (uint32_t i = 0U; i < (uint32_t)k_overlay_led_count; i++) {
83 st->leds[i].label = k_led_labels[i];
84 }
91 /* User switches are active-low: a held button reads its pin low. */
97 st->app_name = app_name;
99}
100
101/* @brief Snapshot the tabbed-console metadata and the active scrollback window. */
121{
123 st->console_active_ch = (uint32_t)s_view_console_ch;
124 for (uint32_t c = 0U; c < (uint32_t)k_board_console_ch_count; c++) {
125 if (c >= (uint32_t)k_overlay_console_tabs_max) {
126 break;
127 }
130 }
131}
132
157RA8_INTERNAL static uint32_t internal_console_advance_scroll(uint32_t avail, uint32_t total)
158{
159 if (s_view_autoscroll) {
160 s_view_scroll = 0U; /* follow the live tail */
161 } else if (total > s_view_log_seen) {
162 const uint32_t delta = total - s_view_log_seen;
163 s_view_scroll += delta;
164 if (s_view_scroll > (uint32_t)k_uart_log_max) {
165 s_view_scroll = (uint32_t)k_uart_log_max;
166 }
167 }
168 s_view_log_seen = total;
169 const uint32_t max_scroll =
170 (avail > (uint32_t)k_overlay_console_rows) ? (avail - (uint32_t)k_overlay_console_rows) : 0U;
171 if (s_view_scroll > max_scroll) {
172 s_view_scroll = max_scroll; /* re-clamp if history shrank or is shallow */
173 }
174 return s_view_scroll;
175}
176
187{
189 /* Console window: copy up to k_overlay_console_rows lines from the active
190 * channel's scrollback ring, starting `scroll` lines back from the newest,
191 * so the mouse-wheel can page through history. console[0] is the newest
192 * visible line (= ring line `scroll`). */
193 const uint32_t avail = board_console_count(s_view_console_ch);
194 const uint32_t total = board_console_total(s_view_console_ch);
195 const uint32_t scroll = internal_console_advance_scroll(avail, total);
196 uint32_t rows = 0U;
197 for (uint32_t i = 0U; i < (uint32_t)k_overlay_console_rows; i++) {
198 const char* line = board_console_line(s_view_console_ch, scroll + i);
199 if (line == nullptr) {
200 break;
201 }
202 (void)snprintf(st->console[i], (size_t)k_overlay_line_cap, "%s", line);
203 rows++;
204 }
205 st->console_count = rows;
206 st->console_scroll = scroll;
207 st->console_total = avail;
209 /* Run-state telemetry (set by the run loop before each present). */
210 st->pc = s_view_pc;
211 st->chunks = s_view_chunks;
216}
217
235RA8_INTERNAL static void internal_fill_status(board_status_t* st, const char* app_name)
236{
237 internal_fill_status_hw(st, app_name);
239}
240
242void unrotate_click(uint16_t cx,
243 uint16_t cy,
244 uint16_t panel_w,
245 uint16_t panel_h,
246 uint32_t deg,
247 uint16_t* nx,
248 uint16_t* ny)
249{
250 if (deg == (uint32_t)k_rotate_90) {
251 *nx = cy;
252 *ny = (uint16_t)(panel_h - 1U - cx);
253 } else if (deg == (uint32_t)k_rotate_180) {
254 *nx = (uint16_t)(panel_w - 1U - cx);
255 *ny = (uint16_t)(panel_h - 1U - cy);
256 } else if (deg == (uint32_t)k_rotate_270) {
257 *nx = (uint16_t)(panel_w - 1U - cy);
258 *ny = cx;
259 } else {
260 *nx = cx;
261 *ny = cy;
262 }
263}
264
266void set_switch(board_overlay_btn_t btn, bool pressed)
267{
268 const uint8_t pin =
269 (btn == k_board_overlay_btn_sw2) ? (uint8_t)k_emu_sw2_pin : (uint8_t)k_emu_sw1_pin;
270 /* SW1/SW2 are momentary push-buttons wired active-low (internal pull-up): held
271 * down drives the pin LOW (input false), released lets it return HIGH (true).
272 * Driving the level directly -- instead of toggling -- makes a click behave as a
273 * real button (press on mouse-down, release on mouse-up), not a latching switch. */
274 board_periph_gpio_set_input((uint8_t)k_emu_sw_port, pin, !pressed);
275}
276
289void apply_battery_click(board_overlay_btn_t btn, uint16_t cx, uint16_t disp_w)
290{
291 if (btn == k_board_overlay_btn_battery) {
292 uint8_t pct = 0U;
293 if (board_overlay_battery_pct_at(cx, disp_w, &pct)) {
294 bool charging = false;
295 board_periph_battery_get(nullptr, &charging);
296 board_periph_battery_set(pct, charging);
297 }
298 } else if (btn == k_board_overlay_btn_batt_chg) {
299 uint8_t soc = 0U;
300 bool charging = false;
301 board_periph_battery_get(&soc, &charging);
302 board_periph_battery_set(soc, !charging);
303 } else if (btn == k_board_overlay_btn_lowpower) {
304 /* CORE low-power toggle: flip the M33 4:1-clock model live (same effect as
305 * the headless --low-power flag). */
307 }
308}
309
327 uint16_t cy,
328 uint16_t panel_w,
329 uint16_t panel_h,
330 uint16_t disp_w,
331 uint32_t rotate_deg)
332{
333 /* A click on the console tab bar switches the active channel (and takes
334 * precedence over the console-body autoscroll toggle below, since the tab row
335 * sits inside the console region). Switching resets the scrollback to the live
336 * tail of the newly selected channel. */
337 uint32_t tab_idx = 0U;
338 if (board_overlay_hit_console_tab(cx, cy, disp_w, (uint32_t)k_board_console_ch_count, &tab_idx)) {
340 s_view_scroll = 0U;
341 s_view_autoscroll = true;
344 }
345 const board_overlay_btn_t btn = board_overlay_hit_button(cx, cy, disp_w);
346 if (btn == k_board_overlay_btn_console) {
347 /* Toggle the console autoscroll, Arduino-Serial-Monitor style: pause it
348 * while reading, or click again to jump back to the live tail. */
350 if (s_view_autoscroll) {
351 s_view_scroll = 0U; /* resume following the newest line */
352 }
353 return btn;
354 }
357 apply_battery_click(btn, cx, disp_w);
358 return btn;
359 }
360 if (btn != k_board_overlay_btn_none) {
361 set_switch(btn, true); /* mouse-down -> press; mouse-up releases it (run loop). */
362 return btn;
363 }
364 uint16_t nx = cx;
365 uint16_t ny = cy;
366 unrotate_click(cx, cy, panel_w, panel_h, rotate_deg, &nx, &ny);
369}
370
371bool build_composite(uc_engine* uc,
372 emu_presentation_workspace_t* presentation,
373 const char* app_name)
374{
375 board_status_t st = {};
376 internal_fill_status(&st, app_name);
377 return priv_emu_view_surface_build(uc, presentation, &st);
378}
379
390{
391 size_t n = strlen(s);
392 while (n > 0U) {
393 const char c = s[n - 1U];
394 if ((c != ' ') && (c != '\t') && (c != '\r') && (c != '\n')) {
395 break;
396 }
397 s[--n] = '\0';
398 }
399}
400
425RA8_INTERNAL static bool internal_panel_split_kv(char* line, char** key, char** val)
426{
427 char* p = line;
428 while ((*p == ' ') || (*p == '\t')) {
429 p++;
430 }
431 if ((*p == '#') || (*p == '\0') || (*p == '\n') || (*p == '\r')) {
432 return false;
433 }
434 char* eq = strchr(p, '=');
435 if (eq == nullptr) {
436 return false;
437 }
438 *eq = '\0';
439 char* v = eq + 1;
440 while ((*v == ' ') || (*v == '\t')) {
441 v++;
442 }
445 *key = p;
446 *val = v;
447 return true;
448}
449
465RA8_INTERNAL static void internal_panel_set_name(board_panel_t* out, const char* val)
466{
467 const char* s = val;
468 size_t n = strlen(s);
469 if ((n >= 2U) && (s[0] == '"') && (s[n - 1U] == '"')) {
470 s += 1;
471 n -= 2U;
472 }
473 if (n >= sizeof(out->name)) {
474 n = sizeof(out->name) - 1U;
475 }
476 (void)memcpy(out->name, s, n);
477 out->name[n] = '\0';
478}
479
496RA8_INTERNAL static void
497internal_panel_apply_kv(board_panel_t* out, const char* key, const char* val)
498{
499 if (strncmp(key, "width", sizeof("width")) == 0) {
500 out->width = (uint16_t)strtol(val, nullptr, (int)k_strtol_base10);
501 } else if (strncmp(key, "height", sizeof("height")) == 0) {
502 out->height = (uint16_t)strtol(val, nullptr, (int)k_strtol_base10);
503 } else if (strncmp(key, "name", sizeof("name")) == 0) {
504 internal_panel_set_name(out, val);
505 } else {
506 /* Unknown key: ignored on purpose. */
507 }
508}
509
526{
527 char* line = text;
528 while (*line != '\0') {
529 char* const end = strchr(line, '\n');
530 if (end != nullptr) {
531 *end = '\0';
532 }
533 if (strlen(line) >= (size_t)k_panel_line_max) {
534 return false;
535 }
536 char* key = nullptr;
537 char* val = nullptr;
538 if (internal_panel_split_kv(line, &key, &val)) {
539 internal_panel_apply_kv(out, key, val);
540 }
541 if (end == nullptr) {
542 break;
543 }
544 line = end + 1;
545 }
546 return true;
547}
548
549/* See the public header for the documented contract. */
550bool load_panel(const char* path, board_panel_t* out)
551{
552 enum : size_t {
553 k_panel_file_cap = 4096U,
554 };
555 if ((path == nullptr) || (out == nullptr)) {
556 return false;
557 }
558 (void)memset(out, 0, sizeof(*out));
559 emu_io_file_t file = {.fd = -1, .size = 0};
560 if ((priv_emu_io_open_read(path, &file).status != k_emu_io_ok) || (file.size <= 0) ||
561 ((uint64_t)file.size > k_panel_file_cap)) {
562 if (file.fd >= 0) {
563 (void)priv_emu_io_close(&file);
564 }
565 (void)priv_emu_io_errf("ra8_emulator: cannot open panel config %s\n", path);
566 return false;
567 }
568 const size_t length = (size_t)file.size;
569 char config[k_panel_file_cap + 1U];
570 const bool read_ok = priv_emu_io_read_exact(file.fd, config, length).status == k_emu_io_ok;
571 config[length] = '\0';
572 (void)priv_emu_io_close(&file);
573 const bool valid = read_ok && internal_parse_panel(config, out) && (out->width != 0U) &&
574 (out->width <= (uint16_t)k_panel_dim_max) && (out->height != 0U) &&
575 (out->height <= (uint16_t)k_panel_dim_max);
576 if (!valid) {
577 (void)priv_emu_io_errf("ra8_emulator: panel %s: width/height missing or out of range\n", path);
578 return false;
579 }
580 return true;
581}
582
584void emu_view_publish(uint32_t pc, uint32_t chunks)
585{
586 s_view_pc = pc;
587 s_view_chunks = chunks;
588}
589
591void emu_view_mark_stopped(uint32_t pc)
592{
593 s_view_running = false;
594 s_view_pc = pc;
595}
596
598void emu_view_wheel(int32_t notches)
599{
600 if (notches > 0) {
601 s_view_autoscroll = false; /* user scrolled up -> pause the live follow */
602 s_view_scroll += (uint32_t)notches;
603 } else if (notches < 0) {
604 const uint32_t dec = (uint32_t)(-notches);
605 if (s_view_scroll > dec) {
606 s_view_scroll -= dec;
607 } else {
608 s_view_scroll = 0U;
609 s_view_autoscroll = true; /* scrolled back to the tail -> resume follow */
610 }
611 }
612}
613
622
631
637
643
646{
647 return s_low_power;
648}
649
651void emu_set_low_power(bool on)
652{
653 s_low_power = on;
654}
Multi-channel console log store backing the board view's tabbed console.
const char * board_console_line(board_console_ch_t ch, uint32_t back)
Fetch a retained line by age (0 = newest) from a channel.
uint32_t board_console_count(board_console_ch_t ch)
Count of lines currently retained in a channel ring.
const char * board_console_name(board_console_ch_t ch)
Short display name for a channel (the tab caption).
uint32_t board_console_total(board_console_ch_t ch)
Monotonic count of lines ever pushed to a channel.
board_console_ch_t
Console channels the board view exposes as tabs.
@ k_board_console_ch_all
Aggregate of all lanes (arrival order).
@ k_board_console_ch_count
Channel count (ring + tab array size).
board_overlay_btn_t board_overlay_hit_button(uint16_t x, uint16_t y, uint16_t panel_w)
Classify a composite-space click against the sidebar's on-screen buttons.
board_overlay_btn_t
On-screen sidebar control a click landed on.
@ k_board_overlay_btn_sw2
On-screen SW2 (P008) push-button.
@ k_board_overlay_btn_console
Console panel: toggle autoscroll.
@ k_board_overlay_btn_battery
Battery slider track: set SOC.
@ k_board_overlay_btn_batt_chg
Battery CHG button: toggle charge.
@ k_board_overlay_btn_none
Click did not land on a control.
@ k_board_overlay_btn_lowpower
CORE low-power toggle button.
bool board_overlay_hit_console_tab(uint16_t x, uint16_t y, uint16_t panel_w, uint32_t tab_count, uint32_t *out_idx)
Map a composite-space click on the console tab bar to a tab index.
@ k_overlay_console_tabs_max
Tab-bar capacity (channels = tabs).
@ k_overlay_line_cap
Max chars copied per console line.
@ k_overlay_console_rows
Console lines shown (newest at bottom).
bool board_overlay_battery_pct_at(uint16_t x, uint16_t panel_w, uint8_t *out_pct)
Map a click column on the battery slider track to a 0..100 SOC percent.
@ k_overlay_led_count
LED1 / LED2 / LED3 (mirrors the BSP).
Register-accurate peripheral-model framework for the board emulator.
uint32_t board_periph_led_level(board_led_id_t led)
Read the last driven output level of a board LED.
void board_periph_battery_get(uint8_t *out_soc, bool *out_charging)
Read back the emulated battery state (for the status overlay).
bool board_periph_touch_last(uint16_t *x, uint16_t *y)
Report the coordinates of the most recently drained touch contact.
const char * board_periph_uart_last_line(void)
The most recent complete line the firmware transmitted over any SCI.
board_led_id_t
Board user-LED identity, mirrored from the EK-RA8D2 BSP.
uint32_t board_periph_uart_tx_total(void)
Total bytes the firmware has transmitted over all SCI channels.
uint32_t board_periph_irq_total(void)
Total NVIC interrupts the ICU has delivered in this run.
uint16_t board_periph_led_color_rgb565(board_led_id_t led)
The on-colour of a board LED as a packed RGB565 value.
void board_periph_battery_set(uint8_t soc_pct, bool charging)
Set the emulated battery state surfaced by the MAX17048 fuel gauge.
bool board_periph_gpio_get_input(uint8_t port, uint8_t pin)
Read the externally-injected input level of a GPIO pin.
void board_periph_gpio_set_input(uint8_t port, uint8_t pin, bool level)
Drive a GPIO pin's input level from outside the firmware.
void board_periph_touch_inject(uint16_t x, uint16_t y)
Arm a pending touch contact for the modelled GT911 device.
uint32_t board_periph_irq_count(uint32_t irq)
Number of times a given NVIC line was taken in this run.
SD-card-over-SPI device model for ra8_emulator (attached to SPI_B).
void board_sd_info(bool *attached, uint64_t *bytes, uint8_t *fat_bits, const char **label)
Read back the attached card's summary (for the status view / report).
USBFS controller model + a virtual USB host for the board emulator.
const char * board_usb_state_string(void)
One-line, human-readable USB device state for the board view.
Definition board_usb.c:228
Cortex-M exception model constants and interfaces for ra8_emulator.
Bounded raw-descriptor I/O seam for the RA8 emulator.
@ k_emu_io_ok
The complete operation succeeded.
emu_io_result_t priv_emu_io_errf(const char *format,...)
Format bounded text and write it to the injected error descriptor.
emu_io_result_t priv_emu_io_read_exact(int fd, void *buf, size_t count)
Read exactly count sequential bytes or report EOF/fault progress.
emu_io_result_t priv_emu_io_close(emu_io_file_t *file)
Close and invalidate an owned raw file descriptor.
emu_io_result_t priv_emu_io_open_read(const char *path, emu_io_file_t *file)
Open and stat a regular file for bounded raw reading.
Sparse MMIO model of the Renesas peripheral space.
uint32_t emu_mmio_writes(void)
Total peripheral MMIO writes this run (monotonic).
Definition emu_mmio.c:228
uint32_t emu_mmio_reads(void)
Total peripheral MMIO reads this run (monotonic).
Definition emu_mmio.c:222
static void internal_fill_status(board_status_t *st, const char *app_name)
Snapshot the live peripheral state into a board-view status struct.
Definition emu_view.c:235
void emu_set_primary_core(board_primary_core_t core)
Implementation of emu_set_primary_core() – plain state write.
Definition emu_view.c:639
static void internal_fill_status_console(board_status_t *st)
Perform fill status console for the emu view model.
Definition emu_view.c:186
static uint32_t internal_console_advance_scroll(uint32_t avail, uint32_t total)
Advance and clamp the console scroll offset, returning where to read.
Definition emu_view.c:157
static uint32_t s_view_log_seen
Definition emu_view.c:53
void apply_battery_click(board_overlay_btn_t btn, uint16_t cx, uint16_t disp_w)
Apply a POWER-section click to the fuel-gauge model.
Definition emu_view.c:289
void set_switch(board_overlay_btn_t btn, bool pressed)
Toggle a user switch's pressed level (active-low) for an on-screen button.
Definition emu_view.c:266
void emu_view_select_console_tab(uint32_t tab_idx)
Implementation of emu_view_select_console_tab() – tab switch.
Definition emu_view.c:615
static bool internal_parse_panel(char *text, board_panel_t *out)
Parse bounded panel-config text already loaded into memory.
Definition emu_view.c:525
static bool s_low_power
Definition emu_view.c:64
static void internal_fill_status_hw(board_status_t *st, const char *app_name)
Snapshot the LED / USB / UART / IRQ / switch / battery / SD state.
Definition emu_view.c:76
bool emu_low_power(void)
Implementation of emu_low_power() – plain state read.
Definition emu_view.c:645
bool load_panel(const char *path, board_panel_t *out)
Load a panel descriptor (name / width / height) from a TOML-ish file.
Definition emu_view.c:550
static void internal_fill_console_tabs(board_status_t *st)
Populate the console tab-bar metadata in st.
Definition emu_view.c:120
static uint32_t s_view_pc
Definition emu_view.c:42
void emu_view_mark_stopped(uint32_t pc)
Implementation of emu_view_mark_stopped() – final held frame.
Definition emu_view.c:591
void emu_set_low_power(bool on)
Implementation of emu_set_low_power() – plain state write.
Definition emu_view.c:651
static void internal_panel_apply_kv(board_panel_t *out, const char *key, const char *val)
Apply one recognised key=value pair to out; unknown keys are ignored.
Definition emu_view.c:497
void emu_view_publish(uint32_t pc, uint32_t chunks)
Implementation of emu_view_publish() – run-loop telemetry.
Definition emu_view.c:584
static board_console_ch_t s_view_console_ch
Definition emu_view.c:57
static uint32_t s_view_scroll
Definition emu_view.c:51
static void internal_panel_set_name(board_panel_t *out, const char *val)
Copy the panel name value into out, stripping optional quotes.
Definition emu_view.c:465
void emu_view_wheel(int32_t notches)
Implementation of emu_view_wheel() – scrollback paging.
Definition emu_view.c:598
static uint32_t s_view_chunks
Definition emu_view.c:43
static board_primary_core_t s_primary_core
Definition emu_view.c:63
static bool internal_panel_split_kv(char *line, char **key, char **val)
Split one config line into a trimmed key / value pair, in place.
Definition emu_view.c:425
static void internal_panel_rstrip(char *s)
Trim trailing space/tab/CR/LF in place.
Definition emu_view.c:389
static bool s_view_autoscroll
Definition emu_view.c:52
static bool s_view_running
Definition emu_view.c:44
void emu_view_reset_console(void)
Implementation of emu_view_reset_console() – warm-reboot view reset.
Definition emu_view.c:624
bool build_composite(uc_engine *uc, emu_presentation_workspace_t *presentation, const char *app_name)
Stream the panel and status sidebar into a raw-fd surface.
Definition emu_view.c:371
void unrotate_click(uint16_t cx, uint16_t cy, uint16_t panel_w, uint16_t panel_h, uint32_t deg, uint16_t *nx, uint16_t *ny)
Map a click in the rotated displayed panel back to native panel coords.
Definition emu_view.c:242
board_overlay_btn_t route_click(uint16_t cx, uint16_t cy, uint16_t panel_w, uint16_t panel_h, uint16_t disp_w, uint32_t rotate_deg)
Route a composite-space click to the right input model.
Definition emu_view.c:326
board_primary_core_t emu_primary_core(void)
Implementation of emu_primary_core() – plain state read.
Definition emu_view.c:633
Board-view presentation: frames, composition, input routing, panels.
@ k_emu_sw1_pin
SW1 -> P009.
Definition emu_view.h:37
@ k_emu_sw2_pin
SW2 -> P008.
Definition emu_view.h:38
@ k_emu_sw_port
Both user switches sit on PORT0.
Definition emu_view.h:36
@ k_rotate_90
90 deg clockwise (-> portrait).
Definition emu_view.h:79
@ k_rotate_270
90 deg counter-clockwise.
Definition emu_view.h:81
@ k_rotate_180
Upside down.
Definition emu_view.h:80
@ k_panel_dim_max
Sanity cap on a panel dimension.
Definition emu_view.h:88
@ k_panel_line_max
Max panel-config line length.
Definition emu_view.h:86
@ k_strtol_base10
Base-10 radix for strtol parses.
Definition emu_view.h:85
board_primary_core_t
Which core the firmware targets: gates the M85-only instruction seams.
Definition emu_view.h:63
@ k_core_m33
Cortex-M33 primary: the M85-only instruction seams stay off.
Definition emu_view.h:65
@ k_core_m85
Cortex-M85 primary (default): MVE/long-shift seams armed.
Definition emu_view.h:64
@ k_uart_log_max
Console ring depth (mirrors SCI model).
Definition emu_view.h:52
Internal streamed panel/composite builder seam.
bool priv_emu_view_surface_build(uc_engine *uc, emu_presentation_workspace_t *presentation, const board_status_t *status)
Build one exact fd-backed composite from live engine and status state.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
ra8_board_eth_pin_t pin
Pin.
int strncmp(const char *s1, const char *s2, size_t n)
Compare two strings up to a specified length.
void * memset(void *dst, int value, size_t n)
Fill memory with a constant byte value.
size_t strlen(const char *s)
Calculate string length.
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
char * strchr(const char *s, int c)
Locate first occurrence of character in string.
const char * label
Short ASCII caption (e.g.
uint16_t color
RGB565 lit colour (blue / green / red).
bool on
True when the GPIO pin is driven high.
Display descriptor loaded from a flat key=value panel file.
Definition emu_view.h:92
uint16_t height
Pixel height.
Definition emu_view.h:95
uint16_t width
Pixel width.
Definition emu_view.h:94
char name[k_panel_name_max]
Name.
Definition emu_view.h:93
Live peripheral snapshot the status sidebar renders each frame.
uint16_t touch_y
Last touch Y (if any).
char console[k_overlay_console_rows][k_overlay_line_cap]
Visible lines (active tab).
const char * app_name
App / window title.
uint32_t console_ch_count
Tabs to draw (<= max).
bool battery_charging
Fuel gauge reports charge.
uint32_t irq1
IRQ1 taken count.
uint32_t mmio_writes
Modelled-peripheral MMIO writes served.
uint16_t touch_x
Last touch X (if any).
uint8_t battery_soc
Fuel-gauge SOC percent.
bool core_is_m33
Primary core is the M33.
uint32_t console_active_ch
Active tab index.
bool console_autoscroll
True = following live tail; false=paused.
board_led_status_t leds[k_overlay_led_count]
Per-LED indicator state.
uint32_t console_total
Total lines in the active channel ring.
uint32_t console_ch_count_lines[k_overlay_console_tabs_max]
Per-tab line count.
uint32_t uart_tx_total
Total UART TX bytes the firmware emitted.
uint32_t irq0
IRQ0 taken count.
uint64_t sd_bytes
SD card size in bytes (>4GB).
bool sw1_pressed
On-screen SW1 held down.
const char * uart_line
Last captured UART line.
bool sd_attached
A microSD card is attached.
uint32_t console_count
Visible lines populated (<= rows).
const char * console_ch_name[k_overlay_console_tabs_max]
Per-tab caption.
const char * sd_label
SD volume label (–sd-new).
bool low_power
Low-power (M33 4:1 clock) on.
uint32_t console_scroll
Lines scrolled back from newest (0=live).
uint8_t sd_fat_bits
12/16/32 if –sd-new, else 0.
uint32_t chunks
Emulation chunks run so far.
bool running
True while the run loop is live (not parked).
uint32_t pc
Current emulated program counter.
const char * usb_state
USB device state string.
uint32_t mmio_reads
Modelled-peripheral MMIO reads served.
bool has_touch
A touch has been drained.
bool sw2_pressed
On-screen SW2 held down.
uint32_t irq_total
Total NVIC IRQs taken.
Raw descriptor plus its stat-derived byte length.
emu_io_status_t status
Semantic completion status.
One independent owned surface plus non-owning bounded scratch.