rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
servo_screen.h
Go to the documentation of this file.
1
15
16#pragma once
17
18#include <stddef.h>
19#include <stdint.h>
20
21#include "sense_link.h"
22#include "servo_cmd.h"
23#include "servo_source.h"
24#include "servo_test_io.h"
25#include "supply.h"
26#include "ui_keypad.h"
27#include "ui_screen.h"
28
30void servo_invalidate(void);
31
32const ui_screen_t *servo_screen(void);
33
50void servo_screen_knob(float span_fraction);
51
62
74
77
87
91void servo_screen_feedback(uint16_t position_us, float current_a, bool valid);
92
124void servo_screen_set_armed(bool armed);
125
132void servo_screen_set_bench_armed(bool armed);
133
142void servo_screen_cancel_arm(void);
143
145uint16_t servo_screen_commanded(void);
146
154bool servo_screen_log_pulse(uint16_t *us);
155
163bool servo_screen_log_angle(float *deg);
164
173const char *servo_screen_commanded_text(void);
174
177uint16_t servo_screen_drawn(void);
178
180uint16_t servo_screen_frame_hz(void);
181const char *servo_screen_type_name(void);
182
192
203 uint32_t changes);
204
238void servo_screen_source(servo_source_id_t id, uint32_t changes);
239
249void servo_screen_on_testing(void (*told)(bool running));
250
257
274
299 uint32_t changes);
300
305float servo_screen_power_sample(int series, int back);
306
336bool servo_in_force_note(char *l1, char *l2, size_t size, uint16_t hz,
337 uint8_t target, uint8_t gpio, bool pwm, int setting);
338
344void servo_screen_rate(servo_rate_state_t st, uint16_t hz);
345
348void servo_screen_set_sweep(bool able);
349
352void servo_screen_set_surfaces(bool any);
353
358void servo_screen_set_enc_held(bool held);
359
361#define SERVO_SCREEN_NO_PIN 0xFFu
364#define SERVO_SCREEN_TARGET_UNKNOWN 0xFEu
367#define SERVO_SCREEN_TARGET_NO_LINK 0xFFu
368
375void servo_screen_set_drive(uint8_t target, uint8_t gpio, bool pwm);
376
381void servo_screen_set_pins(uint64_t gpio_mask, bool known);
382
412bool servo_target_line(char *out, size_t size, uint8_t target, uint8_t gpio,
413 bool pwm, uint64_t pins, bool known);
414
416int servo_screen_task(void);
417
420
424
431
437
444
448
450bool servo_screen_sweeping(void);
451
454bool servo_screen_paused(void);
455
463void servo_screen_released(uint16_t pause_seq);
464
478void servo_screen_sweep_started(uint16_t start_seq, uint32_t age_ms,
479 servo_sweep_from_t from, uint32_t since_ms);
480
489void servo_screen_sweep_held(uint16_t pause_seq, uint32_t kept_ms);
490
493uint32_t servo_screen_curve_ms(void);
494
500void servo_screen_set_commanded(float deg);
501
502/* ------------------------------------------------- the automatic test */
503
504/*
505 * START TEST on TEST's AUTOMATIC TEST card runs servo_test.h's automatic
506 * test from this screen: a two-second hold, or HV SERVOS ONLY held for two
507 * seconds when a step is above 6.0V. It needs an armed bench and a supply that answers,
508 * and it commands the servo and SUPPLY's set points and output itself.
509 * Progress and the result are shown on its card and in LIVE's box.
510 */
511
517void servo_screen_clock(uint32_t now_ms);
518
520void servo_screen_set_link(bool up);
521
523bool servo_screen_testing(void);
524
529
537void servo_screen_test_pop(void);
538
545void servo_screen_test_files(int number, bool report);
551void servo_screen_test_logger_busy(bool busy);
552
560void servo_screen_service(void);
#define s
Short name for esc_stick_s inside the five stick-class files.
Definition esc_stick_panel_int.h:295
A command of the SERVO screen as the panel's servo link takes it (servo_link.h), and what the link re...
servo_rate_state_t
What became of a frame rate the panel wrote to the SERVO page.
Definition servo_cmd.h:134
servo_sweep_from_t
Where the IOmcu's output was when it started a sweep.
Definition servo_cmd.h:214
bool servo_screen_sweeping(void)
Definition servo_screen_sweep.c:333
bool servo_screen_log_angle(float *deg)
The encoder's angle for a SERVO run's log row, as MEASURED shows it: AS5600 on in SETUP,...
Definition servo_screen_link.c:618
bool servo_screen_tester_target_locked(void)
Definition servo_workbench.c:673
void servo_screen_source(servo_source_id_t id, uint32_t changes)
The servo rail's meter, as servo_source.h decides it, every frame before that frame's windows and sup...
Definition servo_screen_link.c:514
void servo_screen_feedback(uint16_t position_us, float current_a, bool valid)
Definition servo_screen_link.c:241
void servo_screen_encoder(const servo_test_enc_t *e)
Definition servo_screen_link.c:287
bool servo_screen_limit_running(void)
Definition servo_limit_panel.c:42
void servo_screen_released(uint16_t pause_seq)
Definition servo_screen_sweep.c:339
void servo_screen_set_link(bool up)
Definition servo_screen_link.c:672
servo_test_out_t servo_screen_test_peek(const char **text)
Definition servo_test_panel.c:420
bool servo_screen_testing(void)
Definition servo_test_panel.c:411
void servo_screen_set_commanded(float deg)
Definition servo_screen_link.c:667
void servo_screen_source_why(servo_source_why_t why)
Definition servo_screen_link.c:519
void servo_screen_sweep_refused(void)
Definition servo_screen_link.c:762
void servo_screen_supply_at(const supply_state_t *s, servo_source_id_t id, uint32_t changes)
Definition servo_screen_link.c:543
uint16_t servo_screen_commanded(void)
Definition servo_screen_link.c:604
void servo_screen_set_drive(uint8_t target, uint8_t gpio, bool pwm)
Definition servo_screen_link.c:728
void servo_screen_knob_frame(void)
Definition servo_screen_touch.c:114
void servo_screen_set_bench_armed(bool armed)
Definition servo_screen_link.c:776
void servo_screen_knob(float span_fraction)
Definition servo_screen_touch.c:222
int servo_screen_limit_phase(void)
Definition servo_limit_panel.c:47
void servo_screen_set_armed(bool armed)
Whether the bench is armed for the surfaces, so the button can say it. An arm for the motor alone is ...
Definition servo_screen_link.c:79
int servo_screen_task(void)
Definition servo_workbench.c:659
float servo_screen_power_sample(int series, int back)
Returns a sample of the power plot.
Definition servo_screen_link.c:599
void servo_screen_sweep_started(uint16_t start_seq, uint32_t age_ms, servo_sweep_from_t from, uint32_t since_ms)
Definition servo_screen_sweep.c:413
void servo_screen_set_surfaces(bool any)
Definition servo_screen_link.c:753
const char * servo_screen_type_name(void)
Returns the name of the servo type in force.
Definition servo_screen_link.c:653
bool servo_in_force_note(char *l1, char *l2, size_t size, uint16_t hz, uint8_t target, uint8_t gpio, bool pwm, int setting)
The OUTPUT page's note while a rate is SERVO_RATE_IN_FORCE: two lines into l1 and l2 of size bytes ea...
Definition servo_settings_draw.c:149
bool servo_screen_port_pwm_locked(void)
Definition servo_workbench.c:678
void servo_screen_rate(servo_rate_state_t st, uint16_t hz)
Definition servo_screen_link.c:655
void servo_screen_on_testing(void(*told)(bool running))
Definition servo_screen.c:606
void servo_screen_test_files(int number, bool report)
Definition servo_test_panel.c:458
uint16_t servo_screen_drawn(void)
Definition servo_screen_link.c:645
bool servo_screen_log_pulse(uint16_t *us)
The commanded pulse for a SERVO run's log row, as COMMANDED shows it: none while a programming sessio...
Definition servo_screen_link.c:609
void servo_screen_supply(const supply_state_t *s)
Definition servo_screen_link.c:536
bool servo_screen_paused(void)
Definition servo_screen_sweep.c:335
bool servo_target_line(char *out, size_t size, uint8_t target, uint8_t gpio, bool pwm, uint64_t pins, bool known)
The TARGET row's value in the current language: protocol pins.
Definition servo_workbench.c:613
void servo_screen_sweep_held(uint16_t pause_seq, uint32_t kept_ms)
Definition servo_screen_sweep.c:509
int servo_screen_power_points(void)
Definition servo_screen_link.c:591
void servo_screen_knob_cancel(void)
Definition servo_screen_touch.c:217
void servo_screen_source_dropped(servo_source_why_t why, uint32_t at)
Definition servo_screen_link.c:524
uint32_t servo_screen_curve_ms(void)
Definition servo_screen_sweep.c:337
uint16_t servo_screen_frame_hz(void)
Definition servo_screen_link.c:647
const char * servo_screen_commanded_text(void)
Definition servo_screen_link.c:632
void servo_screen_cancel_arm(void)
Definition servo_screen_link.c:138
const ui_keypad_t * servo_screen_keypad(void)
The keypad over the left column: a set point's, a settings row's or TRIM's, which is signed; for test...
Definition servo_screen_link.c:627
void servo_invalidate(void)
Definition servo_screen.c:496
void servo_screen_set_enc_held(bool held)
Definition servo_screen_link.c:723
bool servo_screen_target_locked(void)
Definition servo_workbench.c:665
bool servo_screen_take(servo_cmd_t *out)
Definition servo_screen_link.c:230
void servo_screen_window(const sense_link_win_t *w, servo_source_id_t id, uint32_t changes)
One 50ms window of INA3221 CH1 (sense_link_take_win()), each one once, in the order they arrive,...
Definition servo_screen_link.c:551
int servo_screen_run_settings(void)
Definition servo_workbench.c:663
void servo_screen_service(void)
Definition servo_screen.c:622
int servo_screen_settings_page(void)
Definition servo_workbench.c:661
void servo_screen_set_pins(uint64_t gpio_mask, bool known)
Definition servo_screen_link.c:744
void servo_screen_clock(uint32_t now_ms)
Definition servo_screen.c:629
void servo_screen_set_sweep(bool able)
Definition servo_screen_sweep.c:580
void servo_screen_test_logger_busy(bool busy)
Definition servo_test_panel.c:474
Which meter measures the servo rail: the INA3221's CH1, the PD mini (the WeAct PD Power Mini supply) ...
servo_source_id_t
The servo rail's meter.
Definition servo_source.h:70
servo_source_why_t
Why the INA3221 is not the meter: the first condition that fails.
Definition servo_source.h:77
What the automatic servo test reads and what it hands out: the supply's readings, the INA3221's windo...
servo_test_out_t
Definition servo_test_io.h:136
A command of the SERVO screen, as the servo link takes it.
Definition servo_cmd.h:58
One reading of the output encoder, as the SENSE page has it.
Definition servo_test_io.h:75
A supply's readings, set points, mode and trip state.
Definition supply.h:69
A numeric keypad: what it was opened with, what is typed, and the press it holds.
Definition ui_keypad.h:61
Definition ui_screen.h:68
A programmable supply: what it can be set to, what it was set to, and what it delivers.
A numeric keypad over part of a screen, for a value a slider is too coarse to place.
Screen router.