Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
stationary_windowed.h
Go to the documentation of this file.
1
12#ifndef INFUSE_SDK_INCLUDE_INFUSE_ALGORITHM_RUNNER_ALGORITHMS_STATIONARY_WINDOWED_H_
13#define INFUSE_SDK_INCLUDE_INFUSE_ALGORITHM_RUNNER_ALGORITHMS_STATIONARY_WINDOWED_H_
14
15#include <stdint.h>
16
17#include <zephyr/toolchain.h>
18
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
33enum {
35};
36
38 /* Common algorithm configuration */
42 /* Standard deviation threshold in micro-g, above this value the device is moving */
44} __packed;
45
51
53void algorithm_stationary_windowed_fn(const struct zbus_channel *chan, const void *config,
54 void *data);
55
66#define ALGORITHM_STATIONARY_WINDOWED_DEFINE(name, loggers_, tdfs, window_seconds_, threshold_ug) \
67 static const struct algorithm_stationary_windowed_config name##_config = { \
68 .common = \
69 { \
70 .algorithm_id = 0x15F20000, \
71 .zbus_channel = INFUSE_ZBUS_CHAN_IMU_ACC_MAG, \
72 .state_size = sizeof(struct algorithm_stationary_windowed_data), \
73 .logging = \
74 { \
75 .loggers = loggers_, \
76 .tdf_mask = tdfs, \
77 }, \
78 }, \
79 .window_seconds = window_seconds_, \
80 .std_dev_threshold_ug = threshold_ug, \
81 }; \
82 static struct algorithm_stationary_windowed_data name##_data; \
83 static struct algorithm_runner_algorithm name = { \
84 .impl = algorithm_stationary_windowed_fn, \
85 .config = &name##_config.common, \
86 .runtime_state = &name##_data, \
87 }
88
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* INFUSE_SDK_INCLUDE_INFUSE_ALGORITHM_RUNNER_ALGORITHMS_STATIONARY_WINDOWED_H_ */
Infuse-IoT algorithm runner.
Infuse-IoT zbus channels.
void algorithm_stationary_windowed_fn(const struct zbus_channel *chan, const void *config, void *data)
Algorithm implementation, see algorithm_run_fn.
@ ALGORITHM_STATIONARY_WINDOWED_LOG_WINDOW_STD_DEV
Definition stationary_windowed.h:34
Infuse-IoT statistics helpers.
Definition runner.h:29
Definition stationary_windowed.h:37
uint32_t window_seconds
Duration of window to examine.
Definition stationary_windowed.h:41
uint32_t std_dev_threshold_ug
Definition stationary_windowed.h:43
struct algorithm_runner_common_config common
Definition stationary_windowed.h:39
Definition stationary_windowed.h:46
uint32_t window_end
Definition stationary_windowed.h:48
struct statistics_state stats
Definition stationary_windowed.h:47
uint32_t print_end
Definition stationary_windowed.h:49
Definition statistics.h:31