|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
esp-hosted port header: transport selection, side-band pin map, link polarity. More...
#include <stdint.h>#include "ra8_esp_hosted_pins.h"#include "port_esp_hosted_host_config_features.h"#include "port_esp_hosted_host_config_transports.h"Go to the source code of this file.
Macros | |
| #define | H_TRANSPORT_NONE (0) |
| No transport has been configured yet. | |
| #define | H_TRANSPORT_SPI (1) |
| Transport id of the full-duplex SPI link. | |
| #define | H_TRANSPORT_SDIO (2) |
| Transport id of the SDIO link. | |
| #define | H_TRANSPORT_SPI_HD (3) |
| Transport id of the half-duplex (1/2/4-line) SPI link. | |
| #define | H_TRANSPORT_UART (4) |
| Transport id of the UART link. | |
| #define | H_TRANSPORT_IN_USE (H_TRANSPORT_SPI) |
| The transport this image actually drives. | |
| #define | H_SLAVE_TARGET_ESP32C6 (1) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor on this board is an ESP32-C6. | |
| #define | H_SLAVE_TARGET_ESP32 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an original ESP32. | |
| #define | H_SLAVE_TARGET_ESP32C2 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an ESP32-C2. | |
| #define | H_SLAVE_TARGET_ESP32C3 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an ESP32-C3. | |
| #define | H_SLAVE_TARGET_ESP32C5 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an ESP32-C5. | |
| #define | H_SLAVE_TARGET_ESP32C61 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an ESP32-C61. | |
| #define | H_SLAVE_TARGET_ESP32H2 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an ESP32-H2. | |
| #define | H_SLAVE_TARGET_ESP32H4 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an ESP32-H4. | |
| #define | H_SLAVE_TARGET_ESP32S2 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an ESP32-S2. | |
| #define | H_SLAVE_TARGET_ESP32S3 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
| The co-processor is not an ESP32-S3. | |
| #define | RA8_ESP_HOSTED_GPIO_PORT(pin_code) |
| Extract the void* port half of a packed RA8 pin. | |
| #define | RA8_ESP_HOSTED_GPIO_PIN(pin_code) |
| Extract the int pin half of a packed RA8 pin, or -1 if unwired. | |
| #define | H_GPIO_HANDSHAKE_Port RA8_ESP_HOSTED_GPIO_PORT(k_ra8_esp_hosted_pin_handshake) |
| Opaque port handle of the HANDSHAKE input. | |
| #define | H_GPIO_HANDSHAKE_Pin RA8_ESP_HOSTED_GPIO_PIN(k_ra8_esp_hosted_pin_handshake) |
| Pin index of the HANDSHAKE input, or -1 when it is not wired. | |
| #define | H_GPIO_DATA_READY_Port RA8_ESP_HOSTED_GPIO_PORT(k_ra8_esp_hosted_pin_data_ready) |
| Opaque port handle of the DATA_READY input. | |
| #define | H_GPIO_DATA_READY_Pin RA8_ESP_HOSTED_GPIO_PIN(k_ra8_esp_hosted_pin_data_ready) |
| Pin index of the DATA_READY input, or -1 when it is not wired. | |
| #define | H_GPIO_PORT_RESET RA8_ESP_HOSTED_GPIO_PORT(k_ra8_esp_hosted_pin_reset) |
| Opaque port handle of the co-processor reset output. | |
| #define | H_GPIO_PIN_RESET RA8_ESP_HOSTED_GPIO_PIN(k_ra8_esp_hosted_pin_reset) |
| Pin index of the co-processor reset output, or -1 when unwired. | |
| #define | H_HANDSHAKE_ACTIVE_HIGH (1) |
| Whether the co-processor asserts HANDSHAKE by driving it high. | |
| #define | H_DATAREADY_ACTIVE_HIGH (1) |
| Whether the co-processor asserts DATA_READY by driving it high. | |
| #define | H_HS_VAL_ACTIVE (1) |
| Level read back on HANDSHAKE when it is asserted. | |
| #define | H_HS_VAL_INACTIVE (0) |
| Level read back on HANDSHAKE when it is deasserted. | |
| #define | H_HS_INTR_EDGE (1) |
| Interrupt sense the port programs for the HANDSHAKE input. | |
| #define | H_DR_VAL_ACTIVE (1) |
| Level read back on DATA_READY when a frame is waiting. | |
| #define | H_DR_VAL_INACTIVE (0) |
| Level read back on DATA_READY when nothing is waiting. | |
| #define | H_DR_INTR_EDGE (1) |
| Interrupt sense the port programs for the DATA_READY input. | |
| #define | H_RESET_VAL_ACTIVE (0) |
| Level that holds the co-processor in reset. | |
| #define | H_RESET_VAL_INACTIVE (1) |
| Level that releases the co-processor from reset. | |
| #define | H_TRANSPORT_QUEUE_SIZE (20) |
| Frames a single transport direction can hold. | |
| #define | H_ESP_HOSTED_HOST (1) |
| Marks this build as the esp-hosted host, not the co-processor. | |
| #define | H_ESP_PAYLOAD_HEADER_OFFSET (12) |
| Bytes of esp-hosted payload header in front of every frame. | |
| #define | H_SPI_FD_CLK_MHZ (5) |
| Full-duplex SPI clock, in megahertz. | |
| #define | H_ENABLE (1) |
| Generic "switch this on" argument for the GPIO vtable. | |
| #define | H_DISABLE (0) |
| Generic "switch this off" argument for the GPIO vtable. | |
esp-hosted port header: transport selection, side-band pin map, link polarity.
The most widely reached of the ten port headers the vendored esp-hosted core includes by name (see docs/SOUP/esp-hosted-host.md): nineteen vendored translation units name it, either directly or through transport_drv.h. Upstream generates its equivalent from Kconfig under host/port/, which this project excludes; this file is its first-party replacement and therefore keeps the upstream file name and every upstream macro spelling exactly.
Definition in file port_esp_hosted_host_config.h.
| #define H_DATAREADY_ACTIVE_HIGH (1) |
Whether the co-processor asserts DATA_READY by driving it high.
One, for the same image and the same bench observation as H_HANDSHAKE_ACTIVE_HIGH.
Definition at line 538 of file port_esp_hosted_host_config.h.
| #define H_DISABLE (0) |
Generic "switch this off" argument for the GPIO vtable.
Zero, the complement of H_ENABLE.
Definition at line 880 of file port_esp_hosted_host_config.h.
| #define H_DR_INTR_EDGE (1) |
Interrupt sense the port programs for the DATA_READY input.
One, which is k_ra8_icu_irqmd_rising. This is the edge that actually wakes the transaction pump, so it is the latency-critical one.
Definition at line 671 of file port_esp_hosted_host_config.h.
| #define H_DR_VAL_ACTIVE (1) |
Level read back on DATA_READY when a frame is waiting.
One, because H_DATAREADY_ACTIVE_HIGH is 1.
Definition at line 639 of file port_esp_hosted_host_config.h.
Referenced by c6_hosted_report_sideband(), and ra8_esp_hosted_port_rx_pending().
| #define H_DR_VAL_INACTIVE (0) |
Level read back on DATA_READY when nothing is waiting.
Zero, the complement of H_DR_VAL_ACTIVE.
Definition at line 654 of file port_esp_hosted_host_config.h.
| #define H_ENABLE (1) |
Generic "switch this on" argument for the GPIO vtable.
One. Passed as the enable argument of _h_pull_gpio and as the hold_value of _h_hold_gpio.
Definition at line 866 of file port_esp_hosted_host_config.h.
| #define H_ESP_HOSTED_HOST (1) |
Marks this build as the esp-hosted host, not the co-processor.
One. The vendored sources are shared between both ends; this is the side that drives the bus and runs the RPC client.
Definition at line 808 of file port_esp_hosted_host_config.h.
| #define H_ESP_PAYLOAD_HEADER_OFFSET (12) |
Bytes of esp-hosted payload header in front of every frame.
Twelve, which is sizeof(struct esp_payload_header) for the layout in the vendored common/esp_hosted_header.h: a packed interface/number byte, flags, length, offset, checksum, sequence number, a throttle-and-reserved byte and the trailing one-byte union. That header defines the same macro from the sizeof; the guard means whichever header a translation unit reaches first wins, and both give 12.
Definition at line 830 of file port_esp_hosted_host_config.h.
| #define H_GPIO_DATA_READY_Pin RA8_ESP_HOSTED_GPIO_PIN(k_ra8_esp_hosted_pin_data_ready) |
Pin index of the DATA_READY input, or -1 when it is not wired.
Derived from k_ra8_esp_hosted_pin_data_ready. The C6 asserts it while its transmit queue holds a frame for the host, and keeps it asserted until the host drains that frame.
Definition at line 459 of file port_esp_hosted_host_config.h.
Referenced by c6_hosted_print_pin_map(), c6_hosted_report_sideband(), esp_hosted_get_default_spi_config(), internal_configure_sideband(), and ra8_esp_hosted_port_rx_pending().
| #define H_GPIO_DATA_READY_Port RA8_ESP_HOSTED_GPIO_PORT(k_ra8_esp_hosted_pin_data_ready) |
Opaque port handle of the DATA_READY input.
Derived from k_ra8_esp_hosted_pin_data_ready; see the encoding contract in this file's header block.
Definition at line 438 of file port_esp_hosted_host_config.h.
Referenced by c6_hosted_print_pin_map(), c6_hosted_report_sideband(), esp_hosted_get_default_spi_config(), internal_configure_sideband(), and ra8_esp_hosted_port_rx_pending().
| #define H_GPIO_HANDSHAKE_Pin RA8_ESP_HOSTED_GPIO_PIN(k_ra8_esp_hosted_pin_handshake) |
Pin index of the HANDSHAKE input, or -1 when it is not wired.
Derived from k_ra8_esp_hosted_pin_handshake. The C6 asserts this line when it is ready for the next transaction and deasserts it on the chip-select edge.
Definition at line 422 of file port_esp_hosted_host_config.h.
Referenced by c6_fwver_wait_handshake(), c6_hosted_print_pin_map(), c6_hosted_report_sideband(), esp_hosted_get_default_spi_config(), internal_configure_sideband(), and internal_ra8_esp_hosted_c6link_handshake().
| #define H_GPIO_HANDSHAKE_Port RA8_ESP_HOSTED_GPIO_PORT(k_ra8_esp_hosted_pin_handshake) |
Opaque port handle of the HANDSHAKE input.
Derived from k_ra8_esp_hosted_pin_handshake; see the encoding contract in this file's header block.
Definition at line 404 of file port_esp_hosted_host_config.h.
Referenced by c6_fwver_wait_handshake(), c6_hosted_print_pin_map(), c6_hosted_report_sideband(), esp_hosted_get_default_spi_config(), internal_configure_sideband(), and internal_ra8_esp_hosted_c6link_handshake().
| #define H_GPIO_PIN_RESET RA8_ESP_HOSTED_GPIO_PIN(k_ra8_esp_hosted_pin_reset) |
Pin index of the co-processor reset output, or -1 when unwired.
Minus one on this harness: coprocessor/esp32c6/pins.env records the C6 reset input as disconnected, so the pin table sets k_ra8_esp_hosted_pin_reset to k_ra8_pin_none.
Definition at line 492 of file port_esp_hosted_host_config.h.
Referenced by c6_hosted_print_pin_map(), and esp_hosted_get_default_spi_config().
| #define H_GPIO_PORT_RESET RA8_ESP_HOSTED_GPIO_PORT(k_ra8_esp_hosted_pin_reset) |
Opaque port handle of the co-processor reset output.
Derived from k_ra8_esp_hosted_pin_reset. Used as the fall-back reset pin before any transport configuration has been set.
Definition at line 475 of file port_esp_hosted_host_config.h.
Referenced by c6_hosted_print_pin_map(), and esp_hosted_get_default_spi_config().
| #define H_HANDSHAKE_ACTIVE_HIGH (1) |
Whether the co-processor asserts HANDSHAKE by driving it high.
One. The stock esp-hosted C6 image drives HANDSHAKE high to say "ready for the next transaction"; the bench probe saw the same.
Definition at line 520 of file port_esp_hosted_host_config.h.
| #define H_HS_INTR_EDGE (1) |
Interrupt sense the port programs for the HANDSHAKE input.
One, which is k_ra8_icu_irqmd_rising – the asserting edge of an active-high line. Written as an integer so the HAL register header does not have to be visible to the vendored core.
Definition at line 589 of file port_esp_hosted_host_config.h.
| #define H_HS_VAL_ACTIVE (1) |
Level read back on HANDSHAKE when it is asserted.
One, because H_HANDSHAKE_ACTIVE_HIGH is 1.
Definition at line 555 of file port_esp_hosted_host_config.h.
Referenced by c6_fwver_wait_handshake(), c6_hosted_report_sideband(), and internal_ra8_esp_hosted_c6link_handshake().
| #define H_HS_VAL_INACTIVE (0) |
Level read back on HANDSHAKE when it is deasserted.
Zero, the complement of H_HS_VAL_ACTIVE.
Definition at line 570 of file port_esp_hosted_host_config.h.
| #define H_RESET_VAL_ACTIVE (0) |
Level that holds the co-processor in reset.
Zero: the ESP32 reset input (EN) is active-low, so asserting reset means driving the line low.
Definition at line 724 of file port_esp_hosted_host_config.h.
| #define H_RESET_VAL_INACTIVE (1) |
Level that releases the co-processor from reset.
One, the complement of H_RESET_VAL_ACTIVE.
Definition at line 739 of file port_esp_hosted_host_config.h.
Referenced by internal_config_gpio().
| #define H_SLAVE_TARGET_ESP32 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an original ESP32.
Zero. Also read by sdio_reg.h to pick a register layout, which is another reason it must be honest rather than merely unused.
Definition at line 254 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32C2 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an ESP32-C2.
Zero; no C2 module exists on this bench.
Definition at line 263 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32C3 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an ESP32-C3.
Zero; no C3 module exists on this bench.
Definition at line 272 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32C5 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an ESP32-C5.
Zero. Also consulted by sdio_reg.h.
Definition at line 281 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32C6 (1) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor on this board is an ESP32-C6.
One. coprocessor/esp32c6/pins.env pins the module, the ESP-IDF version (v5.5.4) and the esp-hosted-mcu commit it is built from; the part reports chip id 0x0D in its boot event.
Definition at line 237 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32C61 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an ESP32-C61.
Zero. Also consulted by sdio_reg.h.
Definition at line 290 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32H2 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an ESP32-H2.
Zero; the H2 has no Wi-Fi radio, which is the point of this link.
Definition at line 299 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32H4 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an ESP32-H4.
Zero; no H4 module exists on this bench.
Definition at line 308 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32S2 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an ESP32-S2.
Zero; no S2 module exists on this bench.
Definition at line 317 of file port_esp_hosted_host_config.h.
| #define H_SLAVE_TARGET_ESP32S3 (0) /* LEGACY-OK: upstream esp-hosted macro name */ |
The co-processor is not an ESP32-S3.
Zero; no S3 module exists on this bench.
Definition at line 326 of file port_esp_hosted_host_config.h.
| #define H_SPI_FD_CLK_MHZ (5) |
Full-duplex SPI clock, in megahertz.
Five: a deliberately conservative first-light rate. The landed link probe clocked at 1 MHz, the C6 full-duplex peripheral tolerates up to 40, and the RA8 side runs on the SCI Simple-SPI backend, which is a polled byte engine – the ceiling here is host software, not the wire. Five is fast enough that a 1600-byte frame is not the bottleneck and slow enough that a marginal Pmod harness still latches.
Definition at line 851 of file port_esp_hosted_host_config.h.
Referenced by esp_hosted_get_default_spi_config().
| #define H_TRANSPORT_IN_USE (H_TRANSPORT_SPI) |
The transport this image actually drives.
H_TRANSPORT_SPI. Both ends must agree: the co-processor image sets CONFIG_ESP_SPI_HOST_INTERFACE=y and CONFIG_SPI_HSPI=y in coprocessor/esp32c6/sdkconfig.defaults.
Definition at line 207 of file port_esp_hosted_host_config.h.
| #define H_TRANSPORT_NONE (0) |
No transport has been configured yet.
Zero, and the initial value of the transport-configuration union's discriminant. esp_hosted_transport_get_reset_config() treats it as "fall back to the compile-time reset pin".
Definition at line 114 of file port_esp_hosted_host_config.h.
| #define H_TRANSPORT_QUEUE_SIZE (20) |
Frames a single transport direction can hold.
Twenty, matching the per-direction depths the vendored spi_drv.h already hard-codes. transport_drv.c sizes the shared mempool from this value, so keeping the two equal is what stops the pool running dry while the queues still have room.
Definition at line 761 of file port_esp_hosted_host_config.h.
| #define H_TRANSPORT_SDIO (2) |
Transport id of the SDIO link.
Two. Not used on this board: the only SDHI socket carries the SD card, and the C6 module is wired to a Pmod SPI position.
Definition at line 152 of file port_esp_hosted_host_config.h.
| #define H_TRANSPORT_SPI (1) |
Transport id of the full-duplex SPI link.
One. This is the transport the EK-RA8D2 uses: four wires plus HANDSHAKE and DATA_READY, matching the ESP32-C6 image built from coprocessor/esp32c6/.
Definition at line 134 of file port_esp_hosted_host_config.h.
| #define H_TRANSPORT_SPI_HD (3) |
Transport id of the half-duplex (1/2/4-line) SPI link.
Three. Not used: the C6 image is built with CONFIG_ESP_SPI_HOST_INTERFACE, the full-duplex mode.
Definition at line 170 of file port_esp_hosted_host_config.h.
| #define H_TRANSPORT_UART (4) |
Transport id of the UART link.
Four. Not used: a byte-framed UART cannot carry the 1600-byte frames the rest of this port is sized for at any useful rate.
Definition at line 188 of file port_esp_hosted_host_config.h.
| #define RA8_ESP_HOSTED_GPIO_PIN | ( | pin_code | ) |
Extract the int pin half of a packed RA8 pin, or -1 if unwired.
Decodes the low byte with RA8_PIN_PIN(), except that the k_ra8_pin_none sentinel maps to -1 – the value the vendored SPI driver tests against before it configures or tears down a side-band interrupt.
Both sides of the sentinel test are narrowed to uint16_t first. The argument and k_ra8_pin_none come from different enumerations, and comparing two enumerated types directly is a -Wenum-compare error under this project's warning settings.
| [in] | pin_code | Packed RA8_PIN(port, pin) value, or k_ra8_pin_none. |
Definition at line 376 of file port_esp_hosted_host_config.h.
Referenced by esp_hosted_get_default_spi_config().
| #define RA8_ESP_HOSTED_GPIO_PORT | ( | pin_code | ) |
Extract the void* port half of a packed RA8 pin.
Decodes the high byte of a ra8_port_pin_t with RA8_PIN_PORT() and carries it through uintptr_t into the opaque pointer the vendored vtable takes. Port 0 therefore yields a null pointer, which is a valid encoding here: the port decodes the integer back and range-checks it, and never treats null as "absent".
| [in] | pin_code | Packed RA8_PIN(port, pin) value. |
Definition at line 350 of file port_esp_hosted_host_config.h.
Referenced by esp_hosted_get_default_spi_config().