soft_motor_output.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef __SOFT_MOTOR_OUTPUT_H
  2. #define __SOFT_MOTOR_OUTPUT_H
  3. #include <stdbool.h>
  4. #include <stdint.h>
  5. enum
  6. {
  7. MOTOR1 = 1,
  8. MOTOR2 = 2,
  9. MOTOR3 = 3,
  10. MOTOR4 = 4,
  11. MOTOR5 = 5,
  12. MOTOR6 = 6,
  13. MOTOR7 = 7,
  14. MOTOR8 = 8,
  15. MOTOR9 = 9,
  16. MOTOR10 = 10,
  17. };
  18. // I型四轴
  19. enum
  20. {
  21. FOUR_I4 = 41,
  22. // X型四轴
  23. FOUR_X4 = 42,
  24. // I型六轴
  25. SIX_I6 = 61,
  26. // X型六轴
  27. SIX_X6 = 62,
  28. //跟DJI一致的倒Y6,I型三轴六桨
  29. THREE_YI6D = 63,
  30. //跟DJI一致的Y6,Y型三轴六桨
  31. THREE_Y6D = 64,
  32. // H6 型
  33. SIX_H6 = 65,
  34. // I型八轴
  35. EIGHT_I8 = 81,
  36. // X型八轴
  37. EIGHT_X8 = 82,
  38. //跟MWC一致的4x8,四轴八桨
  39. FOUR_X8M = 83,
  40. //跟DJI一致的4x8,四轴八桨
  41. FOUR_X8D = 84,
  42. // 跟MWC 相反的 4x8, 四轴八桨
  43. FOUR_X8MR = 85,
  44. // 跟 DJI 相反的 4x8, 四轴八桨
  45. FOUR_X8DR = 86,
  46. };
  47. /*-------------functions ---------------------------------------*/
  48. void set_motor_pwm(uint8_t s_ch, uint16_t s_pwm);
  49. uint16_t get_motor_pwm(uint8_t s_ch);
  50. void MotorCheck_SetCheckNum(uint8_t checkChNum);
  51. void motor_output_initial(void);
  52. void esc_calibrate_enable(void);
  53. void unlocked_motor_output(void);
  54. void locked_motor_output(void);
  55. uint8_t MotorOutput_GetYawRestrictionStatus(void);
  56. uint8_t Motor_GetFailsafeNum(void);
  57. extern float pid_roll, pid_pitch, pid_thr, pid_yaw;
  58. #endif