Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
movement_threshold APIs

Movement Threshold API. More...

Data Structures

struct  algorithm_movement_threshold_data

Macros

#define ALGORITHM_MOVEMENT_THRESHOLD_DEFINE(name, moving_for_, initial_threshold_ug_, continue_threshold_ug_)
 Statically define an instance of the movement threshold algorithm.

Functions

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.

Detailed Description

Movement Threshold API.

Macro Definition Documentation

◆ ALGORITHM_MOVEMENT_THRESHOLD_DEFINE

#define ALGORITHM_MOVEMENT_THRESHOLD_DEFINE ( name,
moving_for_,
initial_threshold_ug_,
continue_threshold_ug_ )

#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/algorithm_runner/algorithms/movement_threshold.h>

Value:
static const struct algorithm_runner_common_config name##_config = { \
.algorithm_id = 0x15F20002, \
.zbus_channel = INFUSE_ZBUS_CHAN_IMU_ACC_MAG, \
.arguments_size = sizeof(struct kv_alg_movement_threshold_args_v2), \
.state_size = sizeof(struct algorithm_movement_threshold_data), \
}; \
static struct kv_alg_movement_threshold_args_v2 name##_default_args = { \
.logging = {0}, \
.args = \
{ \
.moving_for = moving_for_, \
.initial_threshold_ug = initial_threshold_ug_, \
.continue_threshold_ug = continue_threshold_ug_, \
}, \
}; \
static struct algorithm_movement_threshold_data name##_data; \
static struct algorithm_runner_algorithm name = { \
.config = &name##_config, \
.arguments = &name##_default_args, \
.runtime_state = &name##_data, \
}
@ KV_KEY_ALG_MOVEMENT_THRESHOLD_ARGS_V2
Configuration for the 'Movement Threshold' algorithm.
Definition kv_types.h:644
@ INFUSE_ZBUS_CHAN_IMU_ACC_MAG
Data type: imu_magnitude_array.
Definition channels.h:55
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
Definition runner.h:31
Configuration for the 'Movement Threshold' algorithm.
Definition kv_types.h:498

Statically define an instance of the movement threshold algorithm.

Parameters
nameVariable name base
moving_for_How long the moving state is set for
initial_threshold_ug_Magnitude this far away from 1G triggers the moving state
continue_threshold_ug_Magnitude this far away from 1G continues the moving state

Function Documentation

◆ algorithm_movement_threshold_fn()

void algorithm_movement_threshold_fn ( const struct zbus_channel * chan,
const struct algorithm_runner_common_config * common,
const void * args,
void * data )