26#define TLM_SYNC0 0xA5u
27#define TLM_SYNC1 0x5Au
28#define TLM_TYPE_STATE 0x01u
29#define TLM_TYPE_INIT 0x02u
30#define TLM_TYPE_STATUS 0x03u
31#define TLM_TYPE_REPLAY 0x04u
32#define TLM_OVERHEAD 6u
35#define TLM_F_RUNNING 0x01u
36#define TLM_F_MAG_NEW 0x02u
37#define TLM_F_ACC_GATED 0x04u
38#define TLM_F_MAG_GATED 0x08u
39#define TLM_F_OVERRUN 0x10u
40#define TLM_F_STILL 0x20u
42#define TLM_I_EST_BIAS 0x01u
43#define TLM_I_ADAPTIVE 0x02u
44#define TLM_I_TILT_COMP 0x04u
45#define TLM_I_DECOUPLE 0x08u
46#define TLM_I_RESET_JAC 0x10u
47#define TLM_I_TANGENT 0x20u
77 float infl_max, lockout_p_bump, persist_decay, persist_ratio, persist_min;
90 uint32_t n_gyro,
n_acc, n_mag, n_mag_dup, n_sh_nack;
104#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
105_Static_assert(
sizeof(
tlm_state_t) == 71,
"tlm_state_t layout");
106_Static_assert(
sizeof(
tlm_init_t) == 137,
"tlm_init_t layout");
107_Static_assert(
sizeof(
tlm_status_t) == 62,
"tlm_status_t layout");
114#define TLM_REPLAY_TAIL 60u
115#define TLM_REPLAY_MAX (6u + 140u + TLM_REPLAY_TAIL)
116#define TLM_FRAME_MAX (TLM_REPLAY_MAX + TLM_OVERHEAD)
118uint16_t
tlm_crc16(
const uint8_t *data,
size_t len);
120size_t tlm_encode(uint8_t type,
const void *payload, uint8_t len, uint8_t *out,
size_t cap);
uint16_t seq
filter sample index (0 = initial state R0)
uint32_t t_us
filter time: sum of the dt actually used
uint8_t running
1 = filter running
uint32_t proc_cyc_max
max CPU cycles of est_process
uint32_t irq_count
INT1 interrupts received
uint16_t ble_mtu
ATT_MTU in use
uint32_t uart_drop
frames not sent (UART DMA busy)
uint16_t words_max
max words read in one interrupt
uint32_t tlm_drop
frames lost on the telemetry queue
uint16_t calib_count
calibration samples collected
uint32_t ble_drop
frames not queued for BLE (link too slow)
uint32_t fifo_ovr
reads truncated to IMU_FIFO_MAX_WORDS
uint32_t bus_err
I2C errors (FIFO status or DMA burst)
int8_t imu_init
1 = in progress, 0 = OK, <0 = imu_status_t
uint8_t ble_err
last BLE stack error code (0 = none)
size_t tlm_encode(uint8_t type, const void *payload, uint8_t len, uint8_t *out, size_t cap)
Writes the complete frame into out; returns its length, 0 if cap is too small.
uint16_t tlm_crc16(const uint8_t *data, size_t len)