AfSTMV.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //********************************************************************************
  2. //
  3. // LC898212 Step Move header
  4. //
  5. // Program Name : AfSTMV.h
  6. // Design : Rex.Tang
  7. // History : First edition 2013.07.19 Rex.Tang
  8. //
  9. // Description : Interface Functions and Definations
  10. //********************************************************************************
  11. #ifndef __AFSTMV__
  12. #define __AFSTMV__
  13. //**************************
  14. // Definations
  15. //**************************
  16. // Convergence Judgement
  17. #define INI_MSSET_211 (unsigned char)0x00 // Initialize Value For [8Fh]
  18. #define CHTGX_THRESHOLD (unsigned short)0x0200 // Convergence Judge Threshold
  19. #define CHTGOKN_TIME (unsigned char)0x80 // 64 Sampling Time 1.365msec( EQCLK=12MHz )
  20. #define CHTGOKN_WAIT 3 // CHTGOKN_WAIT(3ms) > CHTGOKN_TIME(2.732msec) ( CHTGOKN_WAIT has to be longer than CHTGOKN_TIME)
  21. // StepMove
  22. #define STMV_SIZE (unsigned short)0x0180 // StepSize(MS1Z12)
  23. #define STMV_INTERVAL (unsigned char)0x01 // Step Interval(STMVINT)
  24. #define STMCHTG_ON (unsigned char)0x08 // STMVEN Register Set
  25. #define STMSV_ON (unsigned char)0x04
  26. #define STMLFF_ON (unsigned char)0x02
  27. #define STMVEN_ON (unsigned char)0x01
  28. #define STMCHTG_OFF (unsigned char)0x00
  29. #define STMSV_OFF (unsigned char)0x00
  30. #define STMLFF_OFF (unsigned char)0x00
  31. #define STMVEN_OFF (unsigned char)0x00
  32. #define STMCHTG_SET STMCHTG_ON // Convergence Judgement On
  33. #define STMSV_SET STMSV_ON // Setting Target Position = End Position
  34. #define STMLFF_SET STMLFF_OFF
  35. typedef struct STMVPAR {
  36. unsigned short UsSmvSiz ;
  37. unsigned char UcSmvItv ;
  38. unsigned char UcSmvEnb ;
  39. } stSmvPar ;
  40. /*====================================================================
  41. Interface functions (export)
  42. =====================================================================*/
  43. /* Step Move Parameter Setting Function */
  44. extern void StmvSet( stSmvPar ) ;
  45. /* Step Move to Target Positon Function */
  46. extern unsigned char StmvTo( short ) ;
  47. #endif /* __AFSTMV__ */