|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Function-pointer seam a backend fills so the facade can reach the C6. More...
#include <ra8_c6link_transport.h>
Data Fields | |
| ra8_err_t(* | transfer )(void *ctx, const uint8_t *tx, uint8_t *rx, uint16_t len) |
Clock one full-duplex transaction of exactly len bytes. | |
| bool(* | handshake_active )(void *ctx) |
| Report whether the co-processor is armed for a transaction. | |
| void(* | delay_ms )(void *ctx, uint16_t ms) |
Yield for approximately ms milliseconds. | |
| void * | ctx |
| Opaque backend context, handed back to every row above. | |
Function-pointer seam a backend fills so the facade can reach the C6.
Caller-allocated and copied into the link handle by ra8_c6link_open, so the structure itself need not outlive the open call – but everything it points at must outlive the link. Every row is mandatory: a partially-filled seam is rejected at open rather than discovered as a null call at the first transaction.
NASA Power of 10 Rule 9 permits function pointers precisely for this: Dependency Inversion, so the protocol layers are host-testable.
Definition at line 84 of file ra8_c6link_transport.h.
| void* ra8_c6link_transport::ctx |
Opaque backend context, handed back to every row above.
Definition at line 112 of file ra8_c6link_transport.h.
Referenced by internal_c6link_op_idle(), internal_c6link_pump_handshake(), priv_c6link_pump(), and ra8_esp_hosted_c6link_bind().
| void(* ra8_c6link_transport::delay_ms) (void *ctx, uint16_t ms) |
Yield for approximately ms milliseconds.
Called between handshake samples and between transactions. May block; on the target it is the RTOS sleep, in host tests it advances the model's clock and returns immediately.
Definition at line 109 of file ra8_c6link_transport.h.
Referenced by internal_c6link_check_cfg(), internal_c6link_op_idle(), internal_c6link_pump_handshake(), priv_c6link_pump(), and ra8_esp_hosted_c6link_bind().
| bool(* ra8_c6link_transport::handshake_active) (void *ctx) |
Report whether the co-processor is armed for a transaction.
The HANDSHAKE line, sampled at its active level. The facade polls this and never starts a transaction while it reads false, because the co-processor only latches its transmit buffer once it has raised the line.
Definition at line 101 of file ra8_c6link_transport.h.
Referenced by internal_c6link_check_cfg(), internal_c6link_pump_handshake(), and ra8_esp_hosted_c6link_bind().
| ra8_err_t(* ra8_c6link_transport::transfer) (void *ctx, const uint8_t *tx, uint8_t *rx, uint16_t len) |
Clock one full-duplex transaction of exactly len bytes.
Must transmit every byte of tx and store every received byte in rx; both buffers are k_ra8_c6link_frame_bytes long and neither is ever null. Returning anything but k_ra8_ok aborts the pump and is reported to the caller as a bus fault.
Definition at line 92 of file ra8_c6link_transport.h.
Referenced by internal_c6link_check_cfg(), priv_c6link_pump(), and ra8_esp_hosted_c6link_bind().