-
Notifications
You must be signed in to change notification settings - Fork 0
/
HS_Atlas.h
75 lines (65 loc) · 1.81 KB
/
HS_Atlas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef HS_Atlas_h
#define HS_Atlas_h
#include <logger_SD.h>
#define SerialDO Serial2
#define SerialCond Serial3
#define DO_POWER_PIN 48
#define COND_POWER_PIN 46
// Log levels
#define DEBUG 0
#define INFO 1
#define WARN 2
#define ERROR 3
#define CRITICAL 4
/*----------( Forward Declarations (?) )----------*/
bool recentSample(char time[7], int16_t fresh_time);
/*----------( Structures )----------*/
//typedef struct DO_Struct {
struct DO_Struct {
char _version;
bool return_sat;
float _sat;
char saturation[10]; // Ends in \0
float _dox;
char dox[10]; // Ends in \0
char sample_time[7]; // HHmmss\0
char comm_error;
};
//typedef struct CondStruct {
struct CondStruct {
float _ec;
float _tds;
float _sal;
float _sg;
char ec[10]; // Ends in \0
char tds[10];
char sal[10]; // Ends in \0
char sg[10]; // Ends in \0
char sample_time[7]; // HHmmss\0
char comm_error;
};
/*----------( Function Prototypes )----------*/
//logger Logger_SD;
void initDO();
void setDO_version(struct DO_Struct *aDO,char ver);// Either '5', '6', or 'E' for EZO
bool _getDO(struct DO_Struct *aDO);
bool getDO(struct DO_Struct *aDO);
void setDOtemp_cond(float temp_C,float cond);
bool getContDO(struct DO_Struct *aDO);
uint16_t clearDObuffer(bool verbose);
bool getCompDO(struct DO_Struct *aDO,struct CondStruct *aCond,float temp_C);
bool getBasicDO(struct DO_Struct *aDO);
void toggleDOSat();
void quietDO();
void setDOContinuous();
void initCond(struct CondStruct *aCond);
bool _getCond(struct CondStruct *aCond);
void setCondTemp(float temp_C);
bool getCond(struct CondStruct *aCond);
void quietCond();
void setCondContinuous();
#endif
/*----------( Constants )----------*/
const char DO_SINGLE_SAMPLE[] = "R\n";
const char DO_QUIET[] = "E\n";
const char DO_CONTINUOUS[] = "C\n";