rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
esc_stick_panel.h File Reference

ESC STICK: an ESC (electronic speed controller) programmed through its throttle-stick menu, the session MOTOR & ESC > PROGRAM opens from the STICK MENU row of its list (prog_registry.h). More...

#include <stdbool.h>
#include <stdint.h>
#include "esc_stick.h"
#include "motor_screen.h"
#include "prog_registry.h"
#include "supply.h"
#include "tone_link.h"
#include "ui_keypad.h"
#include "ui_screen.h"

Go to the source code of this file.

Functions

int esc_stick_panel_stage (void)
void esc_stick_panel_bench (uint32_t now_ms, bool armed, uint32_t stops, uint32_t pressed, bool link_up)
void esc_stick_panel_set_throttle (bool read, uint8_t channels)
void esc_stick_panel_supply (const supply_state_t *st)
void esc_stick_panel_tone (const tone_readout_t *r)
bool esc_stick_panel_poll_cmd (motor_cmd_t *out)
const esc_profile_t * esc_stick_panel_profile (void)
uint32_t esc_stick_panel_runs (void)
const esc_stick_t * esc_stick_panel_stick (void)
const char * esc_stick_panel_search (void)
bool esc_stick_panel_typing (void)
const ui_keypad_t * esc_stick_panel_keypad (void)
 TIMING's keypad, which a tap on a row's value opens over the session's pages; for tests and the renderer.
int esc_stick_panel_keypad_setting (void)
 The setting TIMING's open keypad types; for tests.
int esc_stick_panel_listed (int *top)
int esc_stick_panel_level (void)
const char * esc_stick_panel_maker (void)
int esc_stick_panel_model (void)
const char * esc_stick_panel_maker_at (int i)
const esc_profile_t * esc_stick_panel_row (int i, int *model)
const char * esc_stick_panel_row_why (int i)
int esc_stick_panel_item_at (int i)
const char * esc_stick_panel_row_warn (int i)
const char * esc_stick_panel_result_head (void)
const char * esc_stick_panel_result_more (void)
const char * esc_stick_panel_left_text (void)
const char * esc_stick_panel_note (void)
const esc_profile_t * esc_stick_panel_page (void)
const char * esc_stick_panel_step_text (const esc_manual_t *m)
const char * esc_stick_panel_hand_why (void)
uint32_t esc_stick_panel_entry_shown (void)
bool esc_stick_panel_supply_reads_off (void)
bool esc_stick_panel_hand_shown (void)
void esc_stick_panel_lights (bool *red, bool *green)
const char * esc_stick_panel_why_text (const char *why)
int esc_stick_panel_wrap_lines (const char *text, int cells)

Variables

const prog_page_set_t esc_stick_pages

Detailed Description

ESC STICK: an ESC (electronic speed controller) programmed through its throttle-stick menu, the session MOTOR & ESC > PROGRAM opens from the STICK MENU row of its list (prog_registry.h).

The session runs the stick programmer (esc_stick.h). Like the MOTOR & ESC screen it owns no hardware: the application hands it the bench's state and the supply's samples, and takes back the ARM, DISARM and THROTTLE commands it posts. The supply is switched through the SUPPLY screen's own ON and OFF.

The session is a full-width page set: it lays out over the whole body under MOTOR & ESC's strip row, where the host draws the output strip (PROG_FULL_*). Its levels, each one home tag up: TIMING or a run on a profile's page, the page, one maker's models, the makers, then out of the session to PROGRAM's list.

SPDX-License-Identifier: MIT

Function Documentation

◆ esc_stick_panel_bench()

void esc_stick_panel_bench ( uint32_t now_ms,
bool armed,
uint32_t stops,
uint32_t pressed,
bool link_up )

The bench as this frame found it, before the frame's touch: the time, whether it is armed, how many stops have been counted and how many of those an operator pressed (arming_pressed_count()), and whether the IOmcu answers. A stop count that moved ends the warning's hold, and a run: with STOP when every new stop was pressed, else with BENCH STOPPED.

◆ esc_stick_panel_entry_shown()

uint32_t esc_stick_panel_entry_shown ( void )

The entry time the profile's page shows, ms; for tests.

◆ esc_stick_panel_hand_shown()

bool esc_stick_panel_hand_shown ( void )

Whether the manual steps' pop-up is open; for tests.

◆ esc_stick_panel_hand_why()

const char * esc_stick_panel_hand_why ( void )

Why the manual steps' pop-up says its profile does not run, for the model it was opened for; NULL when it runs or no pop-up is open. For tests.

◆ esc_stick_panel_item_at()

int esc_stick_panel_item_at ( int i)

The item row i of the page shows, as an index into the profile's items; -1 past the last. For tests.

◆ esc_stick_panel_keypad()

const ui_keypad_t * esc_stick_panel_keypad ( void )

TIMING's keypad, which a tap on a row's value opens over the session's pages; for tests and the renderer.

Returns
The keypad, open or closed.

◆ esc_stick_panel_keypad_setting()

