32 lines
1.0 KiB
C++
32 lines
1.0 KiB
C++
#pragma once
|
|
#include <stdint.h>
|
|
|
|
struct GaugeConfig {
|
|
// Hardware
|
|
uint8_t dirPin;
|
|
uint8_t stepPin;
|
|
int8_t enablePin; // -1 = no enable pin
|
|
bool dirInverted;
|
|
bool stepActiveHigh;
|
|
bool enableActiveLow;
|
|
|
|
// Motion defaults (integers; cast to float in setup())
|
|
long minPos;
|
|
long maxPos;
|
|
long homingBackoffSteps;
|
|
int maxSpeed; // steps/s
|
|
int accel; // steps/s²
|
|
int homingSpeed; // steps/s
|
|
};
|
|
|
|
constexpr GaugeConfig gaugeConfigs[] = {
|
|
// dir step en dirInv stepHi enLow min max backoff speed accel homeSpd
|
|
{ 48, 49, -1, false, true, true, 0, 3780, 3800, 4000, 6000, 500 },
|
|
{ 8, 9, -1, true, true, true, 0, 3780, 3800, 4000, 6000, 500 },
|
|
{ 52, 53, -1, false, true, true, 0, 3780, 3800, 4000, 6000, 500 },
|
|
{ 50, 51, -1, false, true, true, 0, 3780, 3800, 4000, 6000, 500 },
|
|
};
|
|
|
|
static const uint8_t GAUGE_COUNT =
|
|
sizeof(gaugeConfigs) / sizeof(gaugeConfigs[0]);
|