55typedef enum : uint32_t {
62typedef enum : uint8_t {
101 __asm__
volatile(
"wfi");
124 if (ctx ==
nullptr) {
154 uint32_t cpuclk0_hz = 0U;
212 if (ctx ==
nullptr) {
223 .general_call =
false,
224 .clock_stretch =
true,
void main(void)
Secure fallback main entry point.
riic_target_u8_t
8-bit app tunables (channel, own address, buffer, reply).
@ k_riic_target_channel
RIIC ch1 (P512 SCL1 / P511 SDA1).
@ k_riic_target_seed_byte
Seed reply until a write arrives.
@ k_riic_target_own_addr
Our 7-bit own address.
@ k_riic_target_seed_len
Seed reply length.
@ k_riic_target_buf_len
Controller-write capture size.
static const uint8_t k_riic_target_msg_tx[]
static ra8_err_t riic_target_arm(riic_target_ctx_t *ctx)
Arm the RIIC1 target at 0x42 with a clock-stretched callback.
static void riic_target_setup_or_halt(void)
Bring CGC + console + RIIC1 up.
static const uint8_t k_riic_target_msg_rx[]
static void riic_target_on_event(void *vctx, ra8_i2c_peripheral_event_t event)
Address-match callback: service the controller-driven transfer.
static void riic_target_panic_halt(void)
Park forever after a fatal init failure.
static const uint8_t k_riic_target_msg_armed[]
SCI8 status strings emitted per target event.
static void riic_target_clocks_or_halt(void)
Bring CGC + SysTick + MSTP up.
riic_target_u32_t
32-bit app tunables (baud, bus rate).
@ k_riic_target_bus_hz
RIIC1 bus clock (unused here; the board bring-up owns the rate, kept for clarity).
@ k_riic_target_baud
SCI8 console baud.
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
ra8_err_t ra8_board_led_init(ra8_board_led_id_t led)
Configure led as a digital output, initial level low (off).
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
ra8_err_t ra8_board_io_expander_apply_project_sw4_defaults(void)
Program the U15 I/O expander to apply the project's SW4 layout.
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
Boot entry points shared between a vector table and its startup code.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
I2C Bus Interface (IIC) controller driver – polling mode.
ra8_err_t ra8_i2c_peripheral_transmit(uint8_t channel, const uint8_t *data, uint32_t len, uint32_t *out_sent)
Answer a controller-read transaction from data (target transmit).
ra8_err_t ra8_i2c_peripheral_init(uint8_t channel, const ra8_i2c_peripheral_cfg_t *cfg)
Arm an IIC channel to answer as an I2C target (peripheral).
@ k_ra8_i2c_peripheral_slot_0
Own-address slot 0 (SARL0/SARU0).
void ra8_i2c_peripheral_dispatch(uint8_t channel)
Snapshot the latched target status and fire the attached callback.
ra8_err_t ra8_i2c_peripheral_receive(uint8_t channel, uint8_t *buf, uint32_t capacity, uint32_t *out_received)
Drain a controller-write transaction into buf (target receive).
ra8_i2c_peripheral_event_t
Outcome of ra8_i2c_peripheral_poll / ra8_i2c_peripheral_dispatch.
@ k_ra8_i2c_peripheral_event_write
Controller WRITE: call receive next.
@ k_ra8_i2c_peripheral_event_read
Controller READ: call transmit next.
ra8_err_t ra8_i2c_peripheral_attach_handler(uint8_t channel, ra8_i2c_peripheral_event_fn_t fn, void *ctx)
Attach (or detach) the address-match callback for a channel.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
static sdfont_ctx_t s_ctx
Single-shot transport context for the SD bus shim.
SysTick-based tick counter, delay and timestamp helpers.
ra8_err_t ra8_time_init(uint32_t cpu_hz)
Initialise SysTick for a 1 kHz tick interrupt.
Configuration descriptor for ra8_i2c_peripheral_init.
Callback context: the channel and the last controller-write payload.
uint32_t rx_len
Bytes captured from the last write (>= 1).
uint8_t channel
RIIC channel the target answers on.
uint8_t rx[k_riic_target_buf_len]
Last controller-write payload (echoed).