86 if (out_pin ==
nullptr) {
163 if (out_pin ==
nullptr) {
185 if (out_pressed ==
nullptr) {
267typedef enum : uint32_t {
280 uint32_t pclka_hz = 0U;
293 "ra8_board.uart.console.txd");
299 "ra8_board.uart.console.rxd");
324 if (data ==
nullptr) {
335 if (out_len ==
nullptr) {
342 if (out ==
nullptr) {
352 for (
size_t i = 0U; i < cap; ++i) {
static const uint8_t s_sw_irq_nums[k_ra8_board_sw_count]
Lookup table from ra8_board_sw_id_t to ICU IRQ channel.
static const ra8_port_pin_t s_led_pins[k_ra8_board_led_count]
Lookup table from ra8_board_led_id_t to ra8_port_pin_t.
static const ra8_port_pin_t s_sw_pins[k_ra8_board_sw_count]
Lookup table from ra8_board_sw_id_t to ra8_port_pin_t.
ra8_board_uart_console_clock_t
Minimum SCI module operating clock accepted by the console init.
@ k_ra8_board_uart_console_min_pclka_hz
RA8 board UART console minimum pclka Hz.
static bool s_uart_console_initialized
Tracks whether ra8_board_uart_console_init has succeeded.
const char *const k_ra8_board_doc_rev
"R20UT5523EG0101 Rev 1.01".
const char *const k_ra8_board_name
Human-readable strings identifying this BSP target.
ra8_board_sw_id_t
Identifiers for the on-board user push-buttons.
@ k_ra8_board_sw_count
RA8 board sw count.
@ k_ra8_board_sw1
SW1, P009, IRQ13-DS (jumper E31).
@ k_ra8_board_sw2
SW2, P008, IRQ12-DS (jumper E32).
const char *const k_ra8_board_mcu
"R7KA8D2KFLCAC".
@ k_ra8_board_sw2_irq
SW2 -> IRQ12-DS.
@ k_ra8_board_sw1_irq
SW1 -> IRQ13-DS.
void(* ra8_board_sw_irq_cb_t)(void *ctx)
Switch IRQ callback signature.
ra8_board_sw_state_t
Logical "pressed" / "released" state.
@ k_ra8_board_sw_released
RA8 board sw released.
@ k_ra8_board_sw_pressed
RA8 board sw pressed.
ra8_board_led_id_t
Identifiers for the three user LEDs on EK-RA8D2 v1.
@ k_ra8_board_led2
LED2, GREEN, P303 (jumper E26).
@ k_ra8_board_led_count
RA8 board led count.
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
@ k_ra8_board_led3
LED3, RED, PA07 (jumper E28).
ra8_board_eth_pin_t pin
Pin.
@ k_ra8_board_uart_console_pin_txd
PD02 TXD.
@ k_ra8_board_uart_console_pin_rxd
PD03 RXD.
@ k_ra8_board_uart_console_sci_channel
PD02/PD03 -> SCI8 (verified on real EK-RA8D2 v1 silicon).
ra8_err_t ra8_board_sw_pin(ra8_board_sw_id_t sw, ra8_port_pin_t *out_pin)
Translate a board switch id into its underlying ra8_port_pin_t.
ra8_err_t ra8_board_uart_console_read(uint8_t *out, size_t cap, size_t *out_len)
Polled non-blocking read from the J-Link OB VCOM console.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
ra8_err_t ra8_board_sw_attach_irq(ra8_board_sw_id_t sw, ra8_board_sw_irq_cb_t cb, void *ctx)
Wire sw to the ICU and register a falling-edge callback.
ra8_err_t ra8_board_sw_read(ra8_board_sw_id_t sw, ra8_board_sw_state_t *out_pressed)
Sample the current state of sw.
ra8_err_t ra8_board_sw_init(ra8_board_sw_id_t sw)
Configure a switch pin as an input with internal pull-up.
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.
ra8_err_t ra8_board_led_pin(ra8_board_led_id_t led, ra8_port_pin_t *out_pin)
Translate a board LED id into its underlying ra8_port_pin_t.
ra8_err_t ra8_board_led_init(ra8_board_led_id_t led)
Configure led as a digital output, initial level low (off).
ra8_err_t ra8_board_led_on(ra8_board_led_id_t led)
Drive led HIGH (light it).
ra8_err_t ra8_board_get_info(ra8_board_info_t *out)
Copy the three board-identity strings into out.
ra8_err_t ra8_board_uart_console_flush(void)
Block until every byte queued on the J-Link OB VCOM console has finished clocking out on the wire.
ra8_err_t ra8_board_led_off(ra8_board_led_id_t led)
Drive led LOW (extinguish it).
Board-support layer for the Renesas RA8P1 (R7KA8P1KFLCAC) target board.
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_pclka
PCLKA.
Event Link Controller (ELC) register layout for the Renesas RA8D2.
ra8_elc_event_t
Partial list of ELC events (populate as drivers need them).
@ k_ra8_elc_event_icu_irq12
External pin interrupt 12 (HUM Ch 14 ELC event 0x00D).
@ k_ra8_elc_event_icu_irq13
External pin interrupt 13 (HUM Ch 14 ELC event 0x00E).
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
PSEL codes for peripheral pin routing on the RA8D2.
@ k_ra8_psel_sci_async
00100b: SCI async serial (UART).
Interrupt Control Unit driver (IRQ pins, NMI).
ra8_err_t ra8_icu_configure_irq_pin(uint8_t irq_num, const ra8_icu_irq_cfg_t *cfg)
Programme one IRQCRi register.
Interrupt Control Unit (ICU) register layout for the Renesas RA8D2.
@ k_ra8_icu_fclksel_pclkb
00: sample every PCLKB cycle.
@ k_ra8_icu_irqmd_falling
00: falling edge.
NVIC + ICU IELSR allocator.
void(* ra8_isr_handler_t)(void *ctx)
Driver-supplied callback invoked on interrupt entry.
@ k_ra8_isr_prio_default
Middle priority.
ra8_err_t ra8_isr_register(ra8_elc_event_t event, ra8_isr_handler_t handler, void *ctx, uint8_t priority, uint16_t *out_slot)
Allocate an IELSR slot for an ELC event + handler.
Typed Port / Pin Constants for the RA8D2 IOPORT Module.
ra8_port_pin_t
Packed (port << 8) | pin pin identifier.
@ k_ra8_pin_none
Sentinel: no pin selected.
@ k_ra8_port_3
RA8 port 3.
@ k_ra8_port_6
RA8 port 6.
@ k_ra8_port_0
RA8 port 0.
@ k_ra8_port_10
RA8 port 10.
#define RA8_PIN(port, pin)
Build a ra8_port_pin_t from explicit port / pin indices.
ra8_level_t
Digital output / input level.
@ k_ra8_level_high
Drive or read 1.
@ k_ra8_level_low
Drive or read 0.
@ k_ra8_pull_up
Internal pull-up.
High-level GPIO helpers on top of the PORT + PFS register layer.
ra8_err_t ra8_gpio_read(ra8_port_pin_t pin, ra8_level_t *out_level)
Read a previously-configured input.
ra8_err_t ra8_gpio_input_init(ra8_port_pin_t pin, ra8_pin_pull_t pull)
Configure a pin as a digital input.
ra8_err_t ra8_gpio_toggle(ra8_port_pin_t pin)
Toggle a previously-configured output.
ra8_err_t ra8_gpio_output_init(ra8_port_pin_t pin, ra8_level_t init_level)
Configure a pin as a digital output and drive it to an initial level.
ra8_err_t ra8_gpio_write(ra8_port_pin_t pin, ra8_level_t level)
Drive a previously-configured output to the given level.
ra8_err_t ra8_pfs_route_peripheral(ra8_port_pin_t pin, ra8_psel_t psel, const char *owner)
Route a pin to a non-IRQ peripheral function via PFS.PSEL.
Full-featured Serial Communications Interface driver.
ra8_err_t ra8_sci_write_polling(uint8_t channel, const uint8_t *data, uint32_t len)
Send len bytes by polling (convenience wrapper).
@ k_ra8_sci_stop_1
RA8 SCI stop 1.
@ k_ra8_sci_parity_none
RA8 SCI parity none.
ra8_err_t ra8_sci_init(uint8_t channel, const ra8_sci_cfg_t *cfg)
Initialise an SCI channel using the descriptor.
ra8_err_t ra8_sci_getc_polling(uint8_t channel, uint8_t *out_byte)
Poll-receive one byte (blocking, bounded spin).
@ k_ra8_sci_data_8
RA8 SCI data 8.
ra8_err_t ra8_sci_flush(uint8_t channel)
Block until the channel's transmit shift register is empty.
Snapshot of board identity strings.
const char * doc_rev
Same value as k_ra8_board_doc_rev.
const char * mcu
Same value as k_ra8_board_mcu.
const char * name
Same value as k_ra8_board_name.
One external-IRQ-pin configuration descriptor.
Configuration descriptor for ra8_sci_init.