43#define SENSE_WIN_LINK_READ_MS 40u
45#define SENSE_WIN_LINK_ACK 0
46#define SENSE_WIN_LINK_NO_ANSWER (-1)
66 uint16_t
regs[2][LINK_SX_COUNT];
67 uint16_t
prev[2][LINK_SX_COUNT];
131 const uint16_t *regs);
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
The page map: what the panel can ask the IOmcu for, and set.
void sense_win_link_done(sense_win_link_t *s, int result, const uint16_t *regs)
How it went: SENSE_WIN_LINK_ACK with the registers read, a NACK's reason, or SENSE_WIN_LINK_NO_ANSWER...
Definition sense_win_link.c:98
void sense_win_link_want(sense_win_link_t *s, uint8_t parts)
The parts enabled in the map the IOmcu holds, bit a for 0x40 + a: the pages to read.
Definition sense_win_link.c:47
void sense_win_link_came_up(sense_win_link_t *s, uint16_t minor)
An IOmcu answered with protocol minor minor; below LINK_MINOR_SENSE_MAP nothing is sent to it.
Definition sense_win_link.c:37
bool sense_win_link_next(sense_win_link_t *s, uint32_t now_ms, sense_win_link_op_t *op)
The next read owed at now_ms into op; false for none.
Definition sense_win_link.c:63
void sense_win_link_init(sense_win_link_t *s)
Sets up the SENSE_WIN link state.
Definition sense_win_link.c:19
bool sense_win_link_window(const sense_win_link_t *s, uint16_t window, bench_chw_t *out)
The channels whose last or previous read holds window number window into out: out->ok bit c for chann...
Definition sense_win_link.c:137
void sense_win_link_ring(bench_chw_t *out, unsigned fast, const bench_state_t *b)
FAST's channel fast (0 to 11) of out from the window ring's window that b carries in its first channe...
Definition sense_win_link.c:181
void sense_win_link_lost(sense_win_link_t *s)
The link went: nothing read is the IOmcu's now.
Definition sense_win_link.c:27
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
One read the caller makes: registers 0 to n - 1 of page.
Definition sense_win_link.h:49
The panel's state of the SENSE_WIN link pages.
Definition sense_win_link.h:57
uint16_t prev[2][LINK_SX_COUNT]
Definition sense_win_link.h:67
bool have[2]
Definition sense_win_link.h:64
uint8_t pending
Definition sense_win_link.h:61
uint32_t read_ms[2]
Definition sense_win_link.h:62
bool asked[2]
Definition sense_win_link.h:63
uint16_t regs[2][LINK_SX_COUNT]
Definition sense_win_link.h:66
bool have_prev[2]
Definition sense_win_link.h:65
bool page
Definition sense_win_link.h:59
uint8_t want
Definition sense_win_link.h:60
bool up
Definition sense_win_link.h:58