ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
tlm_build.c File Reference

Note: fields of the packed structs are ALWAYS filled via memcpy from aligned local variables (see telemetry.h: unaligned VSTR -> HardFault). More...

#include "tlm_build.h"
#include "so3.h"
#include <string.h>
Include dependency graph for tlm_build.c:

Go to the source code of this file.

Macros

#define PUT(field, val)   do { v = (val); memcpy(&p.field, &v, sizeof v); } while (0)
 

Functions

size_t tlm_build_state (const est_t *e, uint8_t *frame, size_t cap)
 
size_t tlm_build_init (const est_t *e, float fs_state_hz, uint8_t *frame, size_t cap)
 
size_t tlm_build_replay (const est_t *e, uint8_t *frame, size_t cap)
 

Detailed Description

Note: fields of the packed structs are ALWAYS filled via memcpy from aligned local variables (see telemetry.h: unaligned VSTR -> HardFault).

Definition in file tlm_build.c.

Macro Definition Documentation

◆ PUT

#define PUT (   field,
  val 
)    do { v = (val); memcpy(&p.field, &v, sizeof v); } while (0)

Function Documentation

◆ tlm_build_state()

size_t tlm_build_state ( const est_t *  e,
uint8_t *  frame,
size_t  cap 
)

Definition at line 10 of file tlm_build.c.

References tlm_state_t::acc, tlm_state_t::bias, cap, tlm_state_t::flags, tlm_state_t::gyro, iekf_get_quat(), tlm_state_t::mag, tlm_state_t::q, tlm_state_t::seq, tlm_state_t::t_us, tlm_encode(), and TLM_TYPE_STATE.

Referenced by on_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tlm_build_init()

size_t tlm_build_init ( const est_t *  e,
float  fs_state_hz,
uint8_t *  frame,
size_t  cap 
)

◆ tlm_build_replay()

size_t tlm_build_replay ( const est_t *  e,
uint8_t *  frame,
size_t  cap 
)

Definition at line 63 of file tlm_build.c.

References cap, iekf_get_quat(), IEKF_NX, n, tlm_encode(), TLM_REPLAY_MAX, and TLM_TYPE_REPLAY.

Referenced by on_state().

Here is the call graph for this function:
Here is the caller graph for this function: