ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_c6link Struct Reference

Caller-allocated link handle. More...

#include <ra8_c6link.h>

Collaboration diagram for ra8_c6link:

Data Fields

ra8_c6link_transport_t transport
 Bound hardware seam.
ra8_c6link_event_cb_t event_cb
 Announcement sink, or null.
ra8_c6link_rx_cb_t rx_cb
 802.3 receive sink, or null.
void * cb_ctx
 Context for both callbacks.
uint8_t * arena
 Protobuf decode arena.
uint32_t arena_bytes
 Bytes available at arena.
uint32_t arena_used
 Bump offset into arena.
uint32_t arena_last
 Newest live block's offset plus one, or zero when there is none.
uint32_t next_uid
 UID for the next request issued.
ra8_c6link_wait_t wait
 The outstanding request, if any.
ra8_c6link_fault_t fault
 The last failing request.
ra8_c6link_stats_tstats
 Counters for the running pump.
uint8_t tx [k_ra8_c6link_frame_bytes]
 Transmit transaction.
uint8_t rx [k_ra8_c6link_frame_bytes]
 Receive transaction.
uint8_t mdl_request [k_ra8_mdl_request_bytes_max]
 Packed inner media request awaiting transmission.
uint16_t tx_len
 Staged payload length, or zero.
uint8_t tx_if
 Interface the staged payload uses.
bool open
 The handle is initialised.
bool boot_seen
 An Event_ESPInit has arrived.

Detailed Description

Caller-allocated link handle.

Treat every field as private.

Zero-initialise (= {}) and pass to ra8_c6link_open. The two frame buffers dominate its size (3.2 KB together) and are aligned for the transport's DMA; everything else is bookkeeping. Declare one at file scope rather than on a stack.

Invariant
open is true exactly between a successful ra8_c6link_open and the matching ra8_c6link_close.
tx_len is non-zero only while a payload is staged and not yet clocked out.
Example:
static ra8_c6link_t s_link
Definition c6_cam_app.c:44
See also
ra8_c6link_open
Since
0.1.0

Definition at line 518 of file ra8_c6link.h.

Field Documentation

◆ arena

uint8_t* ra8_c6link::arena

Protobuf decode arena.

Definition at line 523 of file ra8_c6link.h.

Referenced by priv_c6link_arena_alloc(), priv_c6link_arena_free(), ra8_c6link_close(), and ra8_c6link_open().

◆ arena_bytes

uint32_t ra8_c6link::arena_bytes

Bytes available at arena.

Definition at line 524 of file ra8_c6link.h.

Referenced by priv_c6link_arena_alloc(), and ra8_c6link_open().

◆ arena_last

uint32_t ra8_c6link::arena_last

Newest live block's offset plus one, or zero when there is none.

Definition at line 526 of file ra8_c6link.h.

Referenced by priv_c6link_arena_alloc(), priv_c6link_arena_free(), priv_c6link_arena_reset(), and ra8_c6link_open().

◆ arena_used

uint32_t ra8_c6link::arena_used

Bump offset into arena.

Definition at line 525 of file ra8_c6link.h.

Referenced by priv_c6link_arena_alloc(), priv_c6link_arena_free(), priv_c6link_arena_reset(), and ra8_c6link_open().

◆ boot_seen

bool ra8_c6link::boot_seen

An Event_ESPInit has arrived.

Definition at line 556 of file ra8_c6link.h.

Referenced by priv_c6link_emit(), and ra8_c6link_open().

◆ cb_ctx

void* ra8_c6link::cb_ctx

Context for both callbacks.

Definition at line 522 of file ra8_c6link.h.

Referenced by priv_c6link_dispatch(), priv_c6link_emit(), ra8_c6link_close(), and ra8_c6link_open().

◆ event_cb

ra8_c6link_event_cb_t ra8_c6link::event_cb

Announcement sink, or null.

Definition at line 520 of file ra8_c6link.h.

Referenced by priv_c6link_emit(), ra8_c6link_close(), and ra8_c6link_open().

◆ fault

ra8_c6link_fault_t ra8_c6link::fault

The last failing request.

Definition at line 530 of file ra8_c6link.h.

Referenced by priv_c6link_resp(), priv_c6link_rpc_call(), ra8_c6link_last_fault(), and ra8_c6link_open().

◆ mdl_request

uint8_t ra8_c6link::mdl_request[k_ra8_mdl_request_bytes_max]

Packed inner media request awaiting transmission.

Owned by the link rather than by the media RPC that packs it: as an automatic object it put ra8_c6link_mdl_start_request over the 2048-byte first-party frame budget on the Cortex-M85 (-fstack-usage). One outstanding request per link is already the rule – ra8_c6link_mdl_start_request, ra8_c6link_mdl_next and ra8_c6link_mdl_cancel each pack, transmit and finish before the next may begin, and a second concurrent request is refused with k_ra8_err_busy – so sharing one buffer between them is the same exclusivity tx already assumes.

Definition at line 543 of file ra8_c6link.h.

Referenced by ra8_c6link_mdl_cancel(), ra8_c6link_mdl_next(), and ra8_c6link_mdl_start_request().

◆ next_uid

uint32_t ra8_c6link::next_uid

UID for the next request issued.

Definition at line 528 of file ra8_c6link.h.

Referenced by priv_c6link_rpc_call(), and ra8_c6link_open().

◆ open

◆ rx

uint8_t ra8_c6link::rx[k_ra8_c6link_frame_bytes]

Receive transaction.

Definition at line 541 of file ra8_c6link.h.

Referenced by internal_c6link_pump_receive(), priv_c6link_dispatch(), and priv_c6link_pump().

◆ rx_cb

ra8_c6link_rx_cb_t ra8_c6link::rx_cb

802.3 receive sink, or null.

Definition at line 521 of file ra8_c6link.h.

Referenced by priv_c6link_dispatch(), ra8_c6link_close(), and ra8_c6link_open().

◆ stats

ra8_c6link_stats_t* ra8_c6link::stats

Counters for the running pump.

Definition at line 531 of file ra8_c6link.h.

Referenced by priv_c6link_dispatch(), priv_c6link_emit(), priv_c6link_pump(), priv_c6link_rpc_consume(), ra8_c6link_close(), and ra8_c6link_open().

◆ transport

ra8_c6link_transport_t ra8_c6link::transport

Bound hardware seam.

Definition at line 519 of file ra8_c6link.h.

Referenced by internal_c6link_pump_handshake(), priv_c6link_pump(), ra8_c6link_close(), and ra8_c6link_open().

◆ tx

uint8_t ra8_c6link::tx[k_ra8_c6link_frame_bytes]

◆ tx_if

uint8_t ra8_c6link::tx_if

Interface the staged payload uses.

Definition at line 554 of file ra8_c6link.h.

Referenced by internal_c6link_rpc_stage(), priv_c6link_pump(), ra8_c6link_await_ready(), ra8_c6link_eth_send(), and ra8_c6link_open().

◆ tx_len

uint16_t ra8_c6link::tx_len

◆ wait

ra8_c6link_wait_t ra8_c6link::wait

The outstanding request, if any.

Definition at line 529 of file ra8_c6link.h.

Referenced by internal_c6link_rpc_answer(), priv_c6link_rpc_call(), ra8_c6link_close(), and ra8_c6link_open().


The documentation for this struct was generated from the following file: