#ifndef _FOC_H_
#define _FOC_H_

#include "main.h"

#define  Ts   2880

#define TIM4_CCR1  TIM4->CCR1
#define TIM4_CCR2  TIM4->CCR2
#define TIM4_CCR3  TIM4->CCR3



/**************************** 变量声明 **************************************/


enum 
{
	SECTOR_1 = 3,
	SECTOR_2 = 1,
	SECTOR_3 = 5,
	SECTOR_4 = 4,
	SECTOR_5 = 6,
	SECTOR_6 = 2,
	SECTOR_ERR = 0
};

typedef struct 
{
	int Tccr_a;
	int Tccr_b;
	int Tccr_c;
	
	float    ang;
	float    rad_ang;

	float  SPWM_K;
}SVPWM;



extern SVPWM  svpwm;

extern int SPWM_count1,SPWM_count2,SPWM_count3;

/**************************** 函数声明 *************************************/
void open_test(void);
void SVPWM_Init(void);
void ChaBiaoSPWM(float UabcVpp_out);







#endif



