|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The schedule's move capture on the FAST channel, and FAST's history the level before a command is taken from. More...
Functions | |
| bool | sense_cap_under_way (const sense_cap_t *c) |
| Whether a capture is armed, waiting or moving. | |
| bool | sense_sched_cap_arm (sense_sched_t *s, const sense_cap_arm_t *levels) |
Arm a capture on FAST with levels; rise_ua SENSE_CAP_RISE_AUTO takes the level before the command from FAST. | |
| static float | ua_to_a (int32_t ua) |
| Convert µA to A. | |
| static int32_t | a_to_ua (float a) |
| Convert A to µA, rounded half away from zero. | |
| void | sense_sched_cap_edge (sense_sched_t *s, uint64_t edge_us) |
The PWM frame carrying the new pulse starts at edge_us, on the clock now_us() reads; it may lie ahead. | |
| void | sense_sched_cap_disarm (sense_sched_t *s) |
| Stop a capture; its count stays. | |
| static void | cap_end (sense_cap_t *c, sense_cap_state_t state) |
The capture ends as state, with what the move measured. | |
| static int32_t | fast_ua (const sense_sched_t *s, const sense_value_t *v) |
| A clipped FAST sample at the end of the range it is at or past, as the capture's filter takes it; a sample with a value as it is. | |
| static void | fast_keep (sense_sched_t *s, const sense_value_t *v, uint32_t at_t) |
| A FAST sample into the history the level before a command is taken from. | |
| static bool | take_rise (sense_sched_t *s) |
| The level before the command: the mean of the FAST samples stamped in the SENSE_WINDOW_MS before the edge. | |
| static void | cap_step (sense_sched_t *s, const sense_value_t *v, uint32_t at_t) |
A FAST sample, or none, and the clock: both at at_t. | |
| void | sense_cap_step (sense_sched_t *s, const sense_value_t *v, uint32_t at_t) |
The capture's step: FAST's sample of this tick, or NULL with none, at at_t (0.1ms). | |
The schedule's move capture on the FAST channel, and FAST's history the level before a command is taken from.
See sense_sched.h.
SPDX-License-Identifier: MIT
|
static |
Convert A to µA, rounded half away from zero.
| a | Current in A. |
|
static |
The capture ends as state, with what the move measured.
| c | The capture. |
| state | The state the capture ends in. |
|
static |
A FAST sample, or none, and the clock: both at at_t.
| s | The schedule. |
| v | FAST's sample, or NULL when there is none. |
| at_t | Time of the step, in 0.1ms. |
|
static |
A FAST sample into the history the level before a command is taken from.
| s | The schedule. |
| v | The FAST sample. |
| at_t | Time of the sample, in 0.1ms. |
|
static |
A clipped FAST sample at the end of the range it is at or past, as the capture's filter takes it; a sample with a value as it is.
Only called with a FAST channel.
| s | The schedule. |
| v | The FAST sample. |
| void sense_cap_step | ( | sense_sched_t * | s, |
| const sense_value_t * | v, | ||
| uint32_t | at_t ) |
The capture's step: FAST's sample of this tick, or NULL with none, at at_t (0.1ms).
Then the sample into the history.
| s | The schedule whose capture and history are updated. |
| v | FAST's sample of this tick, or NULL when there is none. |
| at_t | Time of the step, in 0.1ms. |
| bool sense_cap_under_way | ( | const sense_cap_t * | c | ) |
Whether a capture is armed, waiting or moving.
| c | The capture to test. |
| bool sense_sched_cap_arm | ( | sense_sched_t * | s, |
| const sense_cap_arm_t * | levels ) |
Arm a capture on FAST with levels; rise_ua SENSE_CAP_RISE_AUTO takes the level before the command from FAST.
Refused, and nothing changed, with no FAST channel or while its INA3221 is not online.
| s | The schedule. |
| levels | The capture levels. |
| void sense_sched_cap_disarm | ( | sense_sched_t * | s | ) |
Stop a capture; its count stays.
| s | The schedule. |
| void sense_sched_cap_edge | ( | sense_sched_t * | s, |
| uint64_t | edge_us ) |
The PWM frame carrying the new pulse starts at edge_us, on the clock now_us() reads; it may lie ahead.
The samples taken while armed seed the filter. Nothing unless a capture is armed.
| s | The schedule. |
| edge_us | Start of the PWM frame carrying the new pulse, in µs. |
|
static |
The level before the command: the mean of the FAST samples stamped in the SENSE_WINDOW_MS before the edge.
False with none.
| s | The schedule. |
|
static |
Convert µA to A.
| ua | Current in µA. |