You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

65 line
1.5 KiB

  1. #ifndef PLSR_INTERNAL_H
  2. #define PLSR_INTERNAL_H
  3. #include <stdint.h>
  4. #define PLSR_SEGMENT_COUNT_MAX (10U)
  5. #define PLSR_FINITE_PROFILE_PULSE_LIMIT (1000U)
  6. #define PLSR_PLATFORM_FINITE_STEP_MAX \
  7. (PLSR_SEGMENT_COUNT_MAX + 2U * PLSR_FINITE_PROFILE_PULSE_LIMIT)
  8. #define PLSR_FREQUENCY_MAX_HZ (100000UL)
  9. #define PLSR_OUTPUT_PULSE_DIR (0U)
  10. #define PLSR_OUTPUT_AB (1U)
  11. typedef enum
  12. {
  13. PLSR_EXEC_IDLE = 0,
  14. PLSR_EXEC_STREAM,
  15. PLSR_EXEC_AB_LEGACY
  16. } PLSR_EXEC_MODE;
  17. typedef struct
  18. {
  19. uint32_t frequencyHz;
  20. int32_t pulses;
  21. uint16_t waitType;
  22. uint16_t waitTimeMs;
  23. uint16_t actTimeMs;
  24. uint16_t jumpSegment;
  25. } PLSR_SEGMENT_CONFIG;
  26. typedef struct
  27. {
  28. uint16_t pulseOutput;
  29. uint16_t directionOutput;
  30. uint16_t waitInput;
  31. uint16_t extInput;
  32. uint16_t sendMode;
  33. uint16_t directionDelayMs;
  34. uint16_t directionNegativeLogic;
  35. uint16_t curveMode;
  36. uint16_t positionMode;
  37. uint16_t segmentCount;
  38. uint16_t startSegment;
  39. uint32_t defaultSpeedHz;
  40. uint32_t startSpeedHz;
  41. uint32_t stopSpeedHz;
  42. uint16_t accelerationTimeMs;
  43. uint16_t decelerationTimeMs;
  44. PLSR_SEGMENT_CONFIG segments[PLSR_SEGMENT_COUNT_MAX];
  45. /* Kept at the end so version-2 persisted configurations remain a prefix. */
  46. uint16_t outputMode;
  47. } PLSR_CONFIG;
  48. typedef struct
  49. {
  50. PLSR_CONFIG config;
  51. int32_t position;
  52. uint8_t positionValid;
  53. uint8_t wasBusy;
  54. uint16_t reserved;
  55. } PLSR_PERSIST_PAYLOAD;
  56. #endif /* PLSR_INTERNAL_H */