26#define HRV_MOTION_STILL_DEFAULT 60
27#define HRV_MOTION_MIN_SAMPLES 20
void hrv_motion_push(HrvMotion *motion, int16_t x_mg, int16_t y_mg, int16_t z_mg)
Adds one accelerometer sample.
Definition hrv_motion.c:29
int hrv_motion_score(const HrvMotion *motion)
The average movement per sample so far.
Definition hrv_motion.c:45
void hrv_motion_reset(HrvMotion *motion)
Empties the movement, ready for the next burst.
Definition hrv_motion.c:24
bool hrv_motion_cannot_pass(const HrvMotion *motion, uint16_t max_mg, uint32_t max_samples)
Whether the burst can no longer finish under a limit, however still the wrist stays.
Definition hrv_motion.c:60
bool hrv_motion_over(const HrvMotion *motion, uint16_t max_mg)
Whether the wrist has moved more than a limit through the burst so far.
Definition hrv_motion.c:55
The movement seen over one burst. Start it with hrv_motion_reset.
Definition hrv_motion.h:33
int16_t last_x
The sample before on the x axis, in milli-g.
Definition hrv_motion.h:34
int16_t last_y
The sample before on the y axis, in milli-g.
Definition hrv_motion.h:35
uint32_t sum
The movement from one sample to the next, added up.
Definition hrv_motion.h:38
uint16_t samples
How many moves are added up.
Definition hrv_motion.h:39
bool primed
Whether there is a sample before to measure from.
Definition hrv_motion.h:37
int16_t last_z
The sample before on the z axis, in milli-g.
Definition hrv_motion.h:36