51 return (uint16_t)((uint16_t)buf[off_lo] |
60 const uint16_t capped =
63 for (uint16_t i = 0U; i < capped; i++) {
67 sum = (uint16_t)(sum + (uint16_t)buf[i]);
74 if (buf ==
nullptr || out ==
nullptr) {
144 if (buf ==
nullptr || len == 0U) {
147 const uint16_t shown =
150 for (uint16_t i = 0U; i < shown; i++) {
void c6_probe_decode_header(const uint8_t *buf, c6_hdr_t *out)
Unpack the twelve-byte esp-hosted payload header.
void c6_probe_print_header(const c6_hdr_t *h)
Print the decoded header fields on one console line.
void c6_probe_dump_payload(const uint8_t *buf, uint16_t len)
Hex-dump the leading payload bytes of a received frame.
static uint16_t internal_le16(const uint8_t *buf, uint8_t off_lo)
Read a little-endian 16-bit field out of a byte buffer.
uint16_t c6_probe_checksum(const uint8_t *buf, uint16_t count)
Recompute the esp-hosted checksum over a received frame.
c6_frame_kind_t c6_probe_classify(const c6_hdr_t *h)
Implementation of c6_probe_classify() – filler check first.
Shared contract for the EK-RA8D2 <-> ESP32-C6 esp-hosted SPI probe.
@ k_c6_fmt_hex_byte
Nibbles printed for one byte.
@ k_c6_fmt_hex_word
Nibbles printed for a 16-bit word.
void c6_probe_puts(const char *text)
Emit a bounded, NUL-terminated ASCII literal on the console.
void c6_probe_put_u32(uint32_t value)
Emit an unsigned integer in decimal.
@ k_c6_probe_dump_bytes
Payload bytes hex-dumped per frame.
void c6_probe_put_hex(uint32_t value, uint8_t digits)
Emit a value as fixed-width lowercase hexadecimal.
The esp-hosted SPI full-duplex wire format, hand-decoded.
@ k_c6_shift_nibble
if_num sits in the upper nibble.
@ k_c6_mask_throttle
throttle_cmd occupies bits 1:0.
@ k_c6_mask_nibble
Four-bit field mask.
@ k_c6_shift_byte
Little-endian high-byte shift.
@ k_c6_hdr_off_off_lo
Payload offset, low byte.
@ k_c6_hdr_off_pkttype
reserved3 / hci_ or priv_pkt_type.
@ k_c6_hdr_off_throttle
throttle_cmd[1:0] | reserved[7:2].
@ k_c6_hdr_off_seq_lo
Sequence number, low byte.
@ k_c6_hdr_off_iface
if_type[3:0] | if_num[7:4].
@ k_c6_hdr_off_flags
Fragment / wake / power-save bits.
@ k_c6_hdr_off_csum_lo
Checksum, low byte.
@ k_c6_hdr_off_len_lo
Payload length, low byte.
@ k_c6_hdr_off_csum_hi
Checksum, high byte.
@ k_c6_dummy_if_num
if_num the C6 stamps into filler frames.
@ k_c6_proto_payload_max
Largest payload the header may claim.
@ k_c6_proto_buf_size
Bytes clocked per transaction.
@ k_c6_proto_hdr_size
sizeof(struct esp_payload_header).
c6_frame_kind_t
Classification of one received 1600-byte transaction.
@ k_c6_frame_data
Real frame, checksum verified.
@ k_c6_frame_bad_csum
Header shape sane, checksum mismatched.
@ k_c6_frame_garbage
No recognisable esp-hosted structure.
@ k_c6_frame_idle
The C6's idle filler frame.
@ k_c6_if_max
Idle filler marker.
Decoded esp-hosted payload header plus the locally recomputed sum.
uint16_t computed
Checksum recomputed over the receive buffer.
uint16_t seq_num
Sender sequence number.
uint16_t checksum
Checksum carried on the wire.
uint16_t offset
Payload offset; always the header size.
uint16_t len
Payload length claimed by the sender.
uint8_t pkt_type
HCI / private packet sub-type.
uint8_t if_num
Interface instance number.
uint8_t flags
Fragment / wake / power-save bits.
uint8_t throttle
Wi-Fi transmit throttle command.
uint8_t if_type
Interface identifier (c6_if_type_t).