diff options
author | Josh Allen <axlecrusher@gmail.com> | 2017-02-11 20:56:50 -0500 |
---|---|---|
committer | Josh Allen <axlecrusher@gmail.com> | 2017-02-11 20:56:50 -0500 |
commit | c04c9fb7dcf80123edec53a2e6709bb128548a73 (patch) | |
tree | 650fa2b1780536eaf69c348cec674df96bc930e3 /tools/ootx_decode/ootx_decoder.h | |
parent | aab9f4f1db0dd752a00f3ae67531f1d58b9e2980 (diff) | |
download | libsurvive-c04c9fb7dcf80123edec53a2e6709bb128548a73.tar.gz libsurvive-c04c9fb7dcf80123edec53a2e6709bb128548a73.tar.bz2 |
add lighthouse_info_v6
Diffstat (limited to 'tools/ootx_decode/ootx_decoder.h')
-rw-r--r-- | tools/ootx_decode/ootx_decoder.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/ootx_decode/ootx_decoder.h b/tools/ootx_decode/ootx_decoder.h index 13f14d6..c7cf55c 100644 --- a/tools/ootx_decode/ootx_decoder.h +++ b/tools/ootx_decode/ootx_decoder.h @@ -28,6 +28,33 @@ typedef struct { } ootx_decoder_context; +typedef float float16; + +typedef struct { + uint16_t fw_version;//Firmware version (bit 15..6), protocol version (bit 5..0) + uint32_t id; //Unique identifier of the base station + float16 fcal_0_phase; //"phase" for rotor 0 + float16 fcal_1_phase; //"phase" for rotor 1 + float16 fcal_0_tilt; //"tilt" for rotor 0 + float16 fcal_1_tilt; //"tilt" for rotor 1 + uint8_t sys_unlock_count; //Lowest 8 bits of the rotor desynchronization counter + uint8_t hw_version; //Hardware version + float16 fcal_0_curve; //"curve" for rotor 0 + float16 fcal_1_curve; //"curve" for rotor 1 + int8_t accel_dir_x; //"orientation vector" + int8_t accel_dir_y; //"orientation vector" + int8_t accel_dir_z; //"orientation vector" + float16 fcal_0_gibphase; //"gibbous phase" for rotor 0 (normalized angle) + float16 fcal_1_gibphase; //"gibbous phase" for rotor 1 (normalized angle) + float16 fcal_0_gibmag; //"gibbous magnitude" for rotor 0 + float16 fcal_1_gibmag; //"gibbous magnitude" for rotor 1 + uint8_t mode_current; //Currently selected mode (default: 0=A, 1=B, 2=C) + uint8_t sys_faults; //"fault detect flags" (should be 0) +} lighthouse_info_v6; + +void init_lighthouse_info_v6(lighthouse_info_v6* lhi, uint8_t* data); +void print_lighthouse_info_v6(lighthouse_info_v6* lhi); + //void ootx_init_buffer(); void ootx_process_bit(ootx_decoder_context *ctx, uint32_t length); void ootx_init_decoder_context(ootx_decoder_context *ctx); |