|
- #ifndef PLSR_INTERNAL_H
- #define PLSR_INTERNAL_H
-
- #include <stdint.h>
-
- #define PLSR_SEGMENT_COUNT_MAX (10U)
- #define PLSR_FINITE_PROFILE_PULSE_LIMIT (1000U)
- #define PLSR_PLATFORM_FINITE_STEP_MAX \
- (PLSR_SEGMENT_COUNT_MAX + 2U * PLSR_FINITE_PROFILE_PULSE_LIMIT)
- #define PLSR_FREQUENCY_MAX_HZ (100000UL)
-
- #define PLSR_OUTPUT_PULSE_DIR (0U)
- #define PLSR_OUTPUT_AB (1U)
-
- typedef enum
- {
- PLSR_EXEC_IDLE = 0,
- PLSR_EXEC_STREAM,
- PLSR_EXEC_AB_LEGACY
- } PLSR_EXEC_MODE;
-
- typedef struct
- {
- uint32_t frequencyHz;
- int32_t pulses;
- uint16_t waitType;
- uint16_t waitTimeMs;
- uint16_t actTimeMs;
- uint16_t jumpSegment;
- } PLSR_SEGMENT_CONFIG;
-
- typedef struct
- {
- uint16_t pulseOutput;
- uint16_t directionOutput;
- uint16_t waitInput;
- uint16_t extInput;
- uint16_t sendMode;
- uint16_t directionDelayMs;
- uint16_t directionNegativeLogic;
- uint16_t curveMode;
- uint16_t positionMode;
- uint16_t segmentCount;
- uint16_t startSegment;
- uint32_t defaultSpeedHz;
- uint32_t startSpeedHz;
- uint32_t stopSpeedHz;
- uint16_t accelerationTimeMs;
- uint16_t decelerationTimeMs;
- PLSR_SEGMENT_CONFIG segments[PLSR_SEGMENT_COUNT_MAX];
- /* Kept at the end so version-2 persisted configurations remain a prefix. */
- uint16_t outputMode;
- } PLSR_CONFIG;
-
- typedef struct
- {
- PLSR_CONFIG config;
- int32_t position;
- uint8_t positionValid;
- uint8_t wasBusy;
- uint16_t reserved;
- } PLSR_PERSIST_PAYLOAD;
-
- #endif /* PLSR_INTERNAL_H */
|