#ifndef SBLDC_H_
#define SBLDC_H_

#include <ap_int.h>

/*widths of data types*/
#define WIDTH_A 18
#define WIDTH_B 36
#define WIDTH_C 25





/*data types definition*/
/*inputs*/
typedef ap_fixed<WIDTH_A, 3, AP_RND_MIN_INF , AP_WRAP> MZ_type;
typedef ap_fixed<WIDTH_A, 1, AP_RND_MIN_INF , AP_WRAP> invSC_MZ_type;
typedef ap_fixed<WIDTH_A, 8, AP_RND_MIN_INF , AP_WRAP> U_type;
typedef ap_fixed<WIDTH_A, 1, AP_RND_MIN_INF , AP_WRAP> invSC_U_type;
typedef ap_ufixed<WIDTH_A, 0, AP_RND_MIN_INF , AP_WRAP> SC_LL_type;
typedef ap_ufixed<WIDTH_A, 0, AP_RND_MIN_INF , AP_WRAP> TSSC_TS_type;
typedef ap_ufixed<WIDTH_A, 0, AP_RND_MIN_INF , AP_WRAP> RSC_R_type;
typedef ap_ufixed<WIDTH_A, 0, AP_RND_MIN_INF , AP_WRAP> CESC_CE_type;
typedef ap_ufixed<WIDTH_A, 0, AP_RND_MIN_INF , AP_WRAP> SC_JJ_type;
typedef ap_ufixed<WIDTH_A, 0, AP_RND_MIN_INF , AP_WRAP> TSSC_TS2pi_type;
typedef ap_fixed<WIDTH_C, 11, AP_RND_MIN_INF , AP_WRAP> SC_W_type;
typedef ap_fixed<WIDTH_A, 8, AP_RND_MIN_INF , AP_WRAP> SC_I_type;
/*outputs*/
typedef ap_fixed<WIDTH_C, 3, AP_RND_MIN_INF , AP_WRAP> THETA_type;
typedef ap_fixed<WIDTH_C, 8, AP_RND_MIN_INF , AP_WRAP> VELOCITY_type;
typedef ap_fixed<WIDTH_C, 9, AP_RND_MIN_INF , AP_WRAP> CURRENT_type;
/*variables*/
typedef ap_fixed<WIDTH_C, 1, AP_RND_MIN_INF , AP_WRAP> VAR_type;
/*PI type*/
typedef ap_ufixed<WIDTH_A, 3> PI_type;

void SBLDC (MZ_type *MZ, MZ_type *MZ_reg, invSC_MZ_type invSC_MZ, U_type *U, U_type *U_reg, invSC_U_type invSC_U, SC_LL_type SC_LL,
		TSSC_TS_type TSSC_TS, RSC_R_type RSC_R, CESC_CE_type CESC_CE, SC_JJ_type SC_JJ,
		TSSC_TS2pi_type TSSC_TS2pi, THETA_type *theta, THETA_type *theta_reg, VELOCITY_type *velocity,
		VELOCITY_type *velocity_reg, CURRENT_type *current, CURRENT_type *current_reg, char *mux);


#endif
