|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
MOTOR & ESC > SETTINGS: the ESC / BENCH category's 8 rows (SET_CAT_ESC), under PACK, MOTOR and THROTTLE OUTPUT. The rows are the settings SETUP listed before they moved here: one home each, the same label, help and value text. More...
#include <stdio.h>#include <string.h>#include "motor_screen.h"#include "settings.h"#include "ui_keypad.h"#include "ui_setting_keypad.h"#include "ui_text.h"#include "ui_theme.h"#include "ui_widgets.h"#include "motor_screen_int.h"Data Structures | |
| struct | [struct].k_rows |
| struct | [struct].p |
| The page's state. More... | |
Macros | |
| #define | ROW_COUNT ((int)(sizeof(k_rows) / sizeof(k_rows[0]))) |
| #define | TOP_Y (PAGE_Y + 8) |
| #define | HEAD_H 28 |
| #define | HEAD_GAP 8 |
| #define | ROW_PITCH 68 |
| #define | BOX_H UI_TAP_MIN |
| #define | BOX_W 120 |
| #define | HELP_DY (BOX_H + 2) |
| #define | COL_W ((PAGE_W - 30) / 2) |
| #define | COL_X(k) |
Column k's left edge, px. | |
| #define | SAVE_Y (STOP_FLOOR - 20) |
| #define | MS_FONT (&gfx_font_10x20) |
| #define | MS_FINE UI_FONT_FINE |
Enumerations | |
| enum | { HD_PACK = 0 , HD_MOTOR , HD_THROTTLE , HD_COUNT } |
Functions | |
| static uint8_t | save_state (void) |
| static int | col_of (int i) |
The column row i is in: THROTTLE OUTPUT's rows on the right. | |
| static int | row_y (int i) |
The top of row i: its column's headings above it and its place among the column's rows. | |
| static gfx_rect_t | box_rect (int i) |
Row i's value box, at its column's right. | |
| static bool | safe_only (int i) |
| static bool | row_locked (int i, bool safe) |
| static int | decimals_of (const setting_def_t *d) |
| static void | open_keypad (int i) |
| static void | close_keypad (void) |
| void | msp_reset (void) |
| void | msp_leave (void) |
| void | msp_cancel (void) |
| bool | msp_modal (void) |
| bool | msp_pressed (void) |
| bool | msp_back (void) |
| uint32_t | msp_revision (void) |
| void | msp_tick (bool safe) |
| void | msp_event (const touch_event_t *evt, bool safe) |
| static void | draw_row (gfx_canvas_t *c, int i, bool safe) |
Row i: its label, its value box at the column's right and its help line, or the lock's reason, under them. | |
| void | msp_render (gfx_canvas_t *c, bool safe) |
| SETTINGS' page in its two columns, or the keypad over it. | |
| int | motor_screen_keypad_setting (void) |
| const ui_keypad_t * | motor_screen_keypad (void) |
| SETTINGS' keypad, open or closed, for a test to read what it opened with and where its keys are. | |
| int | motor_settings_rows (setting_id_t *out, int max) |
| int | motor_settings_heading (int row) |
| const char * | motor_endpoints_alert (endpoints_block_t why) |
| gfx_rect_t | motor_settings_box (int row) |
Variables | |
| static const struct | k_rows [] |
| static const ui_text_id_t | k_heading [HD_COUNT] |
| static struct | p |
MOTOR & ESC > SETTINGS: the ESC / BENCH category's 8 rows (SET_CAT_ESC), under PACK, MOTOR and THROTTLE OUTPUT. The rows are the settings SETUP listed before they moved here: one home each, the same label, help and value text.
A tap on a row's value opens the keypad over the page and the strip; its OK sets the value onto the setting's step inside its range and asks for a save (settings_request_save()). The store is one set: the panel writes the whole of it when the bench is SAFE and no transfer runs, so a value changed on SETUP and not saved there is written with it. The line at the page's foot says where the store stands: SAVED, SAVE PENDING, NOT SAVED, or SETUP CHANGES NOT SAVED while SETUP holds a change nothing has asked to keep.
Idle pulse and Full pulse are the throttle's endpoints, which the IOmcu (the RP2350 board) takes only on a disarmed bench. They take a press only while the bench is SAFE and ARM is not held (motor_screen.c's mo_endpoints_free()); otherwise their help line says so, and a keypad open for one closes.
SPDX-License-Identifier: MIT
| #define BOX_H UI_TAP_MIN |
A value box's height, px.
| #define BOX_W 120 |
Its width, px.
| #define COL_W ((PAGE_W - 30) / 2) |
A column: 295px.
| #define COL_X | ( | k | ) |
| #define HEAD_GAP 8 |
Over a heading under a row.
| #define HEAD_H 28 |
A heading's line, px.
| #define HELP_DY (BOX_H + 2) |
The help line, in a row.
| #define MS_FINE UI_FONT_FINE |
The help lines: 8 x 16.
| #define MS_FONT (&gfx_font_10x20) |
Labels, values, headings.
| #define ROW_PITCH 68 |
From row to row, px.
| #define SAVE_Y (STOP_FLOOR - 20) |
The save line, px.
| #define TOP_Y (PAGE_Y + 8) |
The first heading, px.
|
static |
Row i's value box, at its column's right.
| i | the row |
|
static |
The column row i is in: THROTTLE OUTPUT's rows on the right.
| i | the row |
|
static |
Row i: its label, its value box at the column's right and its help line, or the lock's reason, under them.
| c | the canvas |
| i | the row |
| safe | whether the pulse rows take a press |
| const char * motor_endpoints_alert | ( | endpoints_block_t | why | ) |
What the alert band says for a switch to ARMED refused because the pair of Idle pulse and Full pulse is not in force at the IOmcu, by endpoints_block(); NULL for ENDPOINTS_BLOCK_NONE and for a value outside the enum.
| const ui_keypad_t * motor_screen_keypad | ( | void | ) |
SETTINGS' keypad, open or closed, for a test to read what it opened with and where its keys are.
| int motor_screen_keypad_setting | ( | void | ) |
The setting SETTINGS' keypad types, or -1 while it is closed.
| gfx_rect_t motor_settings_box | ( | int | row | ) |
Row row's value box, which a tap opens the keypad on.
| int motor_settings_heading | ( | int | row | ) |
The heading row row sits under, a ui_text_id_t; -1 out of range.
| int motor_settings_rows | ( | setting_id_t * | out, |
| int | max ) |
SETTINGS' rows in their order, at most max into out (NULL counts them). Returns how many there are.
| void msp_render | ( | gfx_canvas_t * | c, |
| bool | safe ) |
SETTINGS' page in its two columns, or the keypad over it.
| c | the canvas |
| safe | whether the pulse rows take a press |
|
static |
The top of row i: its column's headings above it and its place among the column's rows.
| i | the row |
|
static |
| const struct [struct].k_rows k_rows[] |
| struct [struct].p p |
the page's state