Brewery-Controller/boil_kettle/globals.h

74 lines
1.1 KiB
C

#ifndef GLOBALS_h
#define GLOBALS_h
const uint8_t CompileTimeP[] PROGMEM = __DATE__ " " __TIME__;
const size_t ConfAddress = sizeof(CompileTimeP);
void ConnectMQTT();
static void SendSensorData();
void MessageReceived(char*, byte*, unsigned int);
char* ShowKettleState();
char* ShowKettleSetting();
void doEncoder();
void UpdateBoilKettle();
struct Vessel {
char name[16];
char setpoint[20];
char sensor[20];
double Rref;
double RNominal;
};
struct Topic {
char root[10];
Vessel mash;
Vessel boil;
};
struct Mqtt {
IPAddress broker;
char user[10];
char password[21];
Topic topic;
};
struct ConfigData {
Mqtt mqtt;
byte mac[6];
IPAddress ip;
int interval;
int period;
uint8_t threshold;
uint8_t hysteresis;
};
uint8_t KettleDuty = 0;
bool SettingChanged = false;
const int UpdateInterval = 5000;
unsigned long lastRun = 0;
// Pin Definitions
#ifndef I_CLK
#define I_CLK 2
#endif
#ifndef I_DT
#define I_DT 3
#endif
#ifndef I_BTN
#define I_BTN 4
#endif
#ifndef O_PWM
#define O_PWM 5
#endif
#ifndef I_CS1
#define I_CS1 47
#endif
#ifndef I_CS2
#define I_CS2 48
#endif
#endif