ESP8266 part of the f105-motor-demo project (see f105-motor-demo_stm32)
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.
 
 
 
 
 
 
f105-motor-demo_esp/user/reporting.h

45 lines
743 B

#ifndef REPORTING_H
#define REPORTING_H
#include <esp8266.h>
typedef struct {
// 0
bool enabled : 4;
// 4
uint32_t interval;
// 8
enum {
RPT_XIVELY,
RPT_THINGSPEAK
} service : 4;
// 12
char feed[64];
// 76
char key[64];
// 80
uint32_t magic;
} ReportingCfg;
/** Comapre result is stored here */
typedef struct {
bool ready : 4;
float deviation;
float rms;
} ReportingResult;
extern ReportingResult rpt_result;
/** Reporting config struct */
extern ReportingCfg rpt_conf;
/** Save reporting config to flash */
void reporting_save(void);
/** Load the reporting config from flash */
void reporting_load(void);
/** Immediately send report to xively / thingspeak */
void reporting_send_now(void);
#endif // REPORTING_H