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

MOTOR & ESC's PROGRAM: the registry's list and the output strip over a full-width session. More...

#include <stdio.h>
#include <string.h>
#include "motor_screen.h"
#include "prog_registry.h"
#include "supply_screen.h"
#include "ui_text.h"
#include "ui_theme.h"
#include "ui_widgets.h"
#include "ui_workbench.h"
#include "motor_screen_int.h"

Data Structures

struct  [struct].p
 The page's state. More...

Macros

#define STRIP_TARGET_CELLS   26u

Functions

static uint16_t caps_now (void)
static void list_now (prog_list_t *l)
static gfx_rect_t full_area (void)
void mpp_reset (void)
void mpp_enter (void)
void mpp_leave (void)
void mpp_cancel (void)
void mpp_armed (bool armed)
const prog_page_set_t * mpp_shown (void)
static uint32_t prog_signature (void)
void mpp_tick (float dt_s)
bool mpp_back (void)
static void row_open (uint8_t i)
bool mpp_event (const touch_event_t *evt)
bool mpp_pressed (void)
void mpp_cancel_press (void)
uint32_t mpp_revision (void)
void mpp_render_page (gfx_canvas_t *c)
static void supply_text (char *out, size_t size)
size_t motor_output_strip (char *out, size_t size, uint8_t proto, uint64_t pins, bool known, bool armed, bool *warn)
uint32_t mpp_strip_signature (uint8_t proto, uint64_t pins, bool known, bool armed)
void mpp_render_strip (gfx_canvas_t *c, uint8_t proto, uint64_t pins, bool known, bool armed)
 The strip in its row, over the clear, in PROG_FULL_STRIP_FONT: TARGET dim, the target in the text colour (the warning colour with no pin or the binding not read), the supply dim, and the bench SAFE or, in the danger colour, ARMED.

Variables

static struct  p

Detailed Description

MOTOR & ESC's PROGRAM: the registry's list and the output strip over a full-width session.

MOTOR & ESC's PROGRAM: the list of the registry's MOTOR rows (prog_registry.h) in the left column, and the session a row opens.

The list is the registry's view: one group, STICK MENU, with one row that opens ESC STICK. The output card stays on the right while the list shows. A live row's session is full width: it covers the left column and the rail, one level down, and the strip row above it holds the output strip in place of the tabs and the card:

TARGET DSHOT300 GPIO 0 GPIO 1   SUPPLY 7.60V  1.00A   SAFE

what the throttle drives, the supply's output as it reads, and the bench. The home tag climbs the session one level at a time (its back()); from its top it closes back to the list, and from the list it leaves the screen, which switches the bench to SAFE.

SPDX-License-Identifier: MIT

Function Documentation

◆ motor_output_strip()

size_t motor_output_strip ( char * out,
size_t size,
uint8_t proto,
uint64_t pins,
bool known,
bool armed,
bool * warn )

The output strip a full-width session on PROGRAM shows in the strip row, in place of the tabs and the output card, as one line: TARGET protocol pins SUPPLY v V i A SAFE ("ARMED" for an armed bench), the target as motor_throttle_target() puts it in 26 cells, the supply as it reads now (supply_screen_reading()): its voltage and current with the output on, OFF, ON without both readings, "--" while it does not answer. Into out of size bytes; warn (may be NULL) gets whether the target is a warning. Returns the length written.

◆ mpp_render_strip()

void mpp_render_strip ( gfx_canvas_t * c,
uint8_t proto,
uint64_t pins,
bool known,
bool armed )

The strip in its row, over the clear, in PROG_FULL_STRIP_FONT: TARGET dim, the target in the text colour (the warning colour with no pin or the binding not read), the supply dim, and the bench SAFE or, in the danger colour, ARMED.

Parameters
cThe canvas.
protoThe throttle's protocol.
pinsThe pins bound as throttle, one bit each.
knownWhether the binding is read.
armedWhether the bench is ARMED.