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

tilt API More...

Data Structures

struct  algorithm_tilt_data

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 algorithm_runner_common_config *common, const void *args, void *data)
 Algorithm implementation, see algorithm_run_fn.

Detailed Description

tilt API

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 const struct algorithm_runner_common_config name##_config = { \
.algorithm_id = 0x15F20001, \
.zbus_channel = INFUSE_ZBUS_CHAN_IMU, \
.arguments_size = sizeof(struct kv_alg_tilt_args), \
.state_size = sizeof(struct algorithm_tilt_data), \
.arguments_kv_key = KV_KEY_ALG_TILT_ARGS, \
}; \
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 struct algorithm_tilt_data name##_data; \
static struct algorithm_runner_algorithm name = { \
.impl = algorithm_tilt_fn, \
.config = &name##_config, \
.arguments = &name##_default_args, \
.runtime_state = &name##_data, \
}
@ KV_KEY_ALG_TILT_ARGS
Configuration for the 'Tilt' algorithm.
Definition kv_types.h:640
@ INFUSE_ZBUS_CHAN_IMU
Data type: imu_sample_array.
Definition channels.h:53
void algorithm_tilt_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 runner.h:31
Definition tilt.h:38
Configuration for the 'Tilt' algorithm.
Definition kv_types.h:482

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 algorithm_runner_common_config * common,
const void * args,
void * data )