forked from winginitau/VictronVEDirectArduino
-
Notifications
You must be signed in to change notification settings - Fork 1
/
VEDirect.h
50 lines (38 loc) · 901 Bytes
/
VEDirect.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
/******************************************************************
VEDirect Arduino
Copyright 2018, 2019, Brendan McLearie
Distributed under MIT license - see LICENSE.txt
See README.md
File: VEDirect.h
- Class / enums / API
******************************************************************/
#ifndef VEDIRECT_H_
#define VEDIRECT_H_
#include <Arduino.h>
#define VED_LINE_SIZE 20 // Seems to be plenty. VE.Direc protocol could change.
enum VE_DIRECT_DATA {
VE_SOC = 0,
VE_VOLTAGE,
VE_POWER,
VE_CURRENT,
VE_POWER_PV,
VE_VOLTAGE_PV,
VE_YIELD_TOTAL,
VE_YIELD_TODAY,
VE_YIELD_YESTERDAY,
VE_POWER_MAX_TODAY,
VE_POWER_MAX_YESTERDAY,
VE_ERROR,
VE_STATE
};
class VEDirect {
private:
HardwareSerial& VESerial;
public:
VEDirect(HardwareSerial& port);
virtual ~VEDirect();
uint8_t begin();
int32_t read(uint8_t target);
void copy_raw_to_serial0();
};
#endif /* VEDIRECT_H_ */