Line data Source code
1 : #pragma once 2 : 3 : #include <AP_Param/AP_Param.h> 4 : #include "AP_BattMonitor_config.h" 5 : 6 : class AP_BattMonitor_Params { 7 : public: 8 : static const struct AP_Param::GroupInfo var_info[]; 9 : 10 : AP_BattMonitor_Params(void); 11 : 12 : /* Do not allow copies */ 13 : CLASS_NO_COPY(AP_BattMonitor_Params); 14 : 15 : enum class Type { 16 : NONE = 0, 17 : ANALOG_VOLTAGE_ONLY = 3, 18 : ANALOG_VOLTAGE_AND_CURRENT = 4, 19 : SOLO = 5, 20 : BEBOP = 6, 21 : SMBus_Generic = 7, 22 : UAVCAN_BatteryInfo = 8, 23 : BLHeliESC = 9, 24 : Sum = 10, 25 : FuelFlow = 11, 26 : FuelLevel_PWM = 12, 27 : SUI3 = 13, 28 : SUI6 = 14, 29 : NeoDesign = 15, 30 : MAXELL = 16, 31 : GENERATOR_ELEC = 17, 32 : GENERATOR_FUEL = 18, 33 : Rotoye = 19, 34 : // 20 was MPPT_PacketDigital 35 : INA2XX = 21, 36 : LTC2946 = 22, 37 : Torqeedo = 23, 38 : FuelLevel_Analog = 24, 39 : Analog_Volt_Synthetic_Current = 25, 40 : INA239_SPI = 26, 41 : EFI = 27, 42 : AD7091R5 = 28, 43 : Scripting = 29, 44 : INA3221 = 30, 45 : ANALOG_CURRENT_ONLY = 31, 46 : TIBQ76952_I2C = 32, 47 : }; 48 : 49 : // low voltage sources (used for BATT_LOW_TYPE parameter) 50 : enum BattMonitor_LowVoltage_Source { 51 : BattMonitor_LowVoltageSource_Raw = 0, 52 : BattMonitor_LowVoltageSource_SagCompensated = 1 53 : }; 54 : enum class Options : uint16_t { 55 : Ignore_UAVCAN_SoC = (1U<<0), // Ignore UAVCAN State-of-Charge (charge %) supplied value from the device and use the internally calculated one 56 : MPPT_Use_Input_Value = (1U<<1), // MPPT reports voltage and current from Input (usually solar panel) instead of the output 57 : MPPT_Power_Off_At_Disarm = (1U<<2), // MPPT Disabled when vehicle is disarmed, if HW supports it 58 : MPPT_Power_On_At_Arm = (1U<<3), // MPPT Enabled when vehicle is armed, if HW supports it 59 : MPPT_Power_Off_At_Boot = (1U<<4), // MPPT Disabled at startup (aka boot), if HW supports it 60 : 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 61 : GCS_Resting_Voltage = (1U<<6), // send resistance resting voltage to GCS 62 : AllowSplitAuxInfo = (1U<<7), // allow different node to provide aux info for DroneCAN 63 : InternalUseOnly = (1U<<8), // for use internally to ArduPilot, not to be (eg.) sent via MAVLink BATTERY_STATUS 64 : Minimum_Voltage = (1U<<9), // sum monitor measures minimum voltage rather than average 65 : AllowDynamicNodeUpdate = (1U<<10), // allow dynamic update of DroneCAN node ID during hot-swap when telemetry is lost 66 : }; 67 : 68 950634 : BattMonitor_LowVoltage_Source failsafe_voltage_source(void) const { return (enum BattMonitor_LowVoltage_Source)_failsafe_voltage_source.get(); } 69 : 70 : AP_Int32 _pack_capacity; /// battery pack capacity less reserve in mAh 71 : AP_Int32 _serial_number; /// battery serial number, automatically filled in on SMBus batteries 72 : AP_Float _low_voltage; /// voltage level used to trigger a low battery failsafe 73 : AP_Float _low_capacity; /// capacity level used to trigger a low battery failsafe 74 : AP_Float _critical_voltage; /// voltage level used to trigger a critical battery failsafe 75 : AP_Float _critical_capacity; /// capacity level used to trigger a critical battery failsafe 76 : AP_Int32 _arming_minimum_capacity; /// capacity level required to arm 77 : AP_Float _arming_minimum_voltage; /// voltage level required to arm 78 : AP_Int32 _options; /// Options 79 : #if AP_BATTERY_WATT_MAX_ENABLED 80 : AP_Int16 _watt_max; /// max battery power allowed. Reduce max throttle to reduce current to satisfy t his limit 81 : #endif 82 : AP_Enum<Type> _type; /// 0=disabled, 3=voltage only, 4=voltage and current 83 : AP_Int8 _low_voltage_timeout; /// timeout in seconds before a low voltage event will be triggered 84 : AP_Int8 _failsafe_voltage_source; /// voltage type used for detection of low voltage event 85 : AP_Int8 _failsafe_low_action; /// action to preform on a low battery failsafe 86 : AP_Int8 _failsafe_critical_action; /// action to preform on a critical battery failsafe 87 : #if AP_BATTERY_ESC_TELEM_OUTBOUND_ENABLED 88 : AP_Int8 _esc_telem_outbound_index; /// bitmask of ESCs to forward voltage, current, consumption and temperature to. 89 : #endif 90 : };