|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
THE single point of change for the RA8 <-> ESP32-C6 harness map. More...
Go to the source code of this file.
Enumerations | |
| enum | ra8_esp_hosted_pin_t : uint16_t { k_ra8_esp_hosted_pin_chip_select = (uint16_t)k_ra8_board_pmod1_spi_cs , k_ra8_esp_hosted_pin_copi = (uint16_t)k_ra8_board_pmod1_spi_copi , k_ra8_esp_hosted_pin_cipo = (uint16_t)k_ra8_board_pmod1_spi_cipo , k_ra8_esp_hosted_pin_sck = (uint16_t)k_ra8_board_pmod1_spi_sck , k_ra8_esp_hosted_pin_handshake = (uint16_t)k_ra8_board_pmod1_irq , k_ra8_esp_hosted_pin_data_ready = (uint16_t)k_ra8_board_pmod1_reset , k_ra8_esp_hosted_pin_reset = (uint16_t)k_ra8_pin_none } |
| RA8-side pin assignment for every esp-hosted link signal. More... | |
| enum | ra8_esp_hosted_irq_slot_t : uint8_t { k_ra8_esp_hosted_irq_none = 0xFFU } |
| Sentinel for "this pin has no ICU external-interrupt channel". More... | |
Functions | |
| uint8_t | ra8_esp_hosted_pin_irq_num (ra8_port_pin_t pin) |
| Report the ICU external-interrupt channel that serves a pin. | |
THE single point of change for the RA8 <-> ESP32-C6 harness map.
Every RA8-side pin fact about the esp-hosted link is stated once, here, and nowhere else. port_esp_hosted_host_config.h derives the upstream-spelled H_GPIO_* macros from these enumerators, and ra8_esp_hosted_pins.c derives the interrupt-routing table from the same list. Re-encoding any of it elsewhere is a defect.
The map moved once already. It was first written from the probe's candidate list while the module was disconnected; the rebuilt harness was then characterised at the J26 holes and put HANDSHAKE on P006 and DATA_READY on P402, the opposite way round. The gate exists because of that.
As wired, that puts the ICU edge on HANDSHAKE and the poll on DATA_READY, which suits the two signals' behaviour: HANDSHAKE pulses low for the duration of a chip-select assertion and is easy to miss, while DATA_READY stays asserted until the host drains the queued frame and so cannot be missed by a poll.
Definition in file ra8_esp_hosted_pins.h.
| enum ra8_esp_hosted_irq_slot_t : uint8_t |
Sentinel for "this pin has no ICU external-interrupt channel".
ra8_gpio_attach_irq accepts channels 0 through 15, so no legal channel can collide with this value. ra8_esp_hosted_pin_irq_num returns it for any pin the package does not route to the ICU, and the port's interrupt-configuration slot reads it as "use the software edge detector for this pin".
| Enumerator | |
|---|---|
| k_ra8_esp_hosted_irq_none | No ICU channel routes this pin. |
Definition at line 155 of file ra8_esp_hosted_pins.h.
| enum ra8_esp_hosted_pin_t : uint16_t |
RA8-side pin assignment for every esp-hosted link signal.
Values are packed ra8_port_pin_t codes taken straight from the board connector header. Signal directions, as seen by the RA8:
| Enumerator | |
|---|---|
| k_ra8_esp_hosted_pin_chip_select | Chip select, RA8 output. Pmod1.1; the probe resolved this net to the SPI position of the board's Pmod1 mode mux, which needs SW4-3 ON. |
| k_ra8_esp_hosted_pin_copi | Controller-out peripheral-in data, RA8 output, routed to the SCI channel rather than driven as a GPIO. |
| k_ra8_esp_hosted_pin_cipo | Controller-in peripheral-out data, RA8 input, routed to the SCI channel rather than sampled as a GPIO. |
| k_ra8_esp_hosted_pin_sck | Serial clock, RA8 output, routed to the SCI channel. |
| k_ra8_esp_hosted_pin_handshake | HANDSHAKE, RA8 input, C6 output. J26-7, which lands on P006 – the one Pmod1 side-band net with an ICU channel (IRQ11), so this signal gets the hardware edge path. |
| k_ra8_esp_hosted_pin_data_ready | DATA_READY, RA8 input, C6 output. J26-8, which lands on P402. The package routes no ICU channel there, so the port services it with its software edge detector. That is the right way round for this link even though DATA_READY is the more interesting signal: the C6 holds DATA_READY asserted until the host drains the frame, so a poll cannot miss it, whereas HANDSHAKE pulses low once per transaction and needs the edge. |
| k_ra8_esp_hosted_pin_reset | Co-processor reset, RA8 output. k_ra8_pin_none until the rebuilt harness wires one: pins.env records the C6 reset input as disconnected, and inventing a pin here would make the port drive an unrelated net during bring-up. |
Definition at line 101 of file ra8_esp_hosted_pins.h.
|
nodiscard |
Report the ICU external-interrupt channel that serves a pin.
Looks the packed pin up in the port's routing table, which records only the nets this link uses and the channel the package assigns to each. The table is a small linear scan rather than a sparse array indexed by pin, because it holds at most a handful of rows and a scan cannot be indexed out of range.
A pin that is not in the table has no channel as far as this port is concerned; that is reported as k_ra8_esp_hosted_irq_none rather than guessed, so a harness change can never silently attach an edge to the wrong channel.
| [in] | pin | Packed RA8_PIN(port, pin) code to look up. Any value is accepted, including k_ra8_pin_none. |
| k_ra8_esp_hosted_irq_none | The pin has no ICU routing on this package, or is not one of the link's side-band nets. |
Report the ICU external-interrupt channel that serves a pin.
Definition at line 131 of file ra8_esp_hosted_pins.c.
References k_ra8_esp_hosted_irq_none, pin, s_ra8_esp_hosted_irq_map, and s_ra8_esp_hosted_irq_map_rows.
Referenced by c6_hosted_print_route(), and internal_config_gpio_as_interrupt().