ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
erm33_mailbox_t Struct Reference

Cross-core progress block backed by a fixed shared-SRAM address. More...

#include <ereader_m33.h>

Data Fields

volatile uint32_t magic
 M85 stamps k_erm33_magic when ready.
volatile uint32_t m33_sig
 M33 stamps k_erm33_m33_sig on boot.
volatile uint32_t status
 Render status (erm33_const_t status codes).
volatile uint32_t fb_base
 M33-published SDRAM framebuffer base address.
volatile uint32_t fb_width
 M33-published framebuffer width in pixels.
volatile uint32_t fb_height
 M33-published framebuffer height in pixels.
volatile uint32_t fb_stride
 M33-published framebuffer stride in bytes.
volatile uint32_t fb_format
 M33-published ra8_gfx_format_t (RGB565).
volatile uint32_t fb_crc
 M33-folded CRC-32 over the rendered pixels.
volatile uint32_t glyph_count
 Characters the M33 laid onto the held page.
volatile uint32_t done
 Set to 1 by the M33 once the page is published.
volatile uint32_t turn_req
 M33->M85: page-turn request, bumped per touch.
volatile uint32_t turn_ack
 M85->M33: heavy-work ack for the matching turn.
volatile uint32_t turn_done
 M33->M85: re-render published for that turn.

Detailed Description

Cross-core progress block backed by a fixed shared-SRAM address.

All fields are volatile so each core re-reads memory rather than caching a value in a register. The M85 owns magic (writer); the M33 owns every other field (writer). The M85 only reads what it does not own, and only after observing done == 1 behind a dsb.

Invariant
magic is 0 until the M85 stamps k_erm33_magic, then holds.
done is 0 until the M33 publishes the held page, then 1 forever.
On status == ok: fb_base is inside the SDRAM window, the geometry equals erm33_fb_geom_t, and fb_crc / glyph_count are non-zero.
Cycle handshake is monotone: turn_ack <= turn_req and turn_done <= turn_ack, each rising 0..k_erm33_max_turns.
Example:
volatile erm33_mailbox_t* mb = erm33_mailbox();
while (mb->done == 0U) {} // wait for the M33 to render the held page
uint32_t crc = mb->fb_crc; // CRC-32 of the SDRAM framebuffer pixels
static volatile erm33_mailbox_t * erm33_mailbox(void)
Typed pointer to the fixed-address shared progress mailbox.
Cross-core progress block backed by a fixed shared-SRAM address.
volatile uint32_t done
Set to 1 by the M33 once the page is published.
volatile uint32_t fb_crc
M33-folded CRC-32 over the rendered pixels.
See also
erm33_mailbox()
Since
0.1.0

Definition at line 228 of file ereader_m33.h.

Field Documentation

◆ done

volatile uint32_t erm33_mailbox_t::done

Set to 1 by the M33 once the page is published.

Definition at line 239 of file ereader_m33.h.

Referenced by cpu1_fail(), cpu1_run_reader(), prep_mailbox(), and wait_for_done().

◆ fb_base

volatile uint32_t erm33_mailbox_t::fb_base

M33-published SDRAM framebuffer base address.

Definition at line 232 of file ereader_m33.h.

Referenced by main(), prep_mailbox(), publish_page(), and verify_page().

◆ fb_crc

volatile uint32_t erm33_mailbox_t::fb_crc

M33-folded CRC-32 over the rendered pixels.

Definition at line 237 of file ereader_m33.h.

Referenced by emit_cycle_verdict(), main(), prep_mailbox(), publish_page(), run_mode_switch(), and verify_page().

◆ fb_format

volatile uint32_t erm33_mailbox_t::fb_format

M33-published ra8_gfx_format_t (RGB565).

Definition at line 236 of file ereader_m33.h.

Referenced by prep_mailbox(), publish_page(), and verify_page().

◆ fb_height

volatile uint32_t erm33_mailbox_t::fb_height

M33-published framebuffer height in pixels.

Definition at line 234 of file ereader_m33.h.

Referenced by prep_mailbox(), publish_page(), and verify_page().

◆ fb_stride

volatile uint32_t erm33_mailbox_t::fb_stride

M33-published framebuffer stride in bytes.

Definition at line 235 of file ereader_m33.h.

Referenced by prep_mailbox(), publish_page(), and verify_page().

◆ fb_width

volatile uint32_t erm33_mailbox_t::fb_width

M33-published framebuffer width in pixels.

Definition at line 233 of file ereader_m33.h.

Referenced by prep_mailbox(), publish_page(), and verify_page().

◆ glyph_count

volatile uint32_t erm33_mailbox_t::glyph_count

Characters the M33 laid onto the held page.

Definition at line 238 of file ereader_m33.h.

Referenced by main(), prep_mailbox(), publish_page(), and verify_page().

◆ m33_sig

volatile uint32_t erm33_mailbox_t::m33_sig

M33 stamps k_erm33_m33_sig on boot.

Definition at line 230 of file ereader_m33.h.

Referenced by cpu1_run_reader(), prep_mailbox(), and wait_for_m33_sig().

◆ magic

volatile uint32_t erm33_mailbox_t::magic

M85 stamps k_erm33_magic when ready.

Definition at line 229 of file ereader_m33.h.

Referenced by prep_mailbox().

◆ status

volatile uint32_t erm33_mailbox_t::status

Render status (erm33_const_t status codes).

Definition at line 231 of file ereader_m33.h.

Referenced by cpu1_fail(), cpu1_run_reader(), prep_mailbox(), and verify_page().

◆ turn_ack

volatile uint32_t erm33_mailbox_t::turn_ack

M85->M33: heavy-work ack for the matching turn.

Definition at line 241 of file ereader_m33.h.

Referenced by prep_mailbox(), run_handoff_cycle(), and wait_for_ack().

◆ turn_done

volatile uint32_t erm33_mailbox_t::turn_done

M33->M85: re-render published for that turn.

Definition at line 242 of file ereader_m33.h.

Referenced by emit_cycle_verdict(), m85_wait_turn_done(), prep_mailbox(), and run_page_turns().

◆ turn_req

volatile uint32_t erm33_mailbox_t::turn_req

M33->M85: page-turn request, bumped per touch.

Definition at line 240 of file ereader_m33.h.

Referenced by m85_wait_turn(), prep_mailbox(), and run_page_turns().


The documentation for this struct was generated from the following file: