AP_BattMonitor: Maxell driver inherits from SMBus_Generic

This commit is contained in:
Randy Mackay 2020-06-02 16:44:38 +09:00 committed by WickedShell
parent f869cd9aa6
commit 4ea565e4ed
4 changed files with 18 additions and 0 deletions

View File

@ -121,6 +121,12 @@ AP_BattMonitor::init()
hal.i2c_mgr->get_device(_params[instance]._i2c_bus, AP_BATTMONITOR_SMBUS_I2C_ADDR,
100000, true, 20));
break;
case AP_BattMonitor_Params::BattMonitor_TYPE_MAXELL:
_params[instance]._i2c_bus.set_default(AP_BATTMONITOR_SMBUS_BUS_EXTERNAL);
drivers[instance] = new AP_BattMonitor_SMBus_Maxell(*this, state[instance], _params[instance],
hal.i2c_mgr->get_device(_params[instance]._i2c_bus, AP_BATTMONITOR_SMBUS_I2C_ADDR,
100000, true, 20));
break;
case AP_BattMonitor_Params::BattMonitor_TYPE_SUI3:
_params[instance]._i2c_bus.set_default(AP_BATTMONITOR_SMBUS_BUS_INTERNAL),
drivers[instance] = new AP_BattMonitor_SMBus_SUI(*this, state[instance], _params[instance],

View File

@ -33,6 +33,7 @@ class AP_BattMonitor_Analog;
class AP_BattMonitor_SMBus;
class AP_BattMonitor_SMBus_Solo;
class AP_BattMonitor_SMBus_Generic;
class AP_BattMonitor_SMBus_Maxell;
class AP_BattMonitor_UAVCAN;
class AP_BattMonitor
@ -42,6 +43,7 @@ class AP_BattMonitor
friend class AP_BattMonitor_SMBus;
friend class AP_BattMonitor_SMBus_Solo;
friend class AP_BattMonitor_SMBus_Generic;
friend class AP_BattMonitor_SMBus_Maxell;
friend class AP_BattMonitor_UAVCAN;
friend class AP_BattMonitor_Sum;
friend class AP_BattMonitor_FuelFlow;

View File

@ -100,3 +100,4 @@ protected:
// include specific implementations
#include "AP_BattMonitor_SMBus_Solo.h"
#include "AP_BattMonitor_SMBus_Generic.h"
#include "AP_BattMonitor_SMBus_Maxell.h"

View File

@ -0,0 +1,9 @@
#pragma once
#include "AP_BattMonitor_SMBus_Generic.h"
class AP_BattMonitor_SMBus_Maxell : public AP_BattMonitor_SMBus_Generic
{
using AP_BattMonitor_SMBus_Generic::AP_BattMonitor_SMBus_Generic;
};