mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 03:21:35 +08:00
Adding BatMon smart battery as a module and refactoring SMBUS based SBS 1.1 spec to a library
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2020 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2012-2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -537,7 +537,7 @@ $ batt_smbus -X write_flash 19069 2 27 0
|
||||
I2CSPIDriverBase *BATT_SMBUS::instantiate(const BusCLIArguments &cli, const BusInstanceIterator &iterator,
|
||||
int runtime_instance)
|
||||
{
|
||||
SMBus *interface = new SMBus(iterator.bus(), cli.i2c_address);
|
||||
SMBus *interface = new SMBus(DRV_BAT_DEVTYPE_SMBUS, iterator.bus(), cli.i2c_address);
|
||||
if (interface == nullptr) {
|
||||
PX4_ERR("alloc failed");
|
||||
return nullptr;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2018 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2012-2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -118,11 +118,10 @@ using namespace time_literals;
|
||||
#define BATT_SMBUS_ENABLED_PROTECTIONS_A_DEFAULT 0xcf
|
||||
#define BATT_SMBUS_ENABLED_PROTECTIONS_A_CUV_DISABLED 0xce
|
||||
|
||||
|
||||
enum class SMBUS_DEVICE_TYPE {
|
||||
UNDEFINED = 0,
|
||||
BQ40Z50 = 1,
|
||||
BQ40Z80 = 2,
|
||||
UNDEFINED = 0,
|
||||
BQ40Z50 = 1,
|
||||
BQ40Z80 = 2,
|
||||
};
|
||||
|
||||
class BATT_SMBUS : public I2CSPIDriver<BATT_SMBUS>
|
||||
|
||||
Reference in New Issue
Block a user