ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_c6link_internal.h
Go to the documentation of this file.
1
23
24#pragma once
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include <stddef.h>
31#include <stdint.h>
32
33#include "ra8_attributes.h"
34#include "ra8_c6link.h"
35#include "ra8_err.h"
36
37/* Vendored esp-hosted: the packed payload header, the interface enumeration,
38 the transport constants and the generated protobuf codec. Nothing else from
39 the vendor tree is reachable from this library. */
40#include "esp_hosted_header.h"
41#include "esp_hosted_interface.h"
42#include "esp_hosted_rpc.pb-c.h"
43#include "esp_hosted_transport.h"
44#include "protobuf-c/protobuf-c.h"
45
79
99typedef struct ra8_c6link_rx_view {
100 uint16_t offset;
101 uint16_t len;
102 uint8_t if_type;
103 uint8_t if_num;
105
106/* ==========================================================================
107 * ra8_c6link_arena.c -- the fixed decode arena behind the protobuf codec
108 * ==========================================================================
109 */
110
142RA8_PRIV void* priv_c6link_arena_alloc(void* ctx, size_t size);
143
176RA8_PRIV void priv_c6link_arena_free(void* ctx, void* pointer);
177
206
237RA8_PRIV void priv_c6link_arena_bind(ProtobufCAllocator* out, ra8_c6link_t* link);
238
239/* ==========================================================================
240 * ra8_c6link_frame.c -- the twelve-byte payload header
241 * ==========================================================================
242 */
243
273RA8_PRIV void priv_c6link_frame_filler(uint8_t* tx);
274
308RA8_PRIV void priv_c6link_frame_seal(uint8_t* tx, uint8_t if_type, uint8_t if_num, uint16_t len);
309
351
403
434[[nodiscard]] RA8_PRIV uint8_t priv_c6link_caps(uint8_t* out, uint8_t cap);
435
436/* ==========================================================================
437 * ra8_c6link_tlv.c -- the serial endpoint's two-tag envelope
438 * ==========================================================================
439 */
440
464typedef enum : uint16_t {
471 k_ra8_c6link_tlv_ep_len = (uint16_t)(sizeof(RPC_EP_NAME_RSP) - 1U),
474 (uint16_t)((uint16_t)k_ra8_c6link_tlv_value + (uint16_t)(sizeof(RPC_EP_NAME_RSP) - 1U) +
475 (uint16_t)k_ra8_c6link_tlv_value),
480
510[[nodiscard]] RA8_PRIV ra8_err_t priv_c6link_tlv_open(uint8_t* out,
511 uint16_t cap,
512 uint16_t proto_len,
513 uint16_t* body_at);
514
551[[nodiscard]] RA8_PRIV const uint8_t*
552priv_c6link_tlv_body(const uint8_t* payload, uint16_t len, uint16_t* proto_len);
553
554/* ==========================================================================
555 * ra8_c6link_rpc.c -- request, response, correlation
556 * ==========================================================================
557 */
558
586
618[[nodiscard]] RA8_PRIV ra8_err_t priv_c6link_take_resp(void* ctx, const void* msg_v);
619
657[[nodiscard]] RA8_PRIV ra8_err_t priv_c6link_bare_req(ra8_c6link_t* link, uint32_t req_id);
658
705 Rpc* req,
706 uint32_t resp_id,
708 void* take_ctx);
709
741[[nodiscard]] RA8_PRIV bool
742priv_c6link_rpc_consume(ra8_c6link_t* link, const uint8_t* payload, uint16_t len);
743
779 uint32_t rpc_id,
780 int32_t resp);
781
782/* ==========================================================================
783 * ra8_c6link_pump.c -- the transaction loop
784 * ==========================================================================
785 */
786
820 uint16_t max_transactions,
821 ra8_c6link_stats_t* stats);
822
855[[nodiscard]] RA8_PRIV bool priv_c6link_dispatch(ra8_c6link_t* link,
856 const ra8_c6link_rx_view_t* view);
857
887
917RA8_PRIV uint8_t priv_c6link_copy_str(char* dst, uint8_t cap, const ProtobufCBinaryData* src);
918
943[[nodiscard]] RA8_PRIV bool priv_c6link_copy_mac(ra8_c6link_mac_t* dst,
944 const ProtobufCBinaryData* src);
945
946#ifdef __cplusplus
947}
948#endif
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546