|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Library-private surface of the esp-hosted OS-abstraction vtable. More...
#include <stddef.h>#include <stdint.h>#include "esp_hosted_os_abstraction.h"#include "ra8_attributes.h"#include "ra8_err.h"Go to the source code of this file.
Functions | |
| ra8_err_t | priv_ra8_esp_hosted_osi_bind_all (hosted_osi_funcs_t *out) |
| Fill every row of the OS-abstraction vtable. | |
| void | priv_ra8_esp_hosted_osi_bind_absent (hosted_osi_funcs_t *out) |
| Fill the rows belonging to transports this board does not carry. | |
| bool | priv_ra8_esp_hosted_osi_is_complete (const hosted_osi_funcs_t *table) |
| Report whether every row of a table is populated. | |
| int | priv_ra8_esp_hosted_osi_dispatch_event (const char *base, int32_t event_id, const void *data, size_t data_len) |
| Deliver one posted event to the registered application handler. | |
Library-private surface of the esp-hosted OS-abstraction vtable.
The vtable is assembled from four slices – RTOS, GPIO, SPI and the rows that belong to no slice – each of which keeps its implementations static and exposes exactly one binder. This header declares the binders that live in ra8_esp_hosted_osi.c and ra8_esp_hosted_osi_absent.c, plus the two decisions promoted out of static so host tests can drive them without a live co-processor.
Nothing outside port/esp-hosted/ and tests/ may include this.
Definition in file ra8_esp_hosted_osi_internal.h.
| void priv_ra8_esp_hosted_osi_bind_absent | ( | hosted_osi_funcs_t * | out | ) |
Fill the rows belonging to transports this board does not carry.
The SDIO, half-duplex SPI and UART rows. Each reports the transport as absent and names the row that was called; none pretends to move data. See ra8_esp_hosted_osi_absent.c for why that is the truthful answer on this board rather than a placeholder.
| [out] | out | Table whose absent-transport rows are filled. Must be non-null. Only those rows are written. |
Fill the rows belonging to transports this board does not carry.
Definition at line 610 of file ra8_esp_hosted_osi_absent.c.
References internal_sdio_card_deinit(), internal_sdio_card_init(), internal_sdio_read_block(), internal_sdio_read_reg(), internal_sdio_wait_intr(), internal_sdio_write_block(), internal_sdio_write_reg(), internal_spi_hd_read_dma(), internal_spi_hd_read_reg(), internal_spi_hd_send_cmd9(), internal_spi_hd_set_data_lines(), internal_spi_hd_write_dma(), internal_spi_hd_write_reg(), internal_uart_flush_input(), internal_uart_read(), and internal_uart_write().
Referenced by priv_ra8_esp_hosted_osi_bind_all().
|
nodiscard |
Fill every row of the OS-abstraction vtable.
Zeroes the table, runs the RTOS, GPIO, SPI and absent-transport binders, installs the rows this file owns, and then verifies that no row was left null. The verification is the point: a slice that gains a row and forgets to bind it becomes a test failure here rather than a null dereference somewhere inside the vendored core.
| [out] | out | Table to populate. Must be non-null. Entirely overwritten, so a partially populated table cannot survive a second call. |
| k_ra8_ok | Every row is populated. |
| k_ra8_err_null_ptr | out was null. |
| k_ra8_err_invalid_state | A row was left null by its binder. |
Fill every row of the OS-abstraction vtable.
Definition at line 485 of file ra8_esp_hosted_osi.c.
References internal_config_host_power_save(), internal_event_post(), internal_event_wifi_post(), internal_init_hook(), internal_printf(), internal_restart_host(), internal_start_host_power_save(), k_ra8_err_invalid_state, k_ra8_ok, priv_ra8_esp_hosted_gpio_bind(), priv_ra8_esp_hosted_osi_bind_absent(), priv_ra8_esp_hosted_osi_is_complete(), priv_ra8_esp_hosted_rtos_bind(), priv_ra8_esp_hosted_rtos_bind_pool(), priv_ra8_esp_hosted_rtos_bind_sync(), priv_ra8_esp_hosted_spi_bind(), RA8_CHECK_NULL_PTR, and s_tag.
Referenced by internal_bring_up().
| int priv_ra8_esp_hosted_osi_dispatch_event | ( | const char * | base, |
| int32_t | event_id, | ||
| const void * | data, | ||
| size_t | data_len ) |
Deliver one posted event to the registered application handler.
The single decision behind both event rows of the vtable, so the generic and Wi-Fi paths cannot drift apart. Reports whether the event was consumed, which is what lets the core distinguish "nobody is listening" from "delivered".
| [in] | base | Event namespace; a null pointer is delivered as an empty string rather than dereferenced by the handler. |
| [in] | event_id | Identifier within the namespace. |
| [in] | data | Payload, or null when data_len is zero. |
| [in] | data_len | Payload length in bytes. |
| RET_OK | The handler ran. |
| RET_FAIL | No handler is registered. |
| RET_INVALID | The payload pointer and length disagree. |
Deliver one posted event to the registered application handler.
Definition at line 176 of file ra8_esp_hosted_osi.c.
References RET_FAIL, RET_INVALID, RET_OK, s_ra8_esp_hosted_event_cb, and s_ra8_esp_hosted_event_ctx.
Referenced by internal_event_post(), and internal_event_wifi_post().
|
nodiscard |
Report whether every row of a table is populated.
Walks the table as an array of function pointers rather than naming sixty-odd fields, so a row added to the vendored structure is covered the moment it exists. That is deliberate: a hand-written field list would silently stop covering new rows, which is the exact failure this check exists to prevent.
| [in] | table | Table to inspect. Must be non-null. |
| true | Every row is populated. |
| false | table was null, or at least one row is null. |
Report whether every row of a table is populated.
Definition at line 465 of file ra8_esp_hosted_osi.c.
References ra8_esp_hosted_osi_view::rows.
Referenced by priv_ra8_esp_hosted_osi_bind_all().