#include "intrinsics_56800E.h" 
#include "types.h" 

typedef struct
{
	Frac16 	eps;
	short	state;
} sRelay;

extern sRelay srelPsi, srelT;

//header file for function 'DTC.c'
short  c_relay(Frac16 DeltaPsi, sRelay *srel);
asm short a_relay(short DeltaPsi, sRelay *srel);

short c_doublerelay(Frac16 DeltaT, sRelay *sdoubrel);
asm short a_doublerelay(short DeltaT, sRelay *sdoubrel);

short c_sectorselector(short Psi_s[]);
asm short a_sectorselector(short Psi_s[]);

Frac32 c_torqueestimated(Frac16 i_s[],Frac16 Psi_s[]);
asm Frac32 a_torqueestimated(Frac16 i_s[],Frac16 Psi_s[]);

Frac16 c_modulepsis(Frac16 Psi_s[]);
asm Frac16 a_modulepsis(Frac16 Psi_s[]);

Frac16 c_modulei(Frac16 i_s[]);
asm Frac16 a_modulei(Frac16 i_s[]);

void c_switchingtable(short suma_s_x,short *u_a,short *u_b,short *u_c);
