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

The modelled ESC (electronic speed controller) and servo protocols: their parameters as data. More...

#include "prog_models.h"
#include <stddef.h>

Macros

#define MODEL_COUNT   (sizeof(k_models) / sizeof(k_models[0]))

Functions

const prog_model_t * prog_models (size_t *count)
const char * prog_model_name (const prog_model_t *m)
 A protocol's name: the firmware's, the same in every language.

Variables

static const char *const k_dir [] = { "NORMAL", "REVERSED", "BIDIRECTIONAL" }
static const char *const k_timing []
static const char *const k_pwm [] = { "24kHz", "48kHz", "96kHz" }
 The PWM frequencies an ESC offers.
static const char *const k_demag [] = { "OFF", "LOW", "HIGH" }
 The demagnetisation compensation settings.
static const char *const k_mtype [] = { "BLDC", "FOC" }
 VESC's motor types.
static const prog_param_t k_blheli []
static const prog_param_t k_am32 []
static const prog_param_t k_escape32 []
static const prog_param_t k_vesc []
static const prog_model_t k_models []

Detailed Description

The modelled ESC (electronic speed controller) and servo protocols: their parameters as data.

BLHeli_S and AM32 speak a one-wire bootloader at 19,200 baud; ESCape32 answers a text CLI (command-line interface); VESC uses framed packets at 115,200 baud. No transport on the IOmcu (the RP2350 board) carries any of them, so no PROGRAM list shows them (owner decision, 2026-10-18): a protocol gets a registry row (prog_registry.h) once a transport reaches the device. The tables stay as the parameter model such a row starts from. Servos by Hitec have a programmer of their own (hitec_panel.h) and no table here.

A definition says what kind of setting it is (a switch, a choice, a bounded number); a programmer draws one widget per kind. The names and the choices are the firmware's own and stay English in every language, as its configurators show them; the group and the help line are translated.

BLHeli_32 is absent: its parameters are stored in a form the bench cannot read. docs/BLHeli32.md has the detail.

SPDX-License-Identifier: MIT

Function Documentation

◆ prog_model_name()

const char * prog_model_name ( const prog_model_t * m)

A protocol's name: the firmware's, the same in every language.

Parameters
mthe protocol
Returns
its name; "" for NULL

◆ prog_models()

const prog_model_t * prog_models ( size_t * count)

The protocols, and their count in count (may be NULL).

Variable Documentation

◆ k_am32

const prog_param_t k_am32[]
static
Initial value:
= {
{ TX_PG_GROUP_MOTOR, "Motor direction", PROG_PARAM_ENUM,
TX_PG_HELP_DIRECTION,
k_dir, 3, 0,0,0,0, NULL, 0 },
{ TX_COUNT, "Timing advance", PROG_PARAM_NUMBER,
TX_PG_HELP_TIMING_DEG,
NULL, 0, 0, 30, 1, 0, "deg", 22 },
{ TX_COUNT, "PWM frequency", PROG_PARAM_ENUM,
TX_PG_HELP_PWM,
k_pwm, 3, 0,0,0,0, NULL, 1 },
{ TX_PG_GROUP_STARTUP, "Sinusoidal startup", PROG_PARAM_BOOL,
TX_PG_HELP_SINE,
NULL, 0, 0,0,0,0, NULL, 1 },
{ TX_COUNT, "Startup power", PROG_PARAM_NUMBER,
TX_PG_HELP_STARTUP,
NULL, 0, 25, 150, 25, 0, "%", 75 },
{ TX_PG_GROUP_PROTECTION, "Complementary PWM", PROG_PARAM_BOOL,
TX_PG_HELP_COMPLEMENTARY,
NULL, 0, 0,0,0,0, NULL, 1 },
{ TX_COUNT, "Low voltage cut", PROG_PARAM_NUMBER,
TX_PG_HELP_LVC,
NULL, 0, 28, 38, 1, 1, "V", 33 },
}
static const char *const k_pwm[]
The PWM frequencies an ESC offers.
Definition prog_models.c:41
@ PROG_PARAM_NUMBER
Definition prog_models.h:31
@ PROG_PARAM_ENUM
Definition prog_models.h:29
@ PROG_PARAM_BOOL
Definition prog_models.h:30

◆ k_blheli

