rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
sense_limit_link.h
Go to the documentation of this file.
1
45
46#pragma once
47
48#include <stdbool.h>
49#include <stdint.h>
50
51#include "link_pages.h"
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
58#define SENSE_LIMIT_LINK_SETTLE_MS 500u
60#define SENSE_LIMIT_LINK_READ_MS 200u
62#define SENSE_LIMIT_LINK_GAP_MS 5000u
65#define SENSE_LIMIT_LINK_REPEAT_MS 30000u
66
69#define SENSE_LIMIT_LINK_ACK 0
71#define SENSE_LIMIT_LINK_NO_ANSWER (-1)
72
80
82typedef struct {
84 bool write;
85 uint8_t off;
86 uint8_t n;
87 const uint16_t *regs;
89
97
107
109typedef struct {
110 bool up;
111 bool page;
112 bool known;
113
114 bool want_set;
115 uint16_t want[LINK_SL_KEPT];
116 uint32_t want_ms;
117 uint16_t held[LINK_SL_KEPT];
118 bool refused;
119
121 bool asked;
122 uint32_t asked_ms;
123 bool pre_read;
125 bool flushed;
126 bool bad_page;
128 uint16_t count;
129
130 uint16_t over;
132 bool lost;
134 bool told;
135 uint32_t told_ms;
136 uint16_t told_ch;
137 uint32_t ch_ms[LINK_SL_KEPT];
138 uint8_t turn;
140
146
155
163void sense_limit_link_came_up(sense_limit_link_t *s, uint16_t minor,
164 uint32_t now_ms);
165
174void sense_limit_link_want(sense_limit_link_t *s, const uint16_t *ma,
175 uint32_t now_ms);
176
186bool sense_limit_link_next(sense_limit_link_t *s, uint32_t now_ms,
188
199 const uint16_t *regs, uint32_t now_ms);
200
212 uint32_t now_ms, unsigned *ch,
213 uint16_t *ma);
214
221uint16_t sense_limit_link_held_ma(const sense_limit_link_t *s, unsigned ch);
222
229
239
240#ifdef __cplusplus
241}
242#endif
#define s
Short name for esc_stick_s inside the five stick-class files.
Definition esc_stick_panel_int.h:295