2019-05-26 22:46:41 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AP_Common/AP_Common.h>
|
2021-06-20 03:02:12 -03:00
|
|
|
#include "GCS_MAVLink.h"
|
2019-05-26 22:46:41 -03:00
|
|
|
|
2023-01-10 08:29:23 -04:00
|
|
|
#define AP_PARAM_VEHICLE_NAME periph
|
|
|
|
|
2019-05-26 22:46:41 -03:00
|
|
|
// Global parameter class.
|
|
|
|
//
|
|
|
|
class Parameters {
|
|
|
|
public:
|
|
|
|
static const uint16_t k_format_version = 2;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
// Layout version number, always key zero.
|
|
|
|
//
|
|
|
|
k_param_format_version = 0,
|
|
|
|
k_param_gps,
|
|
|
|
k_param_compass,
|
|
|
|
k_param_can_node,
|
2021-04-30 22:36:42 -03:00
|
|
|
k_param_can_baudrate0,
|
2019-05-26 22:46:41 -03:00
|
|
|
k_param_baro,
|
2019-08-31 04:20:53 -03:00
|
|
|
k_param_buzz_volume,
|
2019-10-10 00:18:59 -03:00
|
|
|
k_param_led_brightness,
|
2019-10-03 08:02:56 -03:00
|
|
|
k_param_airspeed,
|
2019-10-19 01:36:14 -03:00
|
|
|
k_param_rangefinder,
|
2019-10-23 04:57:27 -03:00
|
|
|
k_param_flash_bootloader,
|
2019-10-27 21:31:29 -03:00
|
|
|
k_param_rangefinder_baud,
|
2019-11-26 20:06:34 -04:00
|
|
|
k_param_adsb_baudrate,
|
2019-12-19 02:21:25 -04:00
|
|
|
k_param_hardpoint_id,
|
2019-12-19 03:46:03 -04:00
|
|
|
k_param_hardpoint_rate,
|
2019-12-25 04:58:51 -04:00
|
|
|
k_param_baro_enable,
|
2021-03-02 14:49:09 -04:00
|
|
|
k_param_esc_number0,
|
2023-08-22 20:00:26 -03:00
|
|
|
k_param_battery_lib,
|
2020-11-29 19:14:56 -04:00
|
|
|
k_param_debug,
|
2020-12-17 01:46:31 -04:00
|
|
|
k_param_serial_number,
|
2020-12-17 22:12:25 -04:00
|
|
|
k_param_adsb_port,
|
2020-12-12 05:08:45 -04:00
|
|
|
k_param_servo_channels,
|
2020-12-22 19:29:59 -04:00
|
|
|
k_param_rangefinder_port,
|
|
|
|
k_param_gps_port,
|
2020-12-26 19:35:15 -04:00
|
|
|
k_param_msp_port,
|
2020-12-29 01:06:44 -04:00
|
|
|
k_param_notify,
|
2021-03-13 18:56:43 -04:00
|
|
|
k_param_esc_pwm_type,
|
2021-05-19 23:34:15 -03:00
|
|
|
k_param_logger,
|
|
|
|
k_param_log_bitmask,
|
2021-04-30 22:36:42 -03:00
|
|
|
k_param_can_baudrate1,
|
|
|
|
k_param_can_baudrate2,
|
|
|
|
k_param_can_protocol0,
|
|
|
|
k_param_can_protocol1,
|
|
|
|
k_param_can_protocol2,
|
2021-06-20 03:02:12 -03:00
|
|
|
k_param_sysid_this_mav,
|
2021-07-11 03:38:42 -03:00
|
|
|
k_param_serial_manager,
|
2021-07-16 13:16:24 -03:00
|
|
|
k_param_gps_mb_only_can_port,
|
2021-09-17 11:33:17 -03:00
|
|
|
k_param_scripting,
|
2021-12-07 04:09:41 -04:00
|
|
|
k_param_esc_telem_port,
|
2021-05-17 14:26:34 -03:00
|
|
|
k_param_can_fdmode,
|
2022-02-23 04:21:20 -04:00
|
|
|
k_param_can_fdbaudrate0,
|
|
|
|
k_param_can_fdbaudrate1,
|
2022-06-01 01:46:16 -03:00
|
|
|
k_param_node_stats,
|
2022-05-27 20:27:39 -03:00
|
|
|
k_param_rangefinder_max_rate,
|
2022-06-03 08:00:14 -03:00
|
|
|
k_param_efi,
|
|
|
|
k_param_efi_port,
|
|
|
|
k_param_efi_baudrate,
|
2022-09-05 14:07:19 -03:00
|
|
|
k_param_esc_telem_rate,
|
2022-10-07 00:19:55 -03:00
|
|
|
k_param_can_slcan_cport,
|
2022-09-02 18:41:38 -03:00
|
|
|
k_param_temperature_sensor,
|
2022-12-01 06:31:22 -04:00
|
|
|
k_param_esc_command_timeout_ms,
|
2022-09-27 16:45:07 -03:00
|
|
|
k_param_proximity,
|
|
|
|
k_param_proximity_baud,
|
|
|
|
k_param_proximity_port,
|
|
|
|
k_param_proximity_max_rate,
|
2023-01-31 19:16:14 -04:00
|
|
|
k_param_nmea,
|
2023-03-16 21:25:56 -03:00
|
|
|
k_param_kdecan,
|
2021-03-02 14:49:09 -04:00
|
|
|
k_param_pole_count0,
|
|
|
|
k_param_esc_serial_port0,
|
|
|
|
k_param_esc_number1,
|
|
|
|
k_param_pole_count1,
|
|
|
|
k_param_esc_serial_port1,
|
2023-07-06 14:46:05 -03:00
|
|
|
k_param_networking,
|
2023-08-02 18:34:40 -03:00
|
|
|
k_param_rpm_sensor,
|
2023-08-15 19:13:02 -03:00
|
|
|
k_param_g_rcin,
|
2023-08-17 17:27:55 -03:00
|
|
|
k_param_sitl,
|
|
|
|
k_param_ahrs,
|
2023-08-25 06:50:15 -03:00
|
|
|
k_param_battery_balance,
|
2023-09-07 19:07:59 -03:00
|
|
|
k_param_battery_hide_mask,
|
2023-05-09 19:52:15 -03:00
|
|
|
k_param_can_mirror_ports,
|
2023-10-08 00:46:27 -03:00
|
|
|
k_param_rtc,
|
2019-05-26 22:46:41 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
AP_Int16 format_version;
|
|
|
|
AP_Int16 can_node;
|
2021-04-30 22:36:42 -03:00
|
|
|
|
|
|
|
AP_Int32 can_baudrate[HAL_NUM_CAN_IFACES];
|
|
|
|
#if HAL_NUM_CAN_IFACES >= 2
|
2023-04-18 06:44:06 -03:00
|
|
|
AP_Enum<AP_CAN::Protocol> can_protocol[HAL_NUM_CAN_IFACES];
|
2021-04-30 22:36:42 -03:00
|
|
|
#endif
|
|
|
|
|
2023-03-10 20:46:34 -04:00
|
|
|
#if AP_CAN_SLCAN_ENABLED
|
2022-10-07 00:19:55 -03:00
|
|
|
AP_Int8 can_slcan_cport;
|
|
|
|
#endif
|
|
|
|
|
2020-12-29 01:06:44 -04:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_BUZZER_WITHOUT_NOTIFY
|
2019-08-31 04:20:53 -03:00
|
|
|
AP_Int8 buzz_volume;
|
|
|
|
#endif
|
2020-12-29 01:06:44 -04:00
|
|
|
#ifdef AP_PERIPH_HAVE_LED_WITHOUT_NOTIFY
|
2019-10-10 00:18:59 -03:00
|
|
|
AP_Int8 led_brightness;
|
|
|
|
#endif
|
2019-12-25 04:58:51 -04:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_BARO
|
|
|
|
AP_Int8 baro_enable;
|
|
|
|
#endif
|
2019-10-23 04:57:27 -03:00
|
|
|
#if !defined(HAL_NO_FLASH_SUPPORT) && !defined(HAL_NO_ROMFS_SUPPORT)
|
|
|
|
AP_Int8 flash_bootloader;
|
|
|
|
#endif
|
|
|
|
|
2019-10-27 21:31:29 -03:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_RANGEFINDER
|
|
|
|
AP_Int32 rangefinder_baud;
|
2020-12-22 19:29:59 -04:00
|
|
|
AP_Int8 rangefinder_port;
|
2022-05-27 20:27:39 -03:00
|
|
|
AP_Int16 rangefinder_max_rate;
|
2019-10-27 21:31:29 -03:00
|
|
|
#endif
|
2019-11-26 20:06:34 -04:00
|
|
|
|
2023-08-26 06:53:59 -03:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_PROXIMITY
|
2022-09-27 16:45:07 -03:00
|
|
|
AP_Int32 proximity_baud;
|
|
|
|
AP_Int8 proximity_port;
|
|
|
|
AP_Int16 proximity_max_rate;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2019-11-26 20:06:34 -04:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_ADSB
|
|
|
|
AP_Int32 adsb_baudrate;
|
2020-12-17 22:12:25 -04:00
|
|
|
AP_Int8 adsb_port;
|
2019-11-26 20:06:34 -04:00
|
|
|
#endif
|
|
|
|
|
2019-12-19 02:21:25 -04:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_PWM_HARDPOINT
|
|
|
|
AP_Int16 hardpoint_id;
|
2019-12-19 03:46:03 -04:00
|
|
|
AP_Int8 hardpoint_rate;
|
2019-12-19 02:21:25 -04:00
|
|
|
#endif
|
2020-02-14 01:18:20 -04:00
|
|
|
|
2021-03-02 14:49:09 -04:00
|
|
|
#if defined(HAL_PERIPH_ENABLE_HWESC) || defined(HAL_PERIPH_ENABLE_ESC_APD)
|
|
|
|
#if defined ESC_NUMBERS
|
|
|
|
#error "ESC_NUMBERS should not have been previously defined"
|
|
|
|
#endif
|
|
|
|
#if defined(APD_ESC_INSTANCES)
|
|
|
|
#define ESC_NUMBERS APD_ESC_INSTANCES
|
|
|
|
#else
|
|
|
|
#define ESC_NUMBERS 2
|
|
|
|
#endif // defined(APD_ESC_INSTANCES)
|
|
|
|
AP_Int8 esc_number[ESC_NUMBERS];
|
|
|
|
AP_Int8 esc_serial_port[ESC_NUMBERS];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ESC_NUMBERS)
|
|
|
|
AP_Int8 pole_count[ESC_NUMBERS];
|
2020-02-14 01:18:20 -04:00
|
|
|
#endif
|
2020-11-29 19:14:56 -04:00
|
|
|
|
2020-12-22 19:29:59 -04:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_GPS
|
|
|
|
AP_Int8 gps_port;
|
2022-03-08 01:25:53 -04:00
|
|
|
#if GPS_MOVING_BASELINE
|
2021-07-16 13:16:24 -03:00
|
|
|
AP_Int8 gps_mb_only_can_port;
|
|
|
|
#endif
|
2020-12-22 19:29:59 -04:00
|
|
|
#endif
|
|
|
|
|
2020-12-26 19:35:15 -04:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_MSP
|
|
|
|
AP_Int8 msp_port;
|
|
|
|
#endif
|
2021-03-13 18:56:43 -04:00
|
|
|
|
|
|
|
#ifdef HAL_PERIPH_ENABLE_RC_OUT
|
|
|
|
AP_Int8 esc_pwm_type;
|
2022-12-01 06:31:22 -04:00
|
|
|
AP_Int16 esc_command_timeout_ms;
|
2021-12-09 16:30:58 -04:00
|
|
|
#if HAL_WITH_ESC_TELEM && !HAL_GCS_ENABLED
|
2021-12-07 04:09:41 -04:00
|
|
|
AP_Int8 esc_telem_port;
|
|
|
|
#endif
|
2022-09-05 14:07:19 -03:00
|
|
|
#if HAL_WITH_ESC_TELEM
|
|
|
|
AP_Int32 esc_telem_rate;
|
|
|
|
#endif
|
2021-03-13 18:56:43 -04:00
|
|
|
#endif
|
|
|
|
|
2020-11-29 19:14:56 -04:00
|
|
|
AP_Int8 debug;
|
|
|
|
|
2020-12-17 01:46:31 -04:00
|
|
|
AP_Int32 serial_number;
|
|
|
|
|
2021-05-19 23:34:15 -03:00
|
|
|
#if HAL_LOGGING_ENABLED
|
|
|
|
AP_Int32 log_bitmask;
|
|
|
|
#endif
|
|
|
|
|
2021-08-18 08:42:18 -03:00
|
|
|
#if HAL_GCS_ENABLED
|
2021-06-20 03:02:12 -03:00
|
|
|
AP_Int16 sysid_this_mav;
|
|
|
|
#endif
|
|
|
|
|
2023-09-07 19:07:59 -03:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_BATTERY
|
|
|
|
AP_Int32 battery_hide_mask;
|
|
|
|
#endif
|
|
|
|
|
2022-06-03 08:00:14 -03:00
|
|
|
#ifdef HAL_PERIPH_ENABLE_EFI
|
|
|
|
AP_Int32 efi_baudrate;
|
|
|
|
AP_Int8 efi_port;
|
|
|
|
#endif
|
2023-05-09 19:52:15 -03:00
|
|
|
|
|
|
|
#if HAL_PERIPH_CAN_MIRROR
|
|
|
|
AP_Int8 can_mirror_ports;
|
|
|
|
#endif // HAL_PERIPH_CAN_MIRROR
|
2022-06-03 08:00:14 -03:00
|
|
|
|
2021-05-17 14:26:34 -03:00
|
|
|
#if HAL_CANFD_SUPPORTED
|
|
|
|
AP_Int8 can_fdmode;
|
2022-02-23 04:21:20 -04:00
|
|
|
AP_Int8 can_fdbaudrate[HAL_NUM_CAN_IFACES];
|
2021-05-17 14:26:34 -03:00
|
|
|
#else
|
|
|
|
static constexpr uint8_t can_fdmode = 0;
|
|
|
|
#endif
|
2023-07-07 04:36:52 -03:00
|
|
|
AP_Int8 node_stats;
|
2019-05-26 22:46:41 -03:00
|
|
|
Parameters() {}
|
|
|
|
};
|
|
|
|
|
2023-06-05 18:43:50 -03:00
|
|
|
extern const AP_Param::Info var_info[];
|