|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Banner, resolved pin map and side-band reporting for the bring-up. More...
#include <stddef.h>#include <stdint.h>#include "c6_hosted.h"#include "esp_hosted_os_abstraction.h"#include "port_esp_hosted_host_config.h"#include "ra8_board_ek_ra8d2.h"#include "ra8_esp_hosted_pins.h"#include "ra8_spi.h"Go to the source code of this file.
Functions | |
| static void | c6_hosted_print_route (const char *label, ra8_esp_hosted_pin_t pin) |
| Print the interrupt path the port takes for one side-band pin. | |
| static void | c6_hosted_read_sideband (const char *label, void *gpio_port, int32_t gpio_pin, int32_t active) |
| Sample one side-band input through the OS-abstraction vtable. | |
| void | c6_hosted_print_banner (uint32_t cpuclk_hz, uint32_t pclka_hz) |
| Print the port identity, the clocks and the SPI parameters. | |
| void | c6_hosted_print_pin_map (void) |
| Print the resolved pin map, bus pins and side-band alike. | |
| void | c6_hosted_report_sideband (void) |
| Sample both side-band lines through the vtable and report them. | |
| void | c6_hosted_on_event (void *ctx, const char *base, int32_t event_id, const void *data, size_t data_len) |
| Report an event the port delivered from the vendored core. | |
| uint32_t | c6_hosted_event_count (void) |
| Report how many events c6_hosted_on_event has seen. | |
Variables | |
| static volatile uint32_t | s_c6_hosted_events |
| Number of events c6_hosted_on_event has been handed. | |
Banner, resolved pin map and side-band reporting for the bring-up.
Everything the application states about the link before it clocks a single bit: the port identity and SPI parameters, the pin map the port resolved, the interrupt path each side-band net actually gets, and the live level of both side-band lines read through the OS-abstraction vtable. The event handler lives here too, since what it does is report.
Definition in file c6_hosted_report.c.
| uint32_t c6_hosted_event_count | ( | void | ) |
Report how many events c6_hosted_on_event has seen.
| 0 | The co-processor has never announced anything. |
Definition at line 182 of file c6_hosted_report.c.
References s_c6_hosted_events.
Referenced by c6_hosted_heartbeat().
| void c6_hosted_on_event | ( | void * | ctx, |
| const char * | base, | ||
| int32_t | event_id, | ||
| const void * | data, | ||
| size_t | data_len ) |
Report an event the port delivered from the vendored core.
| [in] | ctx | Registered context; unused, the counter is file-scope. |
| [in] | base | Event namespace; never null per the port contract. |
| [in] | event_id | Identifier within that namespace. |
| [in] | data | Payload, or null; not decoded here. |
| [in] | data_len | Payload length in bytes. |
Definition at line 164 of file c6_hosted_report.c.
References c6_hosted_put_i32(), c6_hosted_put_u32(), c6_hosted_puts(), and s_c6_hosted_events.
Referenced by tx_application_define().
| void c6_hosted_print_banner | ( | uint32_t | cpuclk_hz, |
| uint32_t | pclka_hz ) |
Print the port identity, the clocks and the SPI parameters.
| [in] | cpuclk_hz | Live CPUCLK0 rate in hertz. |
| [in] | pclka_hz | Live PCLKA rate in hertz, the SCI baud-clock source. |
Definition at line 118 of file c6_hosted_report.c.
References c6_hosted_put_u32(), c6_hosted_puts(), k_c6_hosted_sck_hz, k_ra8_board_pmod1_sci_channel, and k_ra8_spi_mode_3.
Referenced by main().
| void c6_hosted_print_pin_map | ( | void | ) |
Print the resolved pin map, bus pins and side-band alike.
Definition at line 136 of file c6_hosted_report.c.
References c6_hosted_print_gpio(), c6_hosted_print_pin(), c6_hosted_print_route(), c6_hosted_puts(), H_GPIO_DATA_READY_Pin, H_GPIO_DATA_READY_Port, H_GPIO_HANDSHAKE_Pin, H_GPIO_HANDSHAKE_Port, H_GPIO_PIN_RESET, H_GPIO_PORT_RESET, k_ra8_esp_hosted_pin_chip_select, k_ra8_esp_hosted_pin_cipo, k_ra8_esp_hosted_pin_copi, k_ra8_esp_hosted_pin_data_ready, k_ra8_esp_hosted_pin_handshake, and k_ra8_esp_hosted_pin_sck.
Referenced by main().
|
static |
Print the interrupt path the port takes for one side-band pin.
| [in] | label | Signal name, printed verbatim. |
| [in] | pin | Packed side-band pin from the port's pin table. |
pin is one of the link's side-band nets. Definition at line 70 of file c6_hosted_report.c.
References c6_hosted_print_pin(), c6_hosted_put_u32(), c6_hosted_puts(), k_c6_hosted_edge_poll_ms, k_ra8_esp_hosted_irq_none, pin, and ra8_esp_hosted_pin_irq_num().
Referenced by c6_hosted_print_pin_map().
|
static |
Sample one side-band input through the OS-abstraction vtable.
| [in] | label | Signal name, printed verbatim. |
| [in] | gpio_port | Opaque port handle from the matching macro pair. |
| [in] | gpio_pin | Pin index from the same pair, negative if unwired. |
| [in] | active | Level that means "asserted" for this signal. |
gpio_port and gpio_pin are the two halves of one macro pair. Definition at line 102 of file c6_hosted_report.c.
References c6_hosted_put_i32(), c6_hosted_puts(), and g_h.
Referenced by c6_hosted_report_sideband().
| void c6_hosted_report_sideband | ( | void | ) |
Sample both side-band lines through the vtable and report them.
Definition at line 152 of file c6_hosted_report.c.
References c6_hosted_read_sideband(), H_DR_VAL_ACTIVE, H_GPIO_DATA_READY_Pin, H_GPIO_DATA_READY_Port, H_GPIO_HANDSHAKE_Pin, H_GPIO_HANDSHAKE_Port, and H_HS_VAL_ACTIVE.
Referenced by c6_hosted_heartbeat(), and c6_hosted_worker_entry().
|
static |
Number of events c6_hosted_on_event has been handed.
Surfaced through c6_hosted_event_count and printed on every heartbeat, so a scope-less bench can still see whether the co-processor ever announced itself.
Definition at line 54 of file c6_hosted_report.c.
Referenced by c6_hosted_event_count(), and c6_hosted_on_event().