10#include "Fusion/Fusion.h"
11#include "dawn/io/ddata.hxx"
12#include "dawn/prog/common.hxx"
27 PROG_AHRS_CFG_FIRST = 0,
28 PROG_AHRS_CFG_ACCEL = 1,
29 PROG_AHRS_CFG_GYRO = 2,
30 PROG_AHRS_CFG_OUTPUT = 3,
31 PROG_AHRS_CFG_PARAMS = 4,
32 PROG_AHRS_CFG_MAG = 5,
33 PROG_AHRS_CFG_LAST = 31
39 uint32_t accel_rejection;
40 uint32_t recovery_period;
42 }
typedef SProgAhrsParams;
47#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
48 const char *getClassNameStr()
const override
75 return CProgAhrs::cfgId(
false, 1, PROG_AHRS_CFG_ACCEL);
80 return CProgAhrs::cfgId(
false, 1, PROG_AHRS_CFG_GYRO);
85 return CProgAhrs::cfgId(
false, 1, PROG_AHRS_CFG_MAG);
90 return CProgAhrs::cfgId(
false, 1, PROG_AHRS_CFG_OUTPUT);
95 return CProgAhrs::cfgId(rw,
sizeof(SProgAhrsParams) / 4, PROG_AHRS_CFG_PARAMS);
131 static int accelNotifierCb(
void *priv,
io_ddata_t *data);
132 static int gyroNotifierCb(
void *priv,
io_ddata_t *data);
133 static int magNotifierCb(
void *priv,
io_ddata_t *data);
137 void applySettings();
139 static bool paramsValid(
float gain,
float rejection,
float period,
float rate);
Descriptor wrapper for individual object configuration.
Base class for all I/O objects.
AHRS sensor fusion (x-io Fusion): accel + gyro IOs in, world-frame linear acceleration (gravity remov...
int init()
One-time initialize object after bindings are resolved.
int doStart()
Start implementation hook.
bool hasThread() const
Check if a background thread is active.
int deinit()
De-initialize object.
int onSetObjConfig(SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
Pre-update hook for runtime configuration writes.
int configure()
Configure object from descriptor data.
int doStop()
Stop implementation hook.
Base class for all PROG (processing) objects.
static ObjectCfgId objectCfg(uint8_t type, uint16_t cls, uint8_t dtype, bool rw, uint16_t size, uint8_t id)
Construct 32-bit ConfigID from component fields.
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
Out-of-tree user-extension hooks for Dawn.
@ OBJTYPE_PROG
Program/algorithm object type.
@ DTYPE_ANY
Wildcard data type (matches any actual type).
uint32_t ObjectId
ObjectID type - single 32-bit value.
static ObjectId objectId(uint8_t type, uint16_t cls, uint8_t dtype, uint8_t flags, uint16_t priv)
Construct 32-bit ObjectID from component fields.
Heap-allocated dynamic I/O data buffer.