ESP_IOT v2.5
IOT ESP Coding
AtomSocket.h
Go to the documentation of this file.
1
2#ifndef ATOMSOCKET_H_
3#define ATOMSOCKET_H_
4//#include "M5Atom.h"
5#include "../../Defines.h"
6
7#ifdef ATOM_SOCKET_MODULE
8
9class ATOMSOCKET {
10public:
11 void Init(HardwareSerial& SerialData, int _RelayIO, int _RXD);
12 void setVF(float Data);
13 void setCF(float Data);
14 void SerialReadLoop();
15 void SetPowerOn();
16 void SetPowerOff();
17 float GetVol();
18 float GetVolAnalog();
19 float GetCurrent();
20 float GetCurrentAnalog();
21 float GetActivePower();
22 float GetInspectingPower();
23 float GetPowerFactor();
24 uint16_t GetPF();
25 uint32_t GetPFAll();
26 float GetKWh();
27
28 byte SerialTemps[24];
29 byte SeriaDataLen = 0;
30 bool SerialRead = 0;
31
32 uint32_t VolPar;
33 uint32_t CurrentPar;
34 uint32_t PowerPar;
35 uint32_t CurrentData;
36 float VF;
37 float CF;
38
39private:
40 HardwareSerial* AtomSerial;
41 bool Checksum();
42
43 int RelayIO;
44 int RXD;
45 uint8_t SysStatus;
46
47 uint32_t VolData;
48
49 uint32_t PowerData;
50 uint16_t PF;
51 uint32_t PFData = 1;
52 uint32_t VolR1 = 1880000;
53 uint32_t VolR2 = 1000;
54 float CurrentRF = 0.001;
55};
56
57#endif //ATOM_SOCKET_MODULE
58#endif
float GetInspectingPower()
Definition: AtomSocket.cpp:114
float GetCurrent()
Definition: AtomSocket.cpp:92
void SetPowerOff()
Definition: AtomSocket.cpp:25
float GetActivePower()
Definition: AtomSocket.cpp:103
void SetPowerOn()
Definition: AtomSocket.cpp:21
uint32_t CurrentPar
Definition: AtomSocket.h:33
float GetVol()
Definition: AtomSocket.cpp:81
void setVF(float Data)
Definition: AtomSocket.cpp:29
float GetVolAnalog()
Definition: AtomSocket.cpp:86
float CF
Definition: AtomSocket.h:37
void Init(HardwareSerial &SerialData, int _RelayIO, int _RXD)
from: https://github.com/m5stack/M5Atom/blob/master/examples/ATOM_BASE/ATOM_Socket/AtomSocket....
Definition: AtomSocket.cpp:6
byte SerialTemps[24]
Definition: AtomSocket.h:28
bool SerialRead
Definition: AtomSocket.h:30
float GetKWh()
Definition: AtomSocket.cpp:134
uint32_t CurrentData
Definition: AtomSocket.h:35
float VF
Definition: AtomSocket.h:36
uint16_t GetPF()
Definition: AtomSocket.cpp:126
uint32_t VolPar
Definition: AtomSocket.h:32
byte SeriaDataLen
Definition: AtomSocket.h:29
float GetPowerFactor()
Definition: AtomSocket.cpp:120
uint32_t PowerPar
Definition: AtomSocket.h:34
float GetCurrentAnalog()
Definition: AtomSocket.cpp:97
void SerialReadLoop()
Definition: AtomSocket.cpp:37
void setCF(float Data)
Definition: AtomSocket.cpp:33
uint32_t GetPFAll()
Definition: AtomSocket.cpp:130