driver.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. *********************************************************************************************************
  3. * xmk guide
  4. *
  5. * (c) Copyright 2016-2020, hualijidian.com
  6. * All Rights Reserved
  7. *
  8. * @file driver.h
  9. * @author eric
  10. * @brief
  11. * @date 2017��10��10��
  12. * @version V0.0.1
  13. *********************************************************************************************************
  14. */
  15. #ifndef __DRIVER_H_
  16. #define __DRIVER_H_
  17. #include "stdint.h"
  18. #include "env.h"
  19. void DRSetAction(uint8_t act);
  20. uint8_t drDirFbNav(void);
  21. uint8_t drDirLrNav(void);
  22. #define DR_HOME_PCT_DEG 1000
  23. #define DR_PER_DEG 10
  24. #define DRFAngle2Pulse(a) (Cfg.FStrPlsDeg * (DR_HOME_PCT_DEG + (a)))
  25. #define DRFPulse2Angle(p) ((p)/Cfg.FStrPlsDeg - DR_HOME_PCT_DEG)
  26. #define DRBAngle2Pulse(a) (Cfg.BStrPlsDeg * (DR_HOME_PCT_DEG + (a)))
  27. #define DRBPulse2Angle(p) ((p)/Cfg.BStrPlsDeg - DR_HOME_PCT_DEG)
  28. #endif /* __DRIVER_H_ */