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

One esp-hosted transaction buffer, addressable either way. More...

#include <c6_hosted.h>

Data Fields

uint8_t bytes [k_c6_hosted_frame_bytes]
 The transaction as the transport sees it: flat bytes.
struct esp_payload_header header
 The same storage as the protocol sees it: a payload header.

Detailed Description

One esp-hosted transaction buffer, addressable either way.

The transport clocks a flat byte array; the protocol reads a twelve-byte payload header off the front of it. Declaring both as members of one union makes that overlay legal by construction – union member access is defined in C, whereas casting the byte array to a header pointer is not, and clang-tidy's bugprone-casting-through-void says so.

Invariant
bytes and header name the same storage, so a write through either is visible through the other.
The union is exactly k_c6_hosted_frame_bytes long, because the header member is smaller than the byte member.
Example:
static c6_hosted_frame_t frame;
frame.header.len = 0U;
const uint16_t csum = compute_checksum(frame.bytes, 12U);
union c6_hosted_frame c6_hosted_frame_t
uint8_t bytes[k_c6_hosted_frame_bytes]
The transaction as the transport sees it: flat bytes.
Definition c6_hosted.h:145
struct esp_payload_header header
The same storage as the protocol sees it: a payload header.
Definition c6_hosted.h:147
See also
c6_hosted_link_t
Since
0.1.0

Definition at line 144 of file c6_hosted.h.

Field Documentation

◆ bytes

uint8_t c6_hosted_frame::bytes[k_c6_hosted_frame_bytes]

The transaction as the transport sees it: flat bytes.

Definition at line 145 of file c6_hosted.h.

◆ header

struct esp_payload_header c6_hosted_frame::header

The same storage as the protocol sees it: a payload header.

Definition at line 147 of file c6_hosted.h.


The documentation for this union was generated from the following file:
  • examples/ek_ra8d2/hw_validated/c6/c6_hosted_init/inc/c6_hosted.h