const prog_param_t k_blheli[]
static
Initial value:
= {
{ TX_PG_GROUP_MOTOR, "Motor direction", PROG_PARAM_ENUM,
TX_PG_HELP_DIRECTION,
k_dir, 3, 0,0,0,0, NULL, 0 },
{ TX_COUNT, "Timing", PROG_PARAM_ENUM,
TX_PG_HELP_TIMING_STEPS,
k_timing, 5, 0,0,0,0, NULL, 2 },
{ TX_COUNT, "PWM frequency", PROG_PARAM_ENUM,
TX_PG_HELP_PWM,
k_pwm, 3, 0,0,0,0, NULL, 0 },
{ TX_PG_GROUP_STARTUP, "Startup power", PROG_PARAM_NUMBER,
TX_PG_HELP_STARTUP,
NULL, 0, 25, 150, 25, 0, "%", 100 },
{ TX_COUNT, "Demag compensation", PROG_PARAM_ENUM,
TX_PG_HELP_DEMAG,
k_demag, 3, 0,0,0,0, NULL, 1 },
{ TX_PG_GROUP_PROTECTION, "Brake on stop", PROG_PARAM_BOOL,
TX_PG_HELP_BRAKE,
NULL, 0, 0,0,0,0, NULL, 0 },
{ TX_COUNT, "Low voltage cut", PROG_PARAM_NUMBER,
TX_PG_HELP_LVC,
NULL, 0, 28, 38, 1, 1, "V", 35 },
{ TX_PG_GROUP_SOUND, "Beep volume", PROG_PARAM_NUMBER,
TX_PG_HELP_BEEP,
NULL, 0, 0, 100, 25, 0, "%", 50 },
}
static const char *const k_demag[]
The demagnetisation compensation settings.
Definition prog_models.c:43

◆ k_escape32

const prog_param_t k_escape32[]
static
Initial value:
= {
{ TX_PG_GROUP_MOTOR, "Motor direction", PROG_PARAM_ENUM,
TX_PG_HELP_DIRECTION,
k_dir, 3, 0,0,0,0, NULL, 0 },
{ TX_COUNT, "Timing", PROG_PARAM_NUMBER,
TX_PG_HELP_TIMING_DEG,
NULL, 0, 0, 30, 1, 0, "deg", 18 },
{ TX_COUNT, "PWM frequency", PROG_PARAM_ENUM,
TX_PG_HELP_PWM,
k_pwm, 3, 0,0,0,0, NULL, 2 },
{ TX_PG_GROUP_STARTUP, "Sine startup", PROG_PARAM_BOOL,
TX_PG_HELP_SINE,
NULL, 0, 0,0,0,0, NULL, 1 },
{ TX_PG_GROUP_PROTECTION, "Brake on stop", PROG_PARAM_BOOL,
TX_PG_HELP_BRAKE,
NULL, 0, 0,0,0,0, NULL, 1 },
{ TX_COUNT, "Telemetry", PROG_PARAM_BOOL,
TX_PG_HELP_TELEMETRY,
NULL, 0, 0,0,0,0, NULL, 1 },
}

◆ k_models

const prog_model_t k_models[]
static
Initial value:
= {
{ "BLHeli_S", TX_PG_TRANSPORT_ONEWIRE, TX_PG_DEVICE_BLHELI,
k_blheli, 8, PROG_MODEL_ESC },
{ "AM32", TX_PG_TRANSPORT_ONEWIRE, TX_PG_DEVICE_AM32,
k_am32, 7, PROG_MODEL_ESC },
{ "ESCape32", TX_PG_TRANSPORT_CLI, TX_PG_DEVICE_ESCAPE32,
k_escape32, 6, PROG_MODEL_ESC },
{ "VESC", TX_PG_TRANSPORT_PACKETS, TX_PG_DEVICE_VESC,
k_vesc, 5, PROG_MODEL_ESC },
}

◆ k_timing

const char* const k_timing[]
static
Initial value:
= { "LOW", "MEDIUM LOW", "MEDIUM",
"MEDIUM HIGH", "HIGH" }

◆ k_vesc

const prog_param_t k_vesc[]
static
Initial value:
= {
{ TX_PG_GROUP_MOTOR, "Motor type", PROG_PARAM_ENUM,
TX_PG_HELP_MOTOR_TYPE,
k_mtype, 2, 0,0,0,0, NULL, 1 },
{ TX_COUNT, "Current limit", PROG_PARAM_NUMBER,
TX_PG_HELP_CURRENT,
NULL, 0, 10, 100, 10, 0, "A", 40 },
{ TX_PG_GROUP_PROTECTION, "Regen braking", PROG_PARAM_BOOL,
TX_PG_HELP_REGEN,
NULL, 0, 0,0,0,0, NULL, 1 },
{ TX_COUNT, "Low voltage cut", PROG_PARAM_NUMBER,
TX_PG_HELP_LVC,
NULL, 0, 28, 38, 1, 1, "V", 34 },
{ TX_PG_GROUP_REPORTING, "Telemetry", PROG_PARAM_BOOL,
TX_PG_HELP_TELEMETRY,
NULL, 0, 0,0,0,0, NULL, 1 },
}
static const char *const k_mtype[]
VESC's motor types.
Definition prog_models.c:45