Initial commit: add stepper controller firmware
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
struct DeviceConfig {
|
||||
String name;
|
||||
String hostname;
|
||||
};
|
||||
|
||||
struct MotorConfig {
|
||||
long stepsPerRevolution;
|
||||
float maxSpeed;
|
||||
float acceleration;
|
||||
bool reverseDirection;
|
||||
bool holdPosition;
|
||||
};
|
||||
|
||||
struct WifiConfig {
|
||||
String ssid;
|
||||
String password;
|
||||
String apName;
|
||||
String apPassword;
|
||||
};
|
||||
|
||||
struct LimitConfig {
|
||||
bool enabled;
|
||||
int leftPin;
|
||||
int rightPin;
|
||||
bool activeHigh;
|
||||
};
|
||||
|
||||
struct AppConfig {
|
||||
DeviceConfig device;
|
||||
MotorConfig motor;
|
||||
WifiConfig wifi;
|
||||
LimitConfig limits;
|
||||
};
|
||||
|
||||
class ConfigManager {
|
||||
public:
|
||||
bool begin();
|
||||
bool load();
|
||||
bool save();
|
||||
void resetToDefaults();
|
||||
const AppConfig& get() const;
|
||||
AppConfig& mutableConfig();
|
||||
|
||||
private:
|
||||
AppConfig config_;
|
||||
};
|
||||
Reference in New Issue
Block a user