FocControl.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /**
  2. ******************************************************************************
  3. * @file FocControl.h
  4. * @author Fortior Application Team
  5. * @version V1.0.0
  6. * @date 10-Apr-2017
  7. * @brief define motor contorl parameter
  8. ******************************************************************************
  9. */
  10. /* Define to prevent recursive inclusion -------------------------------------*/
  11. #ifndef __FOCCONTROL_H_
  12. #define __FOCCONTROL_H_
  13. /* Exported types ------------------------------------------------------------*/
  14. typedef enum
  15. {
  16. mcReady = 0,
  17. mcInit = 1,
  18. mcCharge = 2,
  19. mcTailWind = 3,
  20. mcPosiCheck = 4,
  21. mcAlign = 5,
  22. mcStart = 6,
  23. mcRun = 7,
  24. mcStop = 8,
  25. mcFault = 9,
  26. mcBrake = 10
  27. }MotStaType;
  28. typedef union
  29. {
  30. uint8 SetMode; // 整个配置模式使能位
  31. struct
  32. {
  33. uint8 CalibFlag :1; // 电流校准的标志位
  34. uint8 ChargeSetFlag :1; // 预充电配置标志位
  35. uint8 AlignSetFlag :1; // 预定位配置标志位
  36. uint8 TailWindSetFlag :1; // 顺逆风配置标志位
  37. uint8 StartSetFlag :1; // 启动配置标志位
  38. uint8 PosiCheckSetFlag :1; // 位置检测配置标志位
  39. } SetFlag;
  40. }MotStaM;
  41. typedef enum
  42. {
  43. PFCReady = 0,
  44. PFCInt = 1,
  45. PFCRun = 2,
  46. PFCStop = 3,
  47. PFCFault = 4
  48. }PFCStaType;
  49. /* Exported variables --------------------------------------------------------------------*/
  50. extern MotStaType mcState;
  51. extern MotStaM McStaSet;
  52. extern PFCStaType PFCState;
  53. /* Exported functions --------------------------------------------------------------------*/
  54. extern void MC_Control(void);
  55. extern void PFCRUN_Control(void);
  56. extern void McTailWindDealwith(void);
  57. extern void TailWindDealwith(void);
  58. extern void Motor_PllStart(void);
  59. #endif