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

Tilt algorithm. More...

Macros

#define ALGORITHM_TILT_DEFINE(name, loggers_, tdfs, filter_alpha, one_g_valid_percent)
 Statically define an instance of the tilt algorithm.

Enumerations

enum  { ALGORITHM_TILT_LOG_ANGLE = BIT(0) }

Functions

void algorithm_tilt_fn (const struct zbus_channel *chan, const struct infuse_algorithm *algorithm, const void *args, void *data)
 Algorithm implementation, see algorithm_run_fn.

Detailed Description

Tilt algorithm.

Macro Definition Documentation

◆ ALGORITHM_TILT_DEFINE

#define ALGORITHM_TILT_DEFINE ( name,
loggers_,
tdfs,
filter_alpha,
one_g_valid_percent )

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

Value:
static void name##_wrapper(const struct zbus_channel *chan, \
const struct infuse_algorithm *algorithm, const void *args) \
{ \
static struct algorithm_tilt_data data; \
algorithm_tilt_fn(chan, algorithm, args, &data); \
} \
static struct kv_alg_tilt_args name##_default_args = { \
.logging = \
{ \
.loggers = loggers_, \
.tdf_mask = tdfs, \
}, \
.args = \
{ \
.iir_filter_alpha = filter_alpha, \
.one_g_percent = one_g_valid_percent, \
}, \
}; \
static const struct infuse_algorithm name = { \
.fn = name##_wrapper, \
.algorithm_id = 0x15F20001, \
.zbus_channel = INFUSE_ZBUS_CHAN_IMU, \
.arguments = &name##_default_args, \
.arguments_size = sizeof(struct kv_alg_tilt_args), \
.arguments_kv_key = KV_KEY_ALG_TILT_ARGS, \
}
@ KV_KEY_ALG_TILT_ARGS
Configuration for the 'Tilt' algorithm.
Definition kv_types.h:735
@ INFUSE_ZBUS_CHAN_IMU
Data type: imu_sample_array.
Definition types.h:54
Algorithm definition.
Definition implementation.h:47
uint32_t algorithm_id
Unique algorithm identifier.
Definition implementation.h:55
Configuration for the 'Tilt' algorithm.
Definition kv_types.h:562

Statically define an instance of the tilt algorithm.

Parameters
nameVariable name base
loggers_TDF loggers to log outputs to
tdfsTDFs to log
filter_alphaIIR filter alpha parameter
one_g_valid_percentAccelerometer magnitude must be with N percent of 1G to use for tilt

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Function Documentation

◆ algorithm_tilt_fn()

void algorithm_tilt_fn ( const struct zbus_channel * chan,
const struct infuse_algorithm * algorithm,
const void * args,
void * data )