-
Notifications
You must be signed in to change notification settings - Fork 0
/
BQ24160.h
40 lines (34 loc) · 991 Bytes
/
BQ24160.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
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Wire.h>
#define BQ24160_ADDRESS (0x6B)
#define BQ24160_STATUS (0x00)
#define BQ24160_SUPPLY (0x01)
#define BQ24160_CONTROL (0x02)
#define BQ24160_BATTERY (0x03)
#define BQ24160_PART (0x04)
#define BQ24160_CHARGE (0x05)
#define BQ24160_DPPM (0x06)
#define BQ24160_SAF_NTC (0x07)
#define SPEED 100000
#define LENGTH 8
enum Timers{
TIMER_27MIN,
TIMER_6HR,
TIMER_9HR,
TIMER_DISABLE
};
class BQ24160{
public:
void begin(void);//begin BQ24160
void resetWD(void);//reset watch dog timer
void setBatVolt(byte reg);//Set battery charge voltage, refer datasheet
void setReg(byte addr, byte val);//Set value for any register
void getAll(void);//print all current settings
void safetyTimer(Timers time);//safety timer option
void rechargeEvent(void);//call when need to initiate a new charging cycle
void resetAll(void);//reset all settings to default
};