int esc_stick_panel_keypad_setting ( void )

The setting TIMING's open keypad types; for tests.

Returns
Its setting_id_t, or -1 while the keypad is closed.

◆ esc_stick_panel_left_text()

const char * esc_stick_panel_left_text ( void )

The prompt's line on what no DONE does, as the prompt would draw it now; for tests.

◆ esc_stick_panel_level()

int esc_stick_panel_level ( void )

The list's level: 0 the makers, 1 one maker's models; the maker open ("" on level 0); the page's model index (-1 for none); and the rows of each level, NULL past the end. For tests.

◆ esc_stick_panel_lights()

void esc_stick_panel_lights ( bool * red,
bool * green )

What the stack light shows; for tests.

◆ esc_stick_panel_listed()

int esc_stick_panel_listed ( int * top)

How many profiles the list holds under the search, and the index in it of the top row shown; for tests.

◆ esc_stick_panel_note()

const char * esc_stick_panel_note ( void )

The note the page shows under RUN: why a run cannot start, "" for none; for tests.

◆ esc_stick_panel_page()

const esc_profile_t * esc_stick_panel_page ( void )

The profile whose page is open, or NULL on the list; for tests.

◆ esc_stick_panel_poll_cmd()

bool esc_stick_panel_poll_cmd ( motor_cmd_t * out)

A command a stick run asks for, oldest first; true when there was one.

◆ esc_stick_panel_profile()

const esc_profile_t * esc_stick_panel_profile ( void )

The profile of a stick run under way, for the simulated ESC on the panel's modelled supply; NULL when none is.

◆ esc_stick_panel_result_head()

const char * esc_stick_panel_result_head ( void )

The result's count of the selections made, and its line for the changes past the fourth ("" when all show), as drawn now; for tests.

◆ esc_stick_panel_row_warn()

const char * esc_stick_panel_row_warn ( int i)

The warning row i shows while it runs: the ESC's voltage rating unknown; NULL for none. For tests.

◆ esc_stick_panel_row_why()

const char * esc_stick_panel_row_why ( int i)

Why row i of a maker's models does not run, in the language showing, or NULL when it runs or there is no such row; for tests.

◆ esc_stick_panel_runs()

uint32_t esc_stick_panel_runs ( void )

How many stick runs have started, so a new one starts a fresh simulation.

◆ esc_stick_panel_search()

const char * esc_stick_panel_search ( void )

The ESC STICK search as typed, "" for none, and whether its keyboard is open; for tests.

◆ esc_stick_panel_set_throttle()

void esc_stick_panel_set_throttle ( bool read,
uint8_t channels )

The output binding, every frame: whether one is read (BIND_READ_OK), and the channels it binds as a throttle (outputs_role_channels(), one bit each). RUN is refused while none is read or it binds no throttle, and while the supply is the panel's model (supply_screen_model()); the note names which. Zero at start: nothing is known until the application says.

◆ esc_stick_panel_stage()

int esc_stick_panel_stage ( void )

Where the session is, for tests: closed, on the list, or on a profile's page (esc_stick_int.h's STAGE_*).

◆ esc_stick_panel_step_text()

const char * esc_stick_panel_step_text ( const esc_manual_t * m)

A manual step's text in the language showing: its action_de where the profile gives one and German shows, else its English action.

◆ esc_stick_panel_stick()

const esc_stick_t * esc_stick_panel_stick ( void )

The stick run, under way or ended, for tests.

◆ esc_stick_panel_supply()

void esc_stick_panel_supply ( const supply_state_t * st)

One supply sample, every one, in the order they were taken.

◆ esc_stick_panel_supply_reads_off()

bool esc_stick_panel_supply_reads_off ( void )

Whether the supply reads off now, by the rule a run holds it to: its own state off, the current at or under ESC_STICK_OFF_MA for ESC_STICK_OFF_SETTLE_MS, in a reading no older than ESC_STICK_STALE_MS. For tests.

◆ esc_stick_panel_tone()

void esc_stick_panel_tone ( const tone_readout_t * r)

The phase tap as the control task last read it (tone_link_readout()), every frame. While the tap is enabled on SETUP a stick run's page shows it: its state, the last window's pitch, the last beeps, and the counts of beeps lost and beeps not read. The pitch and the lost count read "--" while tone_readout_t.read is false. Read only: the run still counts its beeps from the supply current.

◆ esc_stick_panel_why_text()

const char * esc_stick_panel_why_text ( const char * why)

A refusal of the stick engine (esc_stick_kind(), esc_stick_check(), esc_stick_start()) in the language showing, found by the engine's words; one the screen does not know comes back as given, and NULL as "refused".

◆ esc_stick_panel_wrap_lines()

int esc_stick_panel_wrap_lines ( const char * text,
int cells )

The lines text takes broken as the screen breaks it, in lines of cells, one cell at least; for tests.

Variable Documentation

◆ esc_stick_pages

const prog_page_set_t esc_stick_pages
extern

The page set MOTOR & ESC opens: the registry's STICK MENU row.