rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
link_bringup.h
Go to the documentation of this file.
1
16
17#ifndef RCBENCH_LINK_BRINGUP_H
18#define RCBENCH_LINK_BRINGUP_H
19
20#include <stdbool.h>
21#include <stdint.h>
22
23#include "link_msg.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
32typedef struct {
33 /* The panel's view: what it asked, and what came back. */
34 uint32_t polls;
35 uint32_t replies;
36 uint32_t timeouts;
37 uint32_t mismatches;
38 uint32_t nacks;
39 uint32_t rx_crc_errors;
40 uint32_t rx_resyncs;
41
42 /* The IOmcu's view of itself, read from the STATUS page. Absent
43 * until a status read succeeds, which is itself informative. */
44 bool have_status;
45 uint32_t dev_frames;
52 uint32_t dev_resyncs;
62 uint32_t dev_refused;
63
64 /* Identity, read once at link-up. */
65 bool have_identity;
66 uint16_t proto_major;
67 uint16_t proto_minor;
68
69 /* Round trip: request sent to reply accepted. */
70 uint32_t rt_samples;
71 uint32_t rt_min_us;
72 uint32_t rt_max_us;
73 uint32_t rt_mean_us;
75
104
117
143void link_bringup_window(const link_bringup_t *now,
144 const link_bringup_t *prev, link_bringup_t *out);
145
152const char *link_diag_text(link_diag_t d);
153
160const char *link_diag_hint(link_diag_t d);
161
162/* ------------------------------------------------------------ status page */
163
174uint8_t link_bringup_status_count(uint16_t minor);
175
192 uint16_t *faults);
193
194/* ------------------------------------------------------- round-trip stats */
195
202void link_bringup_add_rtt(link_bringup_t *b, uint32_t us);
203
204#ifdef __cplusplus
205}
206#endif
207
208#endif /* RCBENCH_LINK_BRINGUP_H */