70typedef enum : uint8_t {
81 "k_ra8_c6link_header_bytes must equal sizeof(struct esp_payload_header)");
83 "k_ra8_c6link_frame_bytes must equal ESP_TRANSPORT_SPI_MAX_BUF_SIZE");
86 "k_ra8_c6link_max_payload must be the frame size less the header");
129 uint16_t sum = compute_checksum(frame, span);
141 struct esp_payload_header hdr = {};
145 (void)
memcpy(tx, &hdr,
sizeof hdr);
155 struct esp_payload_header hdr = {};
163 (void)
memcpy(tx, &hdr,
sizeof hdr);
164 hdr.checksum = compute_checksum(tx, span);
165 (void)
memcpy(tx, &hdr,
sizeof hdr);
190 out[at + 2U] = value;
199 const uint8_t tlv_bytes =
210 (uint8_t)RCVD_ESP_FIRMWARE_CHIP_ID,
214 (uint8_t)SLV_CONFIG_TEST_RAW_TP,
218 (uint8_t)SLV_CONFIG_THROTTLE_HIGH_THRESHOLD,
222 (uint8_t)SLV_CONFIG_THROTTLE_LOW_THRESHOLD,
230 if ((rx ==
nullptr) || (view ==
nullptr)) {
233 struct esp_payload_header hdr = {};
234 (void)
memcpy(&hdr, rx,
sizeof hdr);
247 view->
offset = hdr.offset;
249 view->
if_type = (uint8_t)hdr.if_type;
250 view->
if_num = (uint8_t)hdr.if_num;
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).
The single integration boundary between this firmware and the ESP32-C6.
@ k_ra8_c6link_header_bytes
sizeof(struct esp_payload_header) on this ABI.
@ k_ra8_c6link_max_payload
Largest payload one frame can carry.
@ k_ra8_c6link_frame_bytes
Bytes in one transaction; ESP_TRANSPORT_SPI_MAX_BUF_SIZE upstream.
ra8_c6link_hdr_t
Field-level constants the header writer and reader need.
@ k_ra8_c6link_hdr_csum_sz
Octets the checksum field occupies.
@ k_ra8_c6link_hdr_seq
Sequence number transmitted; see above.
@ k_ra8_c6link_hdr_csum_at
Offset of the checksum's low octet.
@ k_ra8_c6link_hdr_nibble
Mask for a four-bit header field.
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.
static void internal_c6link_frame_clear(uint8_t *frame, uint16_t from)
Zero part of a transaction buffer.
uint8_t priv_c6link_caps(uint8_t *out, uint8_t cap)
Build the host-capabilities announcement.
void priv_c6link_frame_filler(uint8_t *tx)
Stamp the transmit transaction as the host's idle filler.
static uint16_t internal_c6link_frame_sum(uint8_t *frame, uint16_t span)
Recompute a frame's checksum as if its checksum field were zero.
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.
static uint8_t internal_c6link_caps_tlv(uint8_t *out, uint8_t at, uint8_t tag, uint8_t value)
Write one one-octet TLV of the capabilities frame at a cursor.
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
@ k_ra8_c6link_caps_stride
Octets one one-valued TLV occupies.
@ k_ra8_c6link_caps_throttle_high
Flow-control high-water mark, H_WIFI_TX_DATA_THROTTLE_HIGH_THRESHOLD.
@ k_ra8_c6link_caps_bytes
Whole frame: two header octets plus five three-octet TLVs.
@ k_ra8_c6link_caps_hdr
Octets before the first TLV.
@ k_ra8_c6link_caps_type
Offset of the event-type octet.
@ k_ra8_c6link_caps_throttle_low
Flow-control low-water mark, H_WIFI_TX_DATA_THROTTLE_LOW_THRESHOLD.
@ k_ra8_c6link_caps_chip
ESP_PRIV_FIRMWARE_CHIP_ESP32C6: the part this board carries.
@ k_ra8_c6link_caps_value_len
Value width of every tag emitted.
@ k_ra8_c6link_caps_raw_tp
Raw-throughput test direction; disabled, matching H_TEST_RAW_TP_DIR.
@ k_ra8_c6link_caps_tags
TLVs this host emits.
@ k_ra8_c6link_caps_host
Host capability word.
@ k_ra8_c6link_caps_len
Offset of the event-length octet.
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
uint16_t offset
Byte offset of the payload within the transaction.
uint8_t if_num
Interface number from the header.
uint16_t len
Payload length in bytes.
uint8_t if_type
Interface type from the header.