6 uint16_t period; /* over how many samples to average */
10 uint16_t num_samples; /* how often did we try to sample? */
11 uint16_t num_samples_valid; /* how often did we receive valid samples? */
13 void (*outfn)(struct running_avg *, int32_t avg);
17 /* input a new sample into the averaging process */
18 void runavg_input(struct running_avg *ravg, int32_t val, int valid);
20 /* check if sufficient samples have been obtained, and call outfn() */
21 int runavg_check_output(struct running_avg *ravg);