|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The limit run's outbox and report, and the words the screen and the report name a verdict, a reason and a phase by: see servo_limrun.h. More...
Data Structures | |
| struct | cur_t |
| One line at a time, found by counting, as the automatic test's report is (servo_report.c): a cursor walks the lines in order and prints the one asked for. More... | |
Macros | |
| #define | LS(id) |
Functions | |
| servo_test_out_t | servo_limrun_peek (servo_limrun_t *r, const char **text) |
| The report's lines, in order, then END; OPEN_TXT first. | |
| void | servo_limrun_pop (servo_limrun_t *r) |
| Take the outbox entry last returned by servo_limrun_peek(). | |
| bool | servo_limrun_drained (const servo_limrun_t *r) |
| Tell whether the run has nothing left to hand over. | |
| static bool | here (cur_t *c) |
| Count one line, and tell whether it is the one asked for. | |
| static bool | blank (cur_t *c) |
| Write an empty line when it is the one asked for. | |
| static bool | text_line (cur_t *c, servo_str_t id) |
| Write a table entry when it is the line asked for. | |
| static bool | end_lines (const servo_limrun_t *r, cur_t *c, const servo_limrun_side_t *e, uint8_t side) |
| The lines of one end of the search: its result, and with the encoder on, its angle. | |
| static bool | head_lines (const servo_limrun_t *r, cur_t *c) |
| The head of the report: title, result, device and settings, the search, the meter, the limits, the duration and the two ends. | |
| static servo_str_t | side_word (const servo_limrun_t *r, int g) |
| Name table entry for the side a register's value was found on. | |
| static void | share_text (char *buf, size_t n, int32_t d, int32_t span) |
| A share of travel, 0.1us over 0.1us, as three decimals; "-" for none. | |
| static void | raw_text (char *buf, size_t n, uint16_t v) |
| A register count as text: "-" for none, else the count. | |
| static bool | reg_lines (const servo_limrun_t *r, cur_t *c, int g) |
| The lines of one register: its angle, count and side, then its linear fit once the side is found and needed. | |
| static double | us_of (uint16_t dus) |
| NEUTRAL, PULSE LOWER and PULSE UPPER, 0.1us, as microseconds. | |
| static bool | prog_lines (const servo_limrun_t *r, cur_t *c) |
| The programming section: the servo, its pulses, what was written, the backup and restore lines, and the check ends. | |
| static bool | tail_lines (const servo_limrun_t *r, cur_t *c) |
| The last lines of the report: the unit note when programming, and the bench line. | |
| bool | servo_limrun_report_line (const servo_limrun_t *r, unsigned idx, char *buf, size_t n) |
Line idx of the report into buf; false past the last. | |
| servo_str_t | servo_limrun_verdict_str (servo_limrun_verdict_t v) |
| The table entries the screen and the report name these by. | |
| servo_str_t | servo_limrun_why_str (const servo_limrun_t *r) |
| Name table entry for the reason of a run. | |
| servo_str_t | servo_limrun_phase_str (servo_limrun_phase_t ph) |
| Table entry for a phase of the limit run. | |
The limit run's outbox and report, and the words the screen and the report name a verdict, a reason and a phase by: see servo_limrun.h.
SPDX-License-Identifier: MIT
| #define LS | ( | id | ) |
|
static |
Write an empty line when it is the one asked for.
| c | Cursor; buf is set to "" when this is the line asked for. |
|
static |
The lines of one end of the search: its result, and with the encoder on, its angle.
A side not run gives the not-run line; a bound end gives the bind and the limit pulses with the baseline and knee currents; a free end gives its limit pulse and the baseline current. The angle line follows a run end when cfg.enc_on is set.
| r | Run state; its cfg gives enc_on. |
| c | Cursor. |
| e | The end's result. |
| side | SERVO_LIMRUN_LO or SERVO_LIMRUN_HI; picks the label. |
|
static |
The head of the report: title, result, device and settings, the search, the meter, the limits, the duration and the two ends.
| r | Run state. |
| c | Cursor. |
|
static |
Count one line, and tell whether it is the one asked for.
| c | Cursor. Its count goes up whether or not this is the line. |
|
static |
The programming section: the servo, its pulses, what was written, the backup and restore lines, and the check ends.
| r | Run state. |
| c | Cursor. |
|
static |
A register count as text: "-" for none, else the count.
| buf | Out: the text. |
| n | Size of buf, bytes. |
| v | Count; 0 for none. |
|
static |
The lines of one register: its angle, count and side, then its linear fit once the side is found and needed.
| r | Run state. |
| c | Cursor. |
| g | Register, SERVO_LIMRUN_LEFT or SERVO_LIMRUN_RIGHT. |
| bool servo_limrun_drained | ( | const servo_limrun_t * | r | ) |
Tell whether the run has nothing left to hand over.
| r | Run state. |
| servo_test_out_t servo_limrun_peek | ( | servo_limrun_t * | r, |
| const char ** | text ) |
The report's lines, in order, then END; OPEN_TXT first.
| r | Run state. NULL gives NONE. |
| text | Out: text of the entry; empty when there is none. |
| servo_str_t servo_limrun_phase_str | ( | servo_limrun_phase_t | ph | ) |
Table entry for a phase of the limit run.
| ph | Phase to name. |
| void servo_limrun_pop | ( | servo_limrun_t * | r | ) |
Take the outbox entry last returned by servo_limrun_peek().
| r | Run state. |
| bool servo_limrun_report_line | ( | const servo_limrun_t * | r, |
| unsigned | idx, | ||
| char * | buf, | ||
| size_t | n ) |
Line idx of the report into buf; false past the last.
| r | Run state. |
| idx | Line index, from 0. |
| buf | Out: line text. |
| n | Size of buf, bytes. |
| servo_str_t servo_limrun_verdict_str | ( | servo_limrun_verdict_t | v | ) |
The table entries the screen and the report name these by.
| v | Verdict to name. |
| servo_str_t servo_limrun_why_str | ( | const servo_limrun_t * | r | ) |
Name table entry for the reason of a run.
| r | Run state. NULL gives the NONE entry. |
|
static |
A share of travel, 0.1us over 0.1us, as three decimals; "-" for none.
| buf | Out: the text. |
| n | Size of buf, bytes. |
| d | Travel, 0.1us. |
| span | Full span, 0.1us; 0 or less gives "-". |
|
static |
Name table entry for the side a register's value was found on.
| r | Run state. |
| g | Register, SERVO_LIMRUN_LEFT or SERVO_LIMRUN_RIGHT. |
|
static |
The last lines of the report: the unit note when programming, and the bench line.
| r | Run state. |
| c | Cursor. |
|
static |
Write a table entry when it is the line asked for.
| c | Cursor; buf holds the entry when this is the line asked for. |
| id | Table entry to write, in the cursor's language. |
|
static |
NEUTRAL, PULSE LOWER and PULSE UPPER, 0.1us, as microseconds.
| dus | Pulse width, 0.1us. |