106 uint16_t max_transactions,
109 if ((link ==
nullptr) || (stats ==
nullptr)) {
113 uint16_t misses = 0U;
116 for (uint16_t i = 0U; i < max_transactions; i++) {
150 link->
stats =
nullptr;
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
bool priv_c6link_dispatch(ra8_c6link_t *link, const ra8_c6link_rx_view_t *view)
Route one well-formed received frame to whatever understands it.
The single integration boundary between this firmware and the ESP32-C6.
@ k_ra8_c6link_gap_ms
Settling gap between consecutive transactions.
@ k_ra8_c6link_hs_poll_ms
Sampling period while waiting for HANDSHAKE.
@ k_ra8_c6link_hs_wait_ms
Milliseconds to wait for HANDSHAKE before abandoning a transaction.
@ k_ra8_c6link_hs_giveup
Consecutive HANDSHAKE timeouts after which a pump stops early.
@ k_ra8_c6link_frame_bytes
Bytes in one transaction; ESP_TRANSPORT_SPI_MAX_BUF_SIZE upstream.
struct ra8_c6link_stats ra8_c6link_stats_t
struct ra8_c6link ra8_c6link_t
void priv_c6link_frame_seal(uint8_t *tx, uint8_t if_type, uint8_t if_num, uint16_t len)
Wrap an already-staged payload in a payload header.
void priv_c6link_frame_filler(uint8_t *tx)
Stamp the transmit transaction as the host's idle filler.
ra8_c6link_frame_class_t priv_c6link_frame_classify(uint8_t *rx, ra8_c6link_rx_view_t *view)
Decide what a received transaction is, and where its payload lies.
Cross-translation-unit contract inside libs/ra8_c6link.
ra8_c6link_frame_class_t
What one received transaction turned out to be.
@ k_ra8_c6link_frame_malformed
The offset was not the header size, or the length did not fit.
@ k_ra8_c6link_frame_data
A well-formed frame whose checksum verified; the payload is real.
@ k_ra8_c6link_frame_idle
The co-processor's filler frame: zero length, and legitimately offset = 0, which is not a defect.
@ k_ra8_c6link_frame_bad_checksum
The recomputed checksum disagreed with the transmitted one.
struct ra8_c6link_rx_view ra8_c6link_rx_view_t
ra8_err_t priv_c6link_pump(ra8_c6link_t *link, uint16_t max_transactions, ra8_c6link_stats_t *stats)
Clock transactions until the budget or the wait says stop.
static bool internal_c6link_pump_handshake(ra8_c6link_t *link)
Wait, bounded, for the co-processor to arm HANDSHAKE.
static bool internal_c6link_pump_receive(ra8_c6link_t *link, ra8_c6link_stats_t *stats)
Account for one classified frame and route the real ones.
@ k_ra8_err_spi_error
SPI transfer failed (bus fault, mode fault, overrun, ...).
@ k_ra8_err_hw_timeout
Hardware timed out waiting for a flag or handshake.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
uint16_t transfers
Full-duplex transactions clocked.
uint16_t malformed
Frames whose offset or length was not credible.
uint16_t idle
Filler frames the co-processor returned.
uint16_t hs_timeouts
Transactions abandoned waiting for HANDSHAKE.
uint16_t data
Well-formed frames carrying a payload.
uint16_t bad_checksum
Frames whose recomputed checksum disagreed.
bool(* handshake_active)(void *ctx)
Report whether the co-processor is armed for a transaction.
void(* delay_ms)(void *ctx, uint16_t ms)
Yield for approximately ms milliseconds.
void * ctx
Opaque backend context, handed back to every row above.
ra8_err_t(* transfer)(void *ctx, const uint8_t *tx, uint8_t *rx, uint16_t len)
Clock one full-duplex transaction of exactly len bytes.
uint8_t tx_if
Interface the staged payload uses.
uint8_t rx[k_ra8_c6link_frame_bytes]
Receive transaction.
ra8_c6link_stats_t * stats
Counters for the running pump.
uint16_t tx_len
Staged payload length, or zero.
uint8_t tx[k_ra8_c6link_frame_bytes]
Transmit transaction.
ra8_c6link_transport_t transport
Bound hardware seam.