|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
A command of the SERVO screen as the panel's servo link takes it (servo_link.h), and what the link reports back: the frame rate's state, a pause let go of and where a sweep started. More...
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | servo_cmd_t |
| A command of the SERVO screen, as the servo link takes it. More... | |
| struct | servo_pause_end_t |
| A pause the panel has let go of, for servo_cmd_stale(). More... | |
Enumerations | |
| enum | servo_cmd_kind_t { SERVO_CMD_NONE = 0 , SERVO_CMD_POSITION , SERVO_CMD_CENTRE , SERVO_CMD_RELEASE , SERVO_CMD_ARM , SERVO_CMD_DISARM , SERVO_CMD_SWEEP , SERVO_CMD_HOLD } |
| The kind of a command of the SERVO screen. More... | |
| enum | servo_rate_state_t { SERVO_RATE_UNSENT = 0 , SERVO_RATE_IN_FORCE , SERVO_RATE_REFUSED , SERVO_RATE_UNSUPPORTED , SERVO_RATE_IN_FORCE_SURFACES } |
| What became of a frame rate the panel wrote to the SERVO page. More... | |
| enum | servo_sweep_from_t { SERVO_SWEEP_FROM_REST , SERVO_SWEEP_FROM_HERE , SERVO_SWEEP_FROM_FROZEN , SERVO_SWEEP_RESUMED } |
| Where the IOmcu's output was when it started a sweep. More... | |
Functions | |
| servo_rate_state_t | servo_rate_in_force (uint16_t minor) |
The state an acknowledged rate is shown in, by the IOmcu's protocol minor minor: SERVO_RATE_IN_FORCE from LINK_MINOR_SERVO_TARGET_RATE (4.19), where the rate reaches the PWM TARGET alone, and SERVO_RATE_IN_FORCE_SURFACES below it. | |
| bool | servo_cmd_survives_link_loss (const servo_cmd_t *c) |
| Whether a command kept to be said again may still be said after the link has gone and come back. | |
| uint16_t | servo_cmd_pause_root (const servo_cmd_t *c) |
The pause a HOLD c ends when the panel lets it go: the pause its chain rests on (from_pause) when it was posted before an earlier pause's resume was acknowledged, and otherwise its own. | |
| bool | servo_cmd_stale (servo_pause_end_t *e, const servo_cmd_t *c) |
Whether the drive command c (a position, a centre, a sweep or a hold) was asked during the pause e records as let go of, so is stale and is not to be sent: the screen has ended that pause, and the command would hold or move the servo somewhere it no longer shows. | |
A command of the SERVO screen as the panel's servo link takes it (servo_link.h), and what the link reports back: the frame rate's state, a pause let go of and where a sweep started.
Below the screen, so the link module in shared/outputs takes the types without the screen's header. servo_screen.h includes it.
SPDX-License-Identifier: MIT
| enum servo_cmd_kind_t |
The kind of a command of the SERVO screen.
| enum servo_rate_state_t |
What became of a frame rate the panel wrote to the SERVO page.
| Enumerator | |
|---|---|
| SERVO_RATE_UNSENT | not written yet: it goes with a position |
| SERVO_RATE_IN_FORCE | the target the IOmcu holds runs at it (servo_in_force_note()) |
| SERVO_RATE_REFUSED | a pulse longer than the frame, or a pin sharing a PWM slice with an output at another rate; the pins kept theirs |
| SERVO_RATE_UNSUPPORTED | the IOmcu has no SERVO page: protocol 4.0 runs each slot at its binding's rate |
| SERVO_RATE_IN_FORCE_SURFACES | every PWM surface runs at it, whatever the target: protocol 4.1 to 4.18 |
| enum servo_sweep_from_t |
Where the IOmcu's output was when it started a sweep.
| Enumerator | |
|---|---|
| SERVO_SWEEP_FROM_REST | where it was held before the sweep |
| SERVO_SWEEP_FROM_HERE | carrying on: a changed curve |
| SERVO_SWEEP_FROM_FROZEN | where it froze when the sweep went unrepeated, |
| SERVO_SWEEP_RESUMED | where it was held: the paused sweep carried on from its phase; |
| uint16_t servo_cmd_pause_root | ( | const servo_cmd_t * | c | ) |
The pause a HOLD c ends when the panel lets it go: the pause its chain rests on (from_pause) when it was posted before an earlier pause's resume was acknowledged, and otherwise its own.
What the panel records for servo_cmd_stale() and hands to servo_screen_released().
| c | The command to test. NULL is refused. |
| bool servo_cmd_stale | ( | servo_pause_end_t * | e, |
| const servo_cmd_t * | c ) |
Whether the drive command c (a position, a centre, a sweep or a hold) was asked during the pause e records as let go of, so is stale and is not to be sent: the screen has ended that pause, and the command would hold or move the servo somewhere it no longer shows.
The screen asks nothing more of a pause it has left, and commands keep their order, so the first drive command from after the pause retires e; a pause number reused after 65535 more is then not mistaken for it.
| e | The pause record. Cleared (on = false) when c is a drive command that is not stale. Not changed when c is stale or is not a drive command. |
| c | The command to test. |
c is stale and must not be sent, false otherwise, including when e or c is NULL or e is off. | bool servo_cmd_survives_link_loss | ( | const servo_cmd_t * | c | ) |
Whether a command kept to be said again may still be said after the link has gone and come back.
A sweep or a hold may not: both end with the link, on the screen and at the far end, and said again they would start motion nobody asked for. A position is what the screen still shows.
| c | The command to test. NULL is refused. |
| servo_rate_state_t servo_rate_in_force | ( | uint16_t | minor | ) |
The state an acknowledged rate is shown in, by the IOmcu's protocol minor minor: SERVO_RATE_IN_FORCE from LINK_MINOR_SERVO_TARGET_RATE (4.19), where the rate reaches the PWM TARGET alone, and SERVO_RATE_IN_FORCE_SURFACES below it.
| minor | IOmcu protocol minor version, as acknowledged. |
minor at 4.19 or above, SERVO_RATE_IN_FORCE_SURFACES below it. No other state is returned.