Encode.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef USER_ENCODE_H
  2. #define USER_ENCODE_H
  3. #define X30EXTI_IOIN PDin(13)
  4. #define X31EXTI_IOIN PDin(12)
  5. #define X20EXTI_IOIN PDin(0)
  6. typedef struct
  7. {
  8. long cRealPosi;
  9. } cEncodeAxis_t;
  10. int GetEncodeCount(void);
  11. void SetEncodeCount(int encodepulse);
  12. void EncoderInit(void);
  13. extern float BMGearRatio,BM_SEVORGearRatio;
  14. extern long GetEncodePos(void);
  15. extern void SetEncodePos(long pos);
  16. extern cEncodeAxis_t cEncodeAxis;
  17. extern long axis_position_encode;//编码器方式计数
  18. //机器配置
  19. extern unsigned char USE_ENCODE;
  20. extern unsigned char USE_X30_EXTI;
  21. extern unsigned char USE_X31_EXTI;
  22. extern unsigned char USE_X20_EXTI;
  23. extern unsigned char USE_TIMER_X30_EXTI;
  24. extern unsigned char USE_TIMER_X31_EXTI;
  25. extern unsigned char USE_EXTEND_INOUTPUT;
  26. extern unsigned char USE_EXTEND_ALARM;
  27. extern unsigned long EXTI_TIMER_FREQ;
  28. extern unsigned char FILTER_P;
  29. extern unsigned char FILTER_N;
  30. //0配置高速接口上升沿中断,1为下降沿,3为上下沿中断
  31. extern unsigned char X30EXTI_DIR;
  32. extern unsigned char X31EXTI_DIR;
  33. extern unsigned char X20EXTI_DIR;
  34. extern void EXTI30Enable(void);
  35. extern void EXTI30Disable(void);
  36. extern void EXTI20Enable(void);
  37. extern void EXTI20Disable(void);
  38. #endif