46#define SWEEP_MHZ_MIN 50u
47#define SWEEP_MHZ_MAX 5000u
49#define SWEEP_AMPLITUDE_MAX 500u
51#define SWEEP_DWELL_MAX_MS 5000u
53#define SWEEP_CENTRE 500u
bool sweep_step(sweep_t *w, uint32_t now_ms, uint16_t *command)
The command at now_ms into command. True while the sweep runs; false once it has stopped or made its ...
Definition servo_sweep.c:207
bool sweep_slew_limited(const sweep_cfg_t *cfg, uint16_t slew_per_s)
Whether a slew of slew_per_s command units a second is slower than the fastest change cfg's curve ask...
Definition servo_sweep.c:155
bool sweep_resume(sweep_t *w, uint32_t now_ms)
Carry a paused sweep on at now_ms from where it was paused. False, and nothing changes,...
Definition servo_sweep.c:62
uint32_t sweep_moves(const sweep_t *w, uint32_t now_ms)
How many ends the sweep has reached by now_ms, the moves limit included once reached.
Definition servo_sweep.c:142
bool sweep_cfg_valid(const sweep_cfg_t *cfg)
Whether cfg is one a sweep can run: a curve, a speed and an amplitude in range, and a dwell no longer...
Definition servo_sweep.c:13
bool sweep_start(sweep_t *w, const sweep_cfg_t *cfg, uint32_t now_ms)
Start cfg at now_ms. False, and stopped, for a configuration sweep_cfg_valid() refuses.
Definition servo_sweep.c:22
void sweep_pause(sweep_t *w, uint32_t now_ms)
Stop a running sweep at now_ms and keep how far into it it was, so sweep_resume() carries on from the...
Definition servo_sweep.c:52
void sweep_stop(sweep_t *w)
Stop, and forget any paused phase.
Definition servo_sweep.c:38
Definition servo_sweep.h:55
uint16_t dwell_ms
Definition servo_sweep.h:59
uint16_t amplitude
Definition servo_sweep.h:58
uint16_t moves
Definition servo_sweep.h:60
uint16_t mhz
Definition servo_sweep.h:57
Definition servo_sweep.h:63
uint32_t paused_ms
Definition servo_sweep.h:68
bool paused
Definition servo_sweep.h:67