Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
movement_threshold.h
Go to the documentation of this file.
1
15
16#ifndef INFUSE_SDK_INCLUDE_INFUSE_ALGORITHM_RUNNER_ALGORITHMS_MOVEMENT_THRESHOLD_H_
17#define INFUSE_SDK_INCLUDE_INFUSE_ALGORITHM_RUNNER_ALGORITHMS_MOVEMENT_THRESHOLD_H_
18
19#include <stdint.h>
20
21#include <zephyr/toolchain.h>
22
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
35
43
45void algorithm_movement_threshold_fn(const struct zbus_channel *chan,
46 const struct algorithm_runner_common_config *common,
47 const void *args, void *data);
48
57#define ALGORITHM_MOVEMENT_THRESHOLD_DEFINE(name, moving_for_, initial_threshold_ug_, \
58 continue_threshold_ug_) \
59 static const struct algorithm_runner_common_config name##_config = { \
60 .algorithm_id = 0x15F20002, \
61 .zbus_channel = INFUSE_ZBUS_CHAN_IMU_ACC_MAG, \
62 .arguments_size = sizeof(struct kv_alg_movement_threshold_args_v2), \
63 .state_size = sizeof(struct algorithm_movement_threshold_data), \
64 .arguments_kv_key = KV_KEY_ALG_MOVEMENT_THRESHOLD_ARGS_V2, \
65 }; \
66 static struct kv_alg_movement_threshold_args_v2 name##_default_args = { \
67 .logging = {0}, \
68 .args = \
69 { \
70 .moving_for = moving_for_, \
71 .initial_threshold_ug = initial_threshold_ug_, \
72 .continue_threshold_ug = continue_threshold_ug_, \
73 }, \
74 }; \
75 static struct algorithm_movement_threshold_data name##_data; \
76 static struct algorithm_runner_algorithm name = { \
77 .impl = algorithm_movement_threshold_fn, \
78 .config = &name##_config, \
79 .arguments = &name##_default_args, \
80 .runtime_state = &name##_data, \
81 }
82
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif /* INFUSE_SDK_INCLUDE_INFUSE_ALGORITHM_RUNNER_ALGORITHMS_MOVEMENT_THRESHOLD_H_ */
Infuse-IoT algorithm runner.
Infuse-IoT zbus channels.
void algorithm_movement_threshold_fn(const struct zbus_channel *chan, const struct algorithm_runner_common_config *common, const void *args, void *data)
Algorithm implementation, see algorithm_run_fn.
Definition movement_threshold.h:36
uint32_t continue_threshold_low
Definition movement_threshold.h:39
uint32_t continue_threshold_high
Definition movement_threshold.h:40
uint32_t initial_threshold_high
Definition movement_threshold.h:38
uint8_t full_scale_range
Definition movement_threshold.h:41
uint32_t initial_threshold_low
Definition movement_threshold.h:37
Definition runner.h:31