#ifndef __IMU_
#define __IMU_


#include <dsp.h>
#include  <libq.h>
#include "..\..\drivers\drv6DOF.h"

// Types
struct ww { int W0 ; int W1 ; } ;
union longww { long  WW ; struct ww _ ; } ;
typedef struct
   { 
	   fractional phi; // roll (d/dt =speed rate x axes)
	   fractional teta; // pitch (d/dt =speed rate y axes
	   fractional psi; // yaw (d/dt =speed rate z axes
	   fractional phiAccelero; // roll (d/dt =speed rate x axes)
	   fractional tetaAccelero; // pitch (d/dt =speed rate y axes


   } EulerAttitude;


   
extern Dof6Accelero accelero;

 void DCMupdate(fractional *);
void DCMtoEuler();
 void normalize(void);
fractional Tan4Quadrant(fractional ,fractional );
void VectorCross( fractional * , fractional *  , fractional *  );
fractional inverseSqrtNormApproximation(fractional vectnorm);
fractional MyVectorPower( int , fractional *);

extern fractional	R[];
extern fractional	Rtemp[];
#endif
