29#include "ui_value_gate.h"
39#define SUB_Y (UP_Y + TITLE_H + 6)
42#define LEG_Y (SUB_Y + SUB_H + 4)
44#define PLOT_X (LEFT_X + INNER)
45#define PLOT_W (LEFT_W - 2 * INNER)
46#define PLOT_Y (LEG_Y + LEG_H + 4)
47#define PLOT_H (UP_Y + UP_H - INNER - PLOT_Y)
49#define RATE_X (PLOT_X + SUB_W + 14)
56#define ROW_Y (LO_Y + 4)
59#define READOUT_X (LEFT_X + LEFT_W - INNER - READOUT_W)
62#define CTRL_Y (ROW_Y + READOUT_H + 4)
64#define TRACK_Y (CTRL_Y + (NUDGE_H - TRACK_H) / 2)
65#define TRACK_X (LEFT_X + INNER + NUDGE_W + 8)
71#define THR_R (RC_X - UI_TAP_MIN)
73#define TRACK_W (THR_R - NUDGE_W - 8 - TRACK_X)
74#define HINT_Y (CTRL_Y + NUDGE_H + 8)
77#define HINT_X (LEFT_X + INNER)
79 "+1 ends a finger's width left of DISARM");
81 "the throttle's hint ends above the alert band");
83 "the readout ends above the step keys");
97#define ARM_HOLD_S UI_HOLD_S
99enum { S_VOLT = 0, S_CURR, S_POWER, S_RPM, S_COUNT };
109#define SAMPLE_HZ 20.0f
234extern const uint16_t
mo_ok[S_COUNT];
#define RC_X
Definition balance_screen.c:57
#define ROW_Y
Definition battery_screen.c:72
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
void mo_render(gfx_canvas_t *c, int buffer_index)
Draws the screen into frame buffer buffer_index.
Definition motor_draw.c:601
void mo_event(const touch_event_t *evt)
Takes a touch event.
Definition motor_events.c:120
void mo_tick(float dt_s)
Advances the screen by one frame: the ARM hold and flash animations, the knob and the polled state.
Definition motor_events.c:292
bool mo_safe_at(int x, int y)
Returns whether a DOWN at (x, y) is on a control whose press stops what the bench drives: a session's...
Definition motor_events.c:111
#define TRACK_X
Definition motor_live_int.h:65
bool mo_endpoints_free(void)
Returns whether the Idle pulse and Full pulse may change: SAFE and ARM not held.
Definition motor_screen.c:437
bool mo_value_live(void)
Returns whether the throttle follows its controls: only in UI_VALUE_LIVE, not on a disarmed bench,...
Definition motor_screen.c:156
#define HINT_Y
Definition motor_live_int.h:74
bool mo_arm_locked(void)
Whether ARM takes no press: the servo programmer holds a port, or the binding names no motor pin....
Definition motor_screen.c:288
#define CTRL_Y
Definition motor_live_int.h:62
bool mo_bench_safe(void)
Returns whether the bench is SAFE as this screen sees it: disarmed, with no ARM or DISARM asked and u...
Definition motor_screen.c:426
mo_state_t mo_s
MOTOR & ESC's LIVE state, in motor_screen.c.
Definition motor_screen.c:68
void mo_bind_colours(void)
Sets the plot's and the slider's colours from the active theme.
Definition motor_screen.c:97
void mo_post(motor_cmd_kind_t kind, float value)
Posts a command in the one slot, coalescing: a new command overwrites the pending one,...
Definition motor_screen.c:211
#define READOUT_H
Definition motor_live_int.h:58
#define TRACK_W
The track's length: 422px, between the two step keys.
Definition motor_live_int.h:73
bool mo_no_motor_pin(void)
Whether the throttle's binding is read and names no motor pin: no GPIO (general-purpose input/output)...
Definition motor_screen.c:278
const ui_plot_series_t mo_series[S_COUNT]
The four channels' plot series: volts, amps, power and RPM.
Definition motor_screen.c:45
const ui_text_id_t mo_names[S_COUNT]
Per channel, the text id of its name.
Definition motor_screen.c:61
#define NUDGE_W
Definition motor_live_int.h:60
bool mo_target_locked(void)
Returns whether the TARGET row takes no press: the bench is not SAFE, ARM is held or the servo progra...
Definition motor_screen.c:445
const uint16_t mo_ok[S_COUNT]
Per channel, the bench report flags that make its reading valid.
Definition motor_screen.c:54
void mo_end_drag(void)
Ends a drag on the track and keeps the knob out of the frame.
Definition motor_screen.c:163
void mo_throttle_from_zero(void)
Puts the slider, the readout and the step keys at 0% across an arm or disarm edge,...
Definition motor_screen.c:330
The motor and ESC (electronic speed controller) bench screen.
motor_cmd_kind_t
Definition motor_screen.h:36
The MOTOR & ESC screen's private seam between motor_screen.c, the screen and LIVE's page (with motor_...
#define STOP_FLOOR
The lowest row a control that stops what the bench drives, or a line of text, may reach: 4px above th...
Definition motor_screen_int.h:75
The bench readings in the units a person reads: V, A, W and rpm, with their peaks.
Definition bench_state.h:54
MOTOR & ESC's LIVE state: the plot, the throttle slider and the bench's report, the ARM gate,...
Definition motor_live_int.h:115
uint32_t drawn_ostrip[2]
The output strip's text signature in each frame buffer.
Definition motor_live_int.h:205
unsigned drawn_mask
Bit per frame buffer: its title and strip were drawn.
Definition motor_live_int.h:141
bool knob_pending
Whether the knob's throttle command waits in pending.
Definition motor_live_int.h:133
bool no_pin
Definition motor_live_int.h:213
ui_value_gate_t gate
Whether the throttle follows its controls; gate.armed is what the ARM button reads.
Definition motor_live_int.h:127
uint8_t thr_proto
Protocol they are bound as: an outbind_protos() index, 0 for none known, MOTOR_PROTO_MIXED for severa...
Definition motor_live_int.h:185
gfx_rect_t down_rect
Definition motor_live_int.h:216
gfx_rect_t up_rect
Definition motor_live_int.h:217
int esc_kv
Definition motor_live_int.h:174
uint32_t arm_rev
Definition motor_live_int.h:172
bool bench_armed
Definition motor_live_int.h:145
bool pk_ok[S_COUNT]
Definition motor_live_int.h:210
uint32_t drawn_thr[2]
Definition motor_live_int.h:170
ui_plot_t plot
Definition motor_live_int.h:116
uint32_t drawn_plot[2]
Definition motor_live_int.h:156
bench_state_t bench
Definition motor_live_int.h:119
uint8_t press_id
Definition motor_live_int.h:219
bool have_press
Definition motor_live_int.h:220
uint32_t drawn_strip[2]
Definition motor_live_int.h:195
bool knob_had_cmd
Whether a throttle was pending before the knob moved.
Definition motor_live_int.h:135
gfx_rect_t arm_rect
Definition motor_live_int.h:214
bool drawn_sess_shown[2]
Whether PROGRAM's session was shown in each frame buffer.
Definition motor_live_int.h:202
ui_tabs_t tabs
Definition motor_live_int.h:118
gfx_rect_t reset_rect
Definition motor_live_int.h:215
uint32_t drawn_ctrl[2]
Definition motor_live_int.h:168
int pressed
Definition motor_live_int.h:218
motor_cmd_t pending
Definition motor_live_int.h:128
uint32_t thr_rev
Definition motor_live_int.h:169
uint32_t drawn_push[2]
Push count last painted into each frame buffer; UINT32_MAX for none.
Definition motor_live_int.h:152
bool kst_held
Definition motor_live_int.h:212
uint32_t ctrl_rev
Definition motor_live_int.h:167
uint32_t drawn_page[2]
SETTINGS page revision last painted into each frame buffer.
Definition motor_live_int.h:197
bool thr_pins_known
Definition motor_live_int.h:178
uint64_t thr_pins
Definition motor_live_int.h:177
float knob_prev
Definition motor_live_int.h:136
ui_slider_t slider
Definition motor_live_int.h:117
uint32_t thr_ports_rev
Port_view_revision() when the TARGET row last named the DShot programming ports.
Definition motor_live_int.h:192
bool knob_finger
Whether a finger owned the slider since knob_frame().
Definition motor_live_int.h:139
uint32_t drawn_sess[2]
Definition motor_live_int.h:203
uint8_t drawn_title[2]
Telemetry tag last painted into each frame buffer; 0xFF for none.
Definition motor_live_int.h:162
uint32_t drawn_arm[2]
Definition motor_live_int.h:173
ui_hold_t arm
Definition motor_live_int.h:211
bool target_locked
Definition motor_live_int.h:198
Definition motor_screen.h:44
A DOWN, MOVE or UP of one contact.
Definition touch_types.h:69
Definition ui_widgets.h:415
Definition ui_slider.h:42
A row of tabs: their labels, where they are, which is selected and the press under way.
Definition ui_tabs.h:27
Definition ui_value_gate.h:40
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
#define UI_TAP_MIN
The smallest touch target for a control, in pixels: 48px, 7.2mm.
Definition ui_layout.h:71
A multi-series plot on one time base, with a scale per series.
A draggable value with presets: the throttle, and any other control that needs coarse reach and fine ...
The pane selector: one bench, several views of it.
The interface's words, one table per language.
ui_text_id_t
The screens' strings, TX_<ID> for each UI_TEXT() of ui_text.def.
Definition ui_text.h:43