-
Notifications
You must be signed in to change notification settings - Fork 7
/
BuckPSU.h
43 lines (34 loc) · 982 Bytes
/
BuckPSU.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
/**
* BuckPSU.h
* Library for interfacing with UART on Chinese DC-DC converters.
* Original work from Ben James (benjames.io)
*/
#ifndef BuckPSU_h
#define BuckPSU_h
#include "Arduino.h"
class BuckPSU
{
public:
BuckPSU(Stream &port);
void setVoltageMilliVolts(uint16_t millivolts);
void setCurrentMilliAmps(uint16_t milliamps);
void enableOutput(bool status);
void enableAuto(bool status);
void enableLock(bool status);
void enableDisplay(bool status);
void setMemory(int loc);
void getMemory(int loc);
uint16_t readVoltageMilliVolts();
uint16_t readCurrentMilliAmps();
uint16_t readSetMilliVolts();
uint16_t readSetMilliAmps();
uint16_t readTimer();
uint16_t readCapacity();
bool getOutputEnabled();
bool getAutoEnabled();
bool getLockEnabled();
private:
void intToFourCharStr(char *buf, uint16_t input);
Stream *_port;
};
#endif