62typedef void (*
cal_batt_fn)(
float *
vbat,
float *last_used_mah,
float *last_scale_i);
77uint8_t
cal_start(uint8_t type, uint8_t option, uint8_t armed, uint32_t now_ms, uint8_t *reason);
78uint8_t
cal_capture(uint32_t now_ms, uint8_t *reason);
80uint8_t
cal_set_ref(uint8_t type, uint8_t index,
float value, uint8_t *reason);
uint8_t cal_take_changed(void)
1 if the state/step changed since the last call (send a CALIB frame now)
void cal_tick(uint32_t now_ms)
uint8_t cal_abort(uint8_t *reason)
void cal_init(const cal_config_t *cfg, cal_set_t *active)
active: the set in effect (RAM), owned by the caller.
uint8_t cal_set_ref(uint8_t type, uint8_t index, float value, uint8_t *reason)
void(* cal_batt_fn)(float *vbat, float *last_used_mah, float *last_scale_i)
battery readings for the BATTERY calibration (AppTask context): vbat with the scale in effect,...
uint8_t cal_running(void)
active and not DONE: blocks arming / other starts
uint8_t cal_save_check(uint8_t *reason)
CAL_SAVE validation: returns the ACK; on OK the caller writes the result (cal_result()) to flash and ...
uint8_t cal_capture(uint32_t now_ms, uint8_t *reason)
void(* cal_apply_fn)(uint8_t type, const cal_set_t *set)
apply hook: puts 'type' of 'set' in effect (RAM), in the estimator context
void cal_feed(const cal_sample_t *s, uint32_t now_ms)
void cal_saved(void)
state SAVED (one frame), then IDLE
size_t cal_frame(uint8_t *out, size_t cap)
CALIB frame for the current calibration; 0 if none.
void cal_copy_type(cal_set_t *dst, const cal_set_t *src, uint8_t type)
copies the part of 'src' that belongs to 'type' into 'dst'
uint8_t cal_take_failed(void)
1 + type once when a calibration failed (EVENT 51), 0 otherwise
uint8_t cal_active(void)
a calibration exists (any state but IDLE)
const cal_set_t * cal_result(void)
uint8_t cal_start(uint8_t type, uint8_t option, uint8_t armed, uint32_t now_ms, uint8_t *reason)
uint8_t cal_wants_samples(void)
void cal_set_defaults(cal_set_t *s, const float mag_hi_default[3])
void cal_set_sensors(uint16_t sensors)
expansion board detected later
uint16_t sensors
CAPS bits.
cal_batt_fn batt
NULL: BATTERY -> SENSOR_MISSING.
uint8_t running
estimator running
uint32_t done_mask
bit (type-1): this calibration was done and saved