#pragma once

struct ORI_Data
{
  unsigned long Freq;
  //---
  struct { short Acc; short Bar; } Temp;
  //---
  struct { short X, Y, Z; } Acc;
  struct { short X, Y, Z; } Gyr;
  struct { short X, Y, Z; } Mag;
  //---
  struct { float Bar, Alt, Filt, Speed, Acc; } Bar;
  //---
  bool Upside = false;
  float Pitch, Roll, Yaw;
  float SinX, SinY, CosZ;
  //---
  struct { float X, Y, Z; } Iner;
  struct { float X, Y, Z; } Speed;
  struct { float X, Y, Z; } Pos;
};

extern ORI_Data DataORI;

void ORI_Init();
void ORI_Get(ORI_Data& Data, const unsigned long Freq, struct IMU_Data& IMU, struct BAR_Data BAR);

void ORI_TiltCompAcc(float Pitch, float Roll, short Acc[3], ORI_Data& Data);