rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
sense_win_link.h
Go to the documentation of this file.
1
25
26#pragma once
27
28#include <stdbool.h>
29#include <stdint.h>
30
31#include "bench_state.h"
32#include "link_pages.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
43#define SENSE_WIN_LINK_READ_MS 40u
44
45#define SENSE_WIN_LINK_ACK 0
46#define SENSE_WIN_LINK_NO_ANSWER (-1)
47
49typedef struct {
50 uint8_t page;
51 uint8_t n;
53
57typedef struct {
58 bool up;
59 bool page;
60 uint8_t want;
61 uint8_t pending;
62 uint32_t read_ms[2];
63 bool asked[2];
64 bool have[2];
65 bool have_prev[2];
66 uint16_t regs[2][LINK_SX_COUNT];
67 uint16_t prev[2][LINK_SX_COUNT];
69
76
83
91void sense_win_link_came_up(sense_win_link_t *s, uint16_t minor);
92
102void sense_win_link_want(sense_win_link_t *s, uint8_t parts);
103
115bool sense_win_link_next(sense_win_link_t *s, uint32_t now_ms,
117
130void sense_win_link_done(sense_win_link_t *s, int result,
131 const uint16_t *regs);
132
145bool sense_win_link_window(const sense_win_link_t *s, uint16_t window,
146 bench_chw_t *out);
147
161void sense_win_link_ring(bench_chw_t *out, unsigned fast,
162 const bench_state_t *b);
163
164#ifdef __cplusplus
165}
166#endif
The bench readings, in the units a person reads: V, A, W, rpm (revolutions per minute),...
#define s
Short name for esc_stick_s inside the five stick-class files.
Definition esc_stick_panel_int.h:295
One 50ms window of every INA3221 channel, from SENSE_WIN_A and SENSE_WIN_B (protocol 4....
Definition bench_state.h:40
The bench readings in the units a person reads: V, A, W and rpm, with their peaks.
Definition bench_state.h:54