smbus.h 983 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef _SMBUS_H
#define _SMBUS_H

#include "i2c.h"
#include "mem.h"

// SMBUS commands
#define Temperature                0x08
#define Voltage                    0x09
#define Current                    0x0a
#define AverageCurrent             0x0b
#define RelativeStateOfCharge      0x0d
#define AbsoluteStateOfCharge      0x0e
#define RemainingCapacity          0x0f
#define FullChargeCapacity         0x10
#define RunTimeToEmpty             0x11
#define AverageTimeToEmpty         0x12
#define AverageTimeToFull          0x13
#define ChargingCurrent            0x14
#define ChargingVoltage            0x15
21
#define BatteryStatus              0x16
22
23
#define DesignCapacity             0x18
#define DesignVoltage              0x19
24
#define PackStatus                 0x2f
25
26
27
28
29
30
31
32
33
#define VCELL4                     0x3c
#define VCELL3                     0x3d
#define VCELL2                     0x3e
#define VCELL1                     0x3f

void smbus_init(void);
void smbus_loop(void);

#endif