mirror of https://github.com/ArduPilot/ardupilot
AP_BattMonitor: Maxell battery on any I2C bus
This commit is contained in:
parent
30a0f22d13
commit
4192ec1700
|
@ -115,12 +115,12 @@ AP_BattMonitor::init()
|
|||
#if HAL_BATTMON_SMBUS_ENABLE
|
||||
case AP_BattMonitor_Params::BattMonitor_TYPE_SOLO:
|
||||
drivers[instance] = new AP_BattMonitor_SMBus_Solo(*this, state[instance], _params[instance],
|
||||
hal.i2c_mgr->get_device(AP_BATTMONITOR_SMBUS_BUS_INTERNAL, AP_BATTMONITOR_SMBUS_I2C_ADDR,
|
||||
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:
|
||||
drivers[instance] = new AP_BattMonitor_SMBus_Maxell(*this, state[instance], _params[instance],
|
||||
hal.i2c_mgr->get_device(AP_BATTMONITOR_SMBUS_BUS_EXTERNAL, AP_BATTMONITOR_SMBUS_I2C_ADDR,
|
||||
hal.i2c_mgr->get_device(_params[instance]._i2c_bus, AP_BATTMONITOR_SMBUS_I2C_ADDR,
|
||||
100000, true, 20));
|
||||
break;
|
||||
#endif // HAL_BATTMON_SMBUS_ENABLE
|
||||
|
|
|
@ -162,6 +162,13 @@ const AP_Param::GroupInfo AP_BattMonitor_Params::var_info[] = {
|
|||
// @User: Advanced
|
||||
AP_GROUPINFO("ARM_MAH", 19, AP_BattMonitor_Params, _arming_minimum_capacity, 0),
|
||||
|
||||
// @Param: BUS
|
||||
// @DisplayName: Battery monitor I2C bus number
|
||||
// @Description: Battery monitor I2C bus number
|
||||
// @Range: 0 3
|
||||
// @User: Standard
|
||||
AP_GROUPINFO("BUS", 20, AP_BattMonitor_Params, _i2c_bus, 0),
|
||||
|
||||
AP_GROUPEND
|
||||
|
||||
};
|
||||
|
|
|
@ -55,5 +55,5 @@ public:
|
|||
AP_Int8 _failsafe_critical_action; /// action to preform on a critical battery failsafe
|
||||
AP_Int32 _arming_minimum_capacity; /// capacity level required to arm
|
||||
AP_Float _arming_minimum_voltage; /// voltage level required to arm
|
||||
|
||||
AP_Int8 _i2c_bus; /// I2C bus number
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue