Stato di partenza prima dei fix. Il repo git era inizializzato a meta' (config.lock + objects/ mancante, zero commit): riparato. my_config.h (UID reale, tutti e 3 i sottoprogetti) escluso via .gitignore; aggiunto my_config.h.example. .pio/ escluso. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
1.3 KiB
C++
33 lines
1.3 KiB
C++
// ============================================================
|
|
// Ltm - encoder Lightweight Telemetry (LTM v2)
|
|
// Layout fedele a iNavFlight/inav src/main/telemetry/ltm.c
|
|
//
|
|
// Frame: '$' 'T' <code> <payload...> <crc>
|
|
// code = 'G' | 'A' | 'S' | ...
|
|
// crc = XOR dei soli byte di payload (dopo il code), little-endian.
|
|
// Letto passivamente da mwp (mwptools) e altri GCS.
|
|
// ============================================================
|
|
#pragma once
|
|
#include <Arduino.h>
|
|
|
|
namespace Ltm {
|
|
|
|
// G-frame (GPS): lat/lon in deg*1e7, gs in m/s, alt in cm,
|
|
// sats = numero satelliti, fix = 1(no) 2(2D) 3(3D).
|
|
// out deve essere >= 18 byte. Ritorna i byte scritti.
|
|
size_t gframe(uint8_t* out, int32_t lat, int32_t lon,
|
|
uint8_t gs_mps, int32_t alt_cm, uint8_t sats, uint8_t fix);
|
|
|
|
// A-frame (Attitude): pitch/roll/heading in gradi interi.
|
|
// out >= 10 byte.
|
|
size_t aframe(uint8_t* out, int16_t pitch, int16_t roll, int16_t heading);
|
|
|
|
// S-frame (Status): vbat in mV, current/mAh, rssi 0-255,
|
|
// airspeed m/s, flightmode 0-19, statemode bit0=armed bit1=failsafe.
|
|
// out >= 11 byte.
|
|
size_t sframe(uint8_t* out, uint16_t vbat_mv, uint16_t current,
|
|
uint8_t rssi, uint8_t airspeed,
|
|
uint8_t flightmode, uint8_t statemode);
|
|
|
|
} // namespace Ltm
|