2023-01-25 00:37:02 -04:00
|
|
|
#pragma once
|
|
|
|
|
2023-03-06 22:02:49 -04:00
|
|
|
#include <AP_HAL/AP_HAL_Boards.h>
|
|
|
|
#include <AP_ESC_Telem/AP_ESC_Telem_config.h>
|
|
|
|
#include <AP_EFI/AP_EFI_config.h>
|
|
|
|
#include <AP_Generator/AP_Generator_config.h>
|
|
|
|
#include <AP_Torqeedo/AP_Torqeedo_config.h>
|
|
|
|
|
2023-06-20 03:08:14 -03:00
|
|
|
#ifndef AP_BATTERY_ENABLED
|
|
|
|
#define AP_BATTERY_ENABLED 1
|
|
|
|
#endif
|
|
|
|
|
2023-03-06 22:02:49 -04:00
|
|
|
#ifndef AP_BATTERY_BACKEND_DEFAULT_ENABLED
|
2023-06-20 03:08:14 -03:00
|
|
|
#define AP_BATTERY_BACKEND_DEFAULT_ENABLED AP_BATTERY_ENABLED
|
2023-03-06 22:02:49 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_ANALOG_ENABLED
|
|
|
|
#define AP_BATTERY_ANALOG_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_BEBOP_ENABLED
|
|
|
|
#define AP_BATTERY_BEBOP_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && (CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_EFI_ENABLED
|
|
|
|
#define AP_BATTERY_EFI_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && HAL_EFI_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_ESC_ENABLED
|
2023-03-09 23:00:01 -04:00
|
|
|
#define AP_BATTERY_ESC_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && HAL_WITH_ESC_TELEM
|
2023-03-06 22:02:49 -04:00
|
|
|
#endif
|
|
|
|
|
2023-08-09 21:21:43 -03:00
|
|
|
#ifndef AP_BATTERY_ESC_TELEM_OUTBOUND_ENABLED
|
|
|
|
#define AP_BATTERY_ESC_TELEM_OUTBOUND_ENABLED 0
|
|
|
|
#endif
|
|
|
|
|
2023-11-21 15:21:18 -04:00
|
|
|
#ifndef AP_BATTERY_WATT_MAX_ENABLED
|
|
|
|
#define AP_BATTERY_WATT_MAX_ENABLED AP_BATTERY_ENABLED
|
|
|
|
#endif
|
|
|
|
|
2023-03-06 22:02:49 -04:00
|
|
|
#ifndef AP_BATTERY_SMBUS_ENABLED
|
|
|
|
#define AP_BATTERY_SMBUS_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_UAVCAN_BATTERYINFO_ENABLED
|
2023-04-08 01:09:10 -03:00
|
|
|
#define AP_BATTERY_UAVCAN_BATTERYINFO_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && HAL_ENABLE_DRONECAN_DRIVERS
|
2023-03-06 22:02:49 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_FUELFLOW_ENABLED
|
|
|
|
#define AP_BATTERY_FUELFLOW_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && (BOARD_FLASH_SIZE > 1024)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_FUELLEVEL_PWM_ENABLED
|
|
|
|
#define AP_BATTERY_FUELLEVEL_PWM_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && (BOARD_FLASH_SIZE > 1024)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_FUELLEVEL_ANALOG_ENABLED
|
|
|
|
#define AP_BATTERY_FUELLEVEL_ANALOG_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && (BOARD_FLASH_SIZE > 1024)
|
2023-01-25 00:37:02 -04:00
|
|
|
#endif
|
|
|
|
|
2023-03-06 22:02:49 -04:00
|
|
|
#ifndef AP_BATTERY_GENERATOR_ENABLED
|
|
|
|
#define AP_BATTERY_GENERATOR_ENABLED HAL_GENERATOR_ENABLED
|
2023-01-25 00:37:02 -04:00
|
|
|
#endif
|
|
|
|
|
2023-03-06 22:02:49 -04:00
|
|
|
#ifndef AP_BATTERY_INA239_ENABLED
|
|
|
|
#define AP_BATTERY_INA239_ENABLED 0 // SPI device must be specified in hwdef
|
2023-01-25 00:37:02 -04:00
|
|
|
#endif
|
|
|
|
|
2023-03-06 22:02:49 -04:00
|
|
|
#ifndef AP_BATTERY_INA2XX_ENABLED
|
|
|
|
#define AP_BATTERY_INA2XX_ENABLED (AP_BATTERY_BACKEND_DEFAULT_ENABLED && (BOARD_FLASH_SIZE > 1024))
|
2023-01-25 00:37:02 -04:00
|
|
|
#endif
|
|
|
|
|
2023-03-06 22:02:49 -04:00
|
|
|
#ifndef AP_BATTERY_LTC2946_ENABLED
|
|
|
|
#define AP_BATTERY_LTC2946_ENABLED (AP_BATTERY_BACKEND_DEFAULT_ENABLED && defined(HAL_BATTMON_LTC2946_BUS) && defined(HAL_BATTMON_LTC2946_ADDR))
|
2023-01-25 00:37:02 -04:00
|
|
|
#endif
|
|
|
|
|
2023-03-06 22:02:49 -04:00
|
|
|
#ifndef AP_BATTERY_SYNTHETIC_CURRENT_ENABLED
|
|
|
|
#define AP_BATTERY_SYNTHETIC_CURRENT_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED
|
2023-01-25 00:42:24 -04:00
|
|
|
#endif
|
2023-03-06 22:02:49 -04:00
|
|
|
|
|
|
|
#ifndef AP_BATTERY_SMBUS_SOLO_ENABLED
|
|
|
|
#define AP_BATTERY_SMBUS_SOLO_ENABLED 0 // turned on in hwdefs
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_SUM_ENABLED
|
2024-09-23 08:40:04 -03:00
|
|
|
#define AP_BATTERY_SUM_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && (BOARD_FLASH_SIZE > 1024)
|
2023-03-06 22:02:49 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_TORQEEDO_ENABLED
|
|
|
|
#define AP_BATTERY_TORQEEDO_ENABLED HAL_TORQEEDO_ENABLED
|
|
|
|
#endif
|
|
|
|
|
2023-10-26 03:22:24 -03:00
|
|
|
#ifndef AP_BATTERY_AD7091R5_ENABLED
|
|
|
|
#define AP_BATTERY_AD7091R5_ENABLED AP_BATTERY_BACKEND_DEFAULT_ENABLED && (BOARD_FLASH_SIZE > 1024)
|
|
|
|
#endif
|
2023-03-06 22:02:49 -04:00
|
|
|
|
|
|
|
// SMBus-subclass backends:
|
|
|
|
#ifndef AP_BATTERY_SMBUS_GENERIC_ENABLED
|
|
|
|
#define AP_BATTERY_SMBUS_GENERIC_ENABLED AP_BATTERY_SMBUS_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_SMBUS_NEODESIGN_ENABLED
|
|
|
|
#define AP_BATTERY_SMBUS_NEODESIGN_ENABLED AP_BATTERY_SMBUS_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_SMBUS_SUI_ENABLED
|
|
|
|
#define AP_BATTERY_SMBUS_SUI_ENABLED AP_BATTERY_SMBUS_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// subclasses of the SUMbus generic backend:
|
|
|
|
#ifndef AP_BATTERY_SMBUS_MAXELL_ENABLED
|
|
|
|
#define AP_BATTERY_SMBUS_MAXELL_ENABLED AP_BATTERY_SMBUS_GENERIC_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_BATTERY_SMBUS_ROTOYE_ENABLED
|
|
|
|
#define AP_BATTERY_SMBUS_ROTOYE_ENABLED AP_BATTERY_SMBUS_GENERIC_ENABLED
|
|
|
|
#endif
|
|
|
|
|
2024-01-05 23:42:52 -04:00
|
|
|
#ifndef AP_BATTERY_SCRIPTING_ENABLED
|
|
|
|
#define AP_BATTERY_SCRIPTING_ENABLED (AP_SCRIPTING_ENABLED && AP_BATTERY_BACKEND_DEFAULT_ENABLED)
|
|
|
|
#endif
|