#ifndef _struct_
#define _struct_
//struct.h
/*
The datatype Akku is used to store all readable parameters
*/
typedef struct{
unsigned int RemainingCapacityAlarm; //UNIT: mAh, 10mWh
unsigned int RemainingTimeAlarm; //UNIT: minutes
unsigned int BatteryMode; //UNIT: BIN
int AtRate; //UNIT: mA, 10mW 0021
unsigned int AtRateTimeToFull ; //UNIT: minutes
unsigned int AtRateTimeToEmpty ; //UNIT: minutes
boolean AtRateOK ; //UNIT: Boolean
unsigned int Temperature ; //UNIT: 0.1°K
unsigned int Voltage ; //UNIT: mV
int Current ; //UNIT: mA
int AverageCurrent ; //UNIT: mA
unsigned int MaxError ; //UNIT: percent
unsigned int RelativeStateOfCharge ; //UNIT: percent
unsigned int AbsoluteStateOfCharge ; //UNIT: percent
unsigned int RemainingCapacity ; //UNIT: mAh, 10mWh
unsigned int FullChargeCapacity ; //UNIT: mAh, 10mWh
unsigned int RunTimeToEmpty ; //UNIT: minutes
unsigned int AverageTimeToEmpty ; //UNIT: minutes
unsigned int AverageTimeToFull ; //UNIT: minutes
unsigned int ChargingCurrent ; //UNIT: mA
unsigned int ChargingVoltage ; //UNIT: mV
word BatteryStatus ; //UNIT: BIN
unsigned int CycleCount ; //UNIT: cycles
unsigned int DesignCapacity ; //UNIT: mAh, 10mWh
unsigned int DesignVoltage ; //UNIT: mV
unsigned int SpecificationInfo ; //UNIT: n/a
unsigned int ManufactureDate ; //UNIT: n/a
unsigned int SerialNumber ; //UNIT: integer
word PackConfigurationAndStatus; //UNIT: BIN
unsigned int VCELL4; //UNIT: mV
unsigned int VCELL3; //UNIT: mV
unsigned int VCELL2; //UNIT: mV
unsigned int VCELL1; //UNIT: mV
} Akku;
#endif
#ifndef _var_and_const_
#define _var_and_const_
//Variables.h
// --- I2C-adresses ---
const int BMS = B0001011; //Adresse PIC 14000 0x16
// --- I2C-commands for BQ2060 ----
const byte RemainingCapacityAlarm = 0x01; // SMBus ACCESS: read , UNIT: mAh, 10mWh
const byte RemainingTimeAlarm = 0x02; // SMBus ACCESS: read , UNIT: minutes
const byte BatteryMode = 0x03; // SMBus ACCESS: read , UNIT: BIN bit mapped
const byte AtRate = 0x04; // SMBus ACCESS: read , UNIT: mA, 10mW
const byte AtRateTimeToFull = 0x05 ; // SMBus ACCESS: read , UNIT: minutes
const byte AtRateTimeToEmpty = 0x06 ; // SMBus ACCESS: read , UNIT: minutes
const byte AtRateOK = 0x07 ; // SMBus ACCESS: read , UNIT: Boolean
const byte Temperature = 0x08 ; // SMBus ACCESS: read , UNIT: 0.1°K
const byte Voltage = 0x09 ; // SMBus ACCESS: read , UNIT: mV
const byte Current = 0x0a ; // SMBus ACCESS: read , UNIT: mA
const byte AverageCurrent = 0x0b ; // SMBus ACCESS: read , UNIT: mA
const byte MaxError = 0x0c ; // SMBus ACCESS: read , UNIT: percent
const byte RelativeStateOfCharge = 0x0d ; // SMBus ACCESS: read , UNIT: percent
const byte AbsoluteStateOfCharge = 0x0e ; // SMBus ACCESS: read , UNIT: percent
const byte RemainingCapacity = 0x0f ; // SMBus ACCESS: read , UNIT: mAh, 10mWh
const byte FullChargeCapacity = 0x10 ; // SMBus ACCESS: read , UNIT: mAh, 10mWh
const byte RunTimeToEmpty = 0x11 ; // SMBus ACCESS: read , UNIT: minutes
const byte AverageTimeToEmpty = 0x12 ; // SMBus ACCESS: read , UNIT: minutes
const byte AverageTimeToFull = 0x13 ; // SMBus ACCESS: read , UNIT: minutes
const byte ChargingCurrent = 0x14 ; // SMBus ACCESS: read , UNIT: mA
const byte ChargingVoltage = 0x15 ; // SMBus ACCESS: read , UNIT: mV
const byte BatteryStatus = 0x16 ; // SMBus ACCESS: read , UNIT: BIN bit mapped
const byte CycleCount = 0x17 ; // SMBus ACCESS: read , UNIT: cycles
const byte DesignCapacity = 0x18 ; // SMBus ACCESS: read , UNIT: mAh, 10mWh
const byte DesignVoltage = 0x19 ; // SMBus ACCESS: read , UNIT: mV
const byte SpecificationInfo = 0x1a ; // SMBus ACCESS: read , UNIT: bit mapped
const byte ManufactureDate = 0x1b ; // SMBus ACCESS: read , UNIT: n/a
const byte SerialNumber = 0x1c ; // SMBus ACCESS: read , UNIT: integer
const byte PackConfigurationAndStatus = 0x2f; // SMBus ACCESS: read , UNIT: BIN bit mapped
const byte VCELL4 = 0x3c; // SMBus ACCESS: read , UNIT: mV
const byte VCELL3 = 0x3d; // SMBus ACCESS: read , UNIT: mV
const byte VCELL2 = 0x3e; // SMBus ACCESS: read , UNIT: mV
const byte VCELL1 = 0x3f; // SMBus ACCESS: read , UNIT: mV
#endif