2017-10-27 02:36:49 -03:00
# pragma once
# include <AP_Param/AP_Param.h>
2023-08-09 21:21:43 -03:00
# include "AP_BattMonitor_config.h"
2017-10-27 02:36:49 -03:00
class AP_BattMonitor_Params {
public :
static const struct AP_Param : : GroupInfo var_info [ ] ;
AP_BattMonitor_Params ( void ) ;
/* Do not allow copies */
2022-09-30 06:50:43 -03:00
CLASS_NO_COPY ( AP_BattMonitor_Params ) ;
2017-10-27 02:36:49 -03:00
// low voltage sources (used for BATT_LOW_TYPE parameter)
enum BattMonitor_LowVoltage_Source {
BattMonitor_LowVoltageSource_Raw = 0 ,
BattMonitor_LowVoltageSource_SagCompensated = 1
} ;
2024-08-07 03:10:07 -03:00
enum class Options : uint16_t {
2021-12-01 21:30:13 -04:00
Ignore_UAVCAN_SoC = ( 1U < < 0 ) , // Ignore UAVCAN State-of-Charge (charge %) supplied value from the device and use the internally calculated one
MPPT_Use_Input_Value = ( 1U < < 1 ) , // MPPT reports voltage and current from Input (usually solar panel) instead of the output
MPPT_Power_Off_At_Disarm = ( 1U < < 2 ) , // MPPT Disabled when vehicle is disarmed, if HW supports it
MPPT_Power_On_At_Arm = ( 1U < < 3 ) , // MPPT Enabled when vehicle is armed, if HW supports it
MPPT_Power_Off_At_Boot = ( 1U < < 4 ) , // MPPT Disabled at startup (aka boot), if HW supports it
MPPT_Power_On_At_Boot = ( 1U < < 5 ) , // MPPT Enabled at startup (aka boot), if HW supports it. If Power_Off_at_Boot is also set, the behavior is Power_Off_at_Boot
2022-03-19 04:09:45 -03:00
GCS_Resting_Voltage = ( 1U < < 6 ) , // send resistance resting voltage to GCS
2023-10-24 18:31:50 -03:00
AllowSplitAuxInfo = ( 1U < < 7 ) , // allow different node to provide aux info for DroneCAN
2024-08-07 03:10:07 -03:00
InternalUseOnly = ( 1U < < 8 ) , // for use internally to ArduPilot, not to be (eg.) sent via MAVLink BATTERY_STATUS
2024-09-24 23:11:37 -03:00
Minimum_Voltage = ( 1U < < 9 ) , // sum monitor measures minimum voltage rather than average
2020-12-07 01:30:23 -04:00
} ;
2017-10-27 02:36:49 -03:00
2021-02-01 12:26:26 -04:00
BattMonitor_LowVoltage_Source failsafe_voltage_source ( void ) const { return ( enum BattMonitor_LowVoltage_Source ) _failsafe_voltage_source . get ( ) ; }
2017-10-27 02:36:49 -03:00
2017-11-09 18:33:44 -04:00
AP_Int32 _pack_capacity ; /// battery pack capacity less reserve in mAh
AP_Int32 _serial_number ; /// battery serial number, automatically filled in on SMBus batteries
AP_Float _low_voltage ; /// voltage level used to trigger a low battery failsafe
AP_Float _low_capacity ; /// capacity level used to trigger a low battery failsafe
AP_Float _critical_voltage ; /// voltage level used to trigger a critical battery failsafe
AP_Float _critical_capacity ; /// capacity level used to trigger a critical battery failsafe
2018-09-12 19:26:39 -03:00
AP_Int32 _arming_minimum_capacity ; /// capacity level required to arm
AP_Float _arming_minimum_voltage ; /// voltage level required to arm
2020-12-07 01:30:23 -04:00
AP_Int32 _options ; /// Options
2023-11-21 15:21:18 -04:00
# if AP_BATTERY_WATT_MAX_ENABLED
2021-06-17 15:28:26 -03:00
AP_Int16 _watt_max ; /// max battery power allowed. Reduce max throttle to reduce current to satisfy t his limit
2023-11-21 15:21:18 -04:00
# endif
2021-06-17 15:28:26 -03:00
AP_Int8 _type ; /// 0=disabled, 3=voltage only, 4=voltage and current
AP_Int8 _low_voltage_timeout ; /// timeout in seconds before a low voltage event will be triggered
AP_Int8 _failsafe_voltage_source ; /// voltage type used for detection of low voltage event
AP_Int8 _failsafe_low_action ; /// action to preform on a low battery failsafe
AP_Int8 _failsafe_critical_action ; /// action to preform on a critical battery failsafe
2023-08-09 21:21:43 -03:00
# if AP_BATTERY_ESC_TELEM_OUTBOUND_ENABLED
AP_Int8 _esc_telem_outbound_index ; /// bitmask of ESCs to forward voltage, current, consumption and temperature to.
# endif
2017-10-27 02:36:49 -03:00
} ;