2021-01-04 22:59:19 -04:00
|
|
|
#include "SIM_SMBusDevice.h"
|
2020-10-20 19:41:31 -03:00
|
|
|
|
2020-11-11 00:03:49 -04:00
|
|
|
#pragma once
|
|
|
|
|
2020-10-20 19:41:31 -03:00
|
|
|
namespace SITL {
|
|
|
|
|
2021-01-04 22:59:19 -04:00
|
|
|
class SMBusBattDevReg : public SMBusRegEnum {
|
2020-10-20 19:41:31 -03:00
|
|
|
public:
|
|
|
|
static const uint8_t TEMP = 0x08; // Temperature
|
|
|
|
static const uint8_t VOLTAGE = 0x09; // Voltage
|
|
|
|
static const uint8_t CURRENT = 0x0A; // Current
|
|
|
|
static const uint8_t REMAINING_CAPACITY = 0x0F; // Remaining Capacity
|
2021-03-16 02:02:25 -03:00
|
|
|
static const uint8_t FULL_CHARGE_CAPACITY = 0x10; // Full Charge Capacity (accounting for battery degradation)
|
2020-10-20 19:41:31 -03:00
|
|
|
static const uint8_t CYCLE_COUNT = 0x17; // Cycle Count
|
2021-03-16 02:02:25 -03:00
|
|
|
static const uint8_t DESIGN_CAPACITY = 0x18; // Design capacity (capacity when newly manufactured)
|
|
|
|
static const uint8_t DESIGN_VOLTAGE = 0x19; // Design voltage
|
2020-10-20 19:41:31 -03:00
|
|
|
static const uint8_t SPECIFICATION_INFO = 0x1A; // Specification Info
|
2021-03-16 02:02:25 -03:00
|
|
|
static const uint8_t MANUFACTURE_DATE = 0x1B; // Manufacture date
|
2020-10-20 19:41:31 -03:00
|
|
|
static const uint8_t SERIAL = 0x1C; // Serial Number
|
|
|
|
static const uint8_t MANUFACTURE_NAME = 0x20; // Manufacture Name
|
2021-01-04 22:59:19 -04:00
|
|
|
static const uint8_t DEVICE_NAME = 0x21; // Device Name
|
2021-03-16 02:02:25 -03:00
|
|
|
static const uint8_t DEVICE_CHEMISTRY = 0x22; // Battery chemistry type
|
2020-10-20 19:41:31 -03:00
|
|
|
static const uint8_t MANUFACTURE_DATA = 0x23; // Manufacture Data
|
|
|
|
};
|
|
|
|
|
2021-01-04 22:59:19 -04:00
|
|
|
class SIM_BattMonitor_SMBus : public SMBusDevice
|
2020-10-20 19:41:31 -03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
SIM_BattMonitor_SMBus();
|
|
|
|
|
|
|
|
virtual void update(const class Aircraft &aircraft) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
uint32_t last_update_ms;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace SITL
|