


#ifndef __DQ_ALPHABETA_H__
#define __DQ_ALPHABETA_H__

#include "IQmathLib.h"

typedef struct { _iq Ualpha; //phase A voltage, input
			 	 _iq Ubeta; //phase B voltage, input
				 _iq Tetta; //phase angle, input
				 _iq Ud; // axis d voltage, output
			 	 _iq Uq; // axis q voltage, output
				 void (*calc)(); // Pointer to calculation function
				 void (*calc2)(); // Pointer to calculation function. Like in MATLAB
				 void (*calc_cos)(); // Pointer to calculation function, Ualpha = Uq*Cos(Tetta)
				 }DQ_TO_ALPHABETA;





typedef DQ_TO_ALPHABETA *DQ_TO_ALPHABETA_handle;

#define DQ_TO_ALPHABETA_DEFAULTS { 0, \
						    0, \
						    0, \
						    0, \
						    0, \
						    (void (*)(Uint32))dq_to_alphabeta_calc, \
						    (void (*)(Uint32))dq_to_alphabeta_calc2, \
						    (void (*)(Uint32))dq_to_alphabeta_calc_cos \
						    } 


void dq_to_alphabeta_calc(DQ_TO_ALPHABETA_handle);
void dq_to_alphabeta_calc2(DQ_TO_ALPHABETA_handle);
void dq_to_alphabeta_calc_cos(DQ_TO_ALPHABETA_handle);

#endif // end __DQ_ALPHABETA_H__
