1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef _JUMP_ROPE_COUNT_DEVICE_H
- #define _JUMP_ROPE_COUNT_DEVICE_H 1
- #include "schmidt_trigger.h"
- #include "monotonic_queue.h"
- #include "ringbuf.h"
- struct jump_rope_count_config
- {
- float lg, hg, la, ha, lgz, hgz, a_g_window;
- int cy_window, cy_crit, cy_suppress_time, wait_time;
- };
- struct jump_rope_count_device
- {
- struct schmidt trig_g, trig_a, trig_gz;
- struct ringbuf rbuf_g, rbuf_a;
- struct monotonic_queue mq_min_cy, mq_max_cy;
- int cy_window, cy_crit, cy_suppress_time, wait_time;
- int cy_suppress, remain_time;
- float last_cy, last_cy_fixed;
- };
- struct sensor_packet
- {
- float ax, ay, az, gx, gy, gz, cy;
- };
- enum jump_rope_count_result
- {
- RESULT_INACTIVE = -1,
- RESULT_NONE = 0,
- RESULT_TRIGGERED = 1
- };
- extern int jump_rope_count_device_init(struct jump_rope_count_device *dev,
- struct jump_rope_count_config *cfg);
- extern int process_packet(struct jump_rope_count_device *dev,
- struct sensor_packet *packet,
- enum jump_rope_count_result *result);
- #endif
- /* vim: set ts=8 sw=8 sts=8 noet: */
|