32typedef enum : uint32_t {
38typedef enum : uint32_t {
43typedef enum : uint64_t {
55typedef enum : uint32_t {
62typedef enum : uint32_t {
69typedef enum : uint16_t {
120 const uint32_t was = ((before & mask) != 0U) ? 1U : 0U;
121 const uint32_t now = ((after & mask) != 0U) ? 1U : 0U;
128 (void)snprintf(ln,
sizeof(ln),
"%s -> %s",
s_k_led_map[i].name, now ?
"ON" :
"OFF");
149 const uint16_t old =
s_port[port_idx].podr;
150 if (old != new_podr) {
152 s_port[port_idx].podr = new_podr;
187 const uint16_t driven = (uint16_t)(p->
podr & p->
pdr);
188 const uint16_t inputs = (uint16_t)((uint16_t)(~p->
pdr) & p->
in_ovr & p->
in_lvl);
189 return (uint32_t)(uint16_t)(driven | inputs);
222 const uint16_t posr = (uint16_t)((uint32_t)value & (uint32_t)
k_half_mask);
223 const uint16_t porr =
225 uint16_t podr =
s_port[idx].podr;
227 podr &= (uint16_t)~porr;
242 for (uint32_t i = 0U; i < (uint32_t)
k_port_count; i++) {
248 const uint16_t sw_mask = (uint16_t)((1U << (uint32_t)
k_sw1_pin) | (1U << (uint32_t)
k_sw2_pin));
267 const uint16_t bit = (uint16_t)(1U << (uint32_t)
pin);
268 s_port[port].in_ovr |= bit;
270 s_port[port].in_lvl |= bit;
272 s_port[port].in_lvl &= (uint16_t)~bit;
281 const uint16_t bit = (uint16_t)(1U << (uint32_t)
pin);
282 return (
s_port[port].in_lvl & bit) != 0U;
Multi-channel console log store backing the board view's tabbed console.
void board_console_push(board_console_ch_t ch, const char *line)
Append one completed line to a channel ring and the ALL ring.
@ k_board_console_ch_gpio
GPIO / PORT pin-level transitions.
Register-accurate peripheral-model framework for the board emulator.
board_led_id_t
Board user-LED identity, mirrored from the EK-RA8D2 BSP.
@ k_board_led_count
Board led count.
Decentralized peripheral-block registry for the board emulator core.
void board_periph_register_block(const board_periph_block_t *block)
Register a peripheral block's descriptor with the core registry.
@ k_block_order_gpio
GPIO/PORT (no tick today).
bool board_periph_trace(void)
Whether –trace is active (blocks log transitions when true).
IT8951 e-paper SPI-device model for ra8_emulator (attached to SPI_B).
void board_eink_apply_gpio_defaults(void)
Re-arm the panel HRDY "ready" GPIO input high (if attached).
static port_state_t s_port[k_port_count]
uint32_t board_periph_led_level(board_led_id_t led)
Read the last driven output level of a board LED.
static RA8_INTERNAL void internal_port_write(uc_engine *uc, uint64_t addr, unsigned size, uint64_t value)
Dispatch a PORT register write (PCNTR1 direction/latch, PCNTR3 set/clear).
gpio_console_t
Console-tap line buffer capacity for a GPIO edge summary.
@ k_gpio_console_line_cap
Max chars in a "NAME -> ON/OFF" line.
static RA8_INTERNAL void internal_port_trace_leds(uint32_t port_idx, uint16_t before, uint16_t after)
Note a board-LED edge when a traced port/pin output latch changes.
static RA8_INTERNAL void internal_port_set_podr(uint32_t port_idx, uint16_t new_podr)
Apply a new PODR value to a port and trace any LED transition.
static RA8_INTERNAL void internal_board_periph_gpio_register(void)
Self-register the GPIO block before main runs (decentralized).
static const led_map_t s_k_led_map[k_board_led_count]
gpio_lit_t
LED3 PORT/pin coordinates on the EK-RA8D2 (P10_07).
static uint32_t s_led_transitions[k_board_led_count]
0->1 / 1->0 count.
port_field_t
Generic field shifts / masks shared by the PORT halves.
@ k_half_shift
High-half (PODR/PORR/EIDR) shift.
@ k_half_mask
16-bit half mask.
@ k_pins_per_port
Pins per PORT instance.
static const board_periph_block_t s_k_gpio_block
This block's descriptor (static lifetime; the core keeps the pointer).
static RA8_INTERNAL void internal_port_report(void)
Print the board-LED final level and transition-count line.
static RA8_INTERNAL uint64_t internal_port_read(uc_engine *uc, uint64_t addr, unsigned size)
Dispatch a PORT register read; returns PCNTR value for the port.
uint16_t board_periph_led_color_rgb565(board_led_id_t led)
The on-colour of a board LED as a packed RGB565 value.
port_map_t
GPIO/PORT block geometry (ra8_port_regs.h).
@ k_port_pcntr3
{PORR[31:16], POSR[15:0]} W.
@ k_port_span
Full PORT address window.
@ k_port_count
PORT0..PORT14.
@ k_port_pcntr4
{EORR[31:16], EOSR[15:0]} RW.
@ k_port_pcntr1
{PODR[31:16], PDR[15:0]} RW.
@ k_port_pcntr2
{EIDR[31:16], PIDR[15:0]} R.
@ k_port_stride
Bytes between adjacent ports.
static uint32_t s_led_level[k_board_led_count]
Last driven level.
led_color_t
RGB565 lit-colour codes for the three board LEDs.
@ k_led_rgb565_red
LED3 red (PA07) when driven high.
@ k_led_rgb565_blue
LED1 blue (P600) when driven high.
@ k_led_rgb565_green
LED2 green (P303) when driven high.
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.
sw_pin_t
EK-RA8D2 user-switch pins (PORT0): SW1=P009, SW2=P008 (UM Tbl 25).
@ k_sw_port
Both user switches are on PORT0.
static RA8_INTERNAL void internal_port_reset(void)
Clear every PORT latch / direction and the per-LED observability state.
Bounded raw-descriptor I/O seam for the RA8 emulator.
emu_io_result_t priv_emu_io_errf(const char *format,...)
Format bounded text and write it to the injected error descriptor.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
ra8_board_eth_pin_t pin
Pin.
A modelled peripheral block's self-description for the core registry.
Board LED -> (port index, pin index, lit colour), from the BSP.
uint16_t color
RGB565 colour the LED emits when driven high.
One PORT instance: direction + output latch (16 bits each).
uint16_t in_lvl
Driven input level for the in_ovr pins.
uint16_t pdr
Direction: 1 = output, 0 = input.
uint16_t in_ovr
Pins whose input level is externally driven.
uint16_t podr
Output-data latch.
static unsigned int internal_port_reset(void)
Pulse the root-hub port reset (assert then deassert).