2022-02-21 00:40:40 -04:00
# include <AP_HAL/AP_HAL_Boards.h>
2019-05-26 22:46:41 -03:00
# include "AP_Periph.h"
extern const AP_HAL : : HAL & hal ;
2020-12-26 15:18:08 -04:00
# ifndef HAL_PERIPH_LED_BRIGHT_DEFAULT
# define HAL_PERIPH_LED_BRIGHT_DEFAULT 100
2019-10-18 21:28:09 -03:00
# endif
2020-12-26 15:18:08 -04:00
# ifndef HAL_PERIPH_RANGEFINDER_BAUDRATE_DEFAULT
# define HAL_PERIPH_RANGEFINDER_BAUDRATE_DEFAULT 115200
2020-12-22 19:29:59 -04:00
# endif
2022-01-27 23:55:01 -04:00
# ifndef AP_PERIPH_RANGEFINDER_PORT_DEFAULT
# define AP_PERIPH_RANGEFINDER_PORT_DEFAULT 3
2020-12-22 19:29:59 -04:00
# endif
# ifndef HAL_PERIPH_GPS_PORT_DEFAULT
# define HAL_PERIPH_GPS_PORT_DEFAULT 3
# endif
2020-01-24 19:59:01 -04:00
# ifndef HAL_PERIPH_ADSB_BAUD_DEFAULT
# define HAL_PERIPH_ADSB_BAUD_DEFAULT 57600
# endif
2020-12-17 22:12:25 -04:00
# ifndef HAL_PERIPH_ADSB_PORT_DEFAULT
# define HAL_PERIPH_ADSB_PORT_DEFAULT 1
# endif
2020-01-24 19:59:01 -04:00
2020-12-26 19:35:15 -04:00
# ifndef AP_PERIPH_MSP_PORT_DEFAULT
# define AP_PERIPH_MSP_PORT_DEFAULT 1
# endif
2021-12-07 04:09:41 -04:00
# ifndef AP_PERIPH_ESC_TELEM_PORT_DEFAULT
# define AP_PERIPH_ESC_TELEM_PORT_DEFAULT -1
# endif
2022-09-05 14:07:19 -03:00
# ifndef AP_PERIPH_ESC_TELEM_RATE_DEFAULT
# define AP_PERIPH_ESC_TELEM_RATE_DEFAULT 50
# endif
2022-01-27 23:53:35 -04:00
# ifndef AP_PERIPH_BARO_ENABLE_DEFAULT
# define AP_PERIPH_BARO_ENABLE_DEFAULT 1
# endif
2023-09-07 19:07:59 -03:00
# ifndef HAL_PERIPH_BATT_HIDE_MASK_DEFAULT
# define HAL_PERIPH_BATT_HIDE_MASK_DEFAULT 0
# endif
2022-06-03 08:00:14 -03:00
# ifndef AP_PERIPH_EFI_PORT_DEFAULT
# define AP_PERIPH_EFI_PORT_DEFAULT 3
# endif
# ifndef HAL_PERIPH_EFI_BAUDRATE_DEFAULT
# define HAL_PERIPH_EFI_BAUDRATE_DEFAULT 115200
# endif
2021-06-20 03:02:12 -03:00
# ifndef HAL_DEFAULT_MAV_SYSTEM_ID
# define MAV_SYSTEM_ID 3
# else
# define MAV_SYSTEM_ID HAL_DEFAULT_MAV_SYSTEM_ID
# endif
2021-03-02 14:49:09 -04:00
# ifndef APD_ESC_SERIAL_0
# define APD_ESC_SERIAL_0 -1
# endif
# ifndef APD_ESC_SERIAL_1
# define APD_ESC_SERIAL_1 -1
# endif
2019-05-26 22:46:41 -03:00
/*
* AP_Periph parameter definitions
*
*/
const AP_Param : : Info AP_Periph_FW : : var_info [ ] = {
// @Param: FORMAT_VERSION
// @DisplayName: Eeprom format version number
// @Description: This value is incremented when changes are made to the eeprom format
// @User: Advanced
GSCALAR ( format_version , " FORMAT_VERSION " , 0 ) ,
2021-04-18 19:29:15 -03:00
// @Param: CAN_NODE
// @DisplayName: UAVCAN node that is used for this network
// @Description: UAVCAN node should be set implicitly or 0 for dynamic node allocation
// @Range: 0 250
// @User: Advanced
// @RebootRequired: True
2019-05-26 22:46:41 -03:00
GSCALAR ( can_node , " CAN_NODE " , HAL_CAN_DEFAULT_NODE_ID ) ,
2021-04-18 19:29:15 -03:00
// @Param: CAN_BAUDRATE
// @DisplayName: Bitrate of CAN interface
// @Description: Bit rate can be set up to from 10000 to 1000000
// @Range: 10000 1000000
// @User: Advanced
// @RebootRequired: True
2021-04-30 22:36:42 -03:00
GARRAY ( can_baudrate , 0 , " CAN_BAUDRATE " , 1000000 ) ,
2023-03-10 20:46:34 -04:00
# if AP_CAN_SLCAN_ENABLED
2022-10-07 00:19:55 -03:00
// @Param: CAN_SLCAN_CPORT
// @DisplayName: SLCAN Route
// @Description: CAN Interface ID to be routed to SLCAN, 0 means no routing
// @Values: 0:Disabled,1:First interface,2:Second interface
// @User: Standard
// @RebootRequired: True
GSCALAR ( can_slcan_cport , " CAN_SLCAN_CPORT " , 1 ) ,
# endif
2023-11-22 09:45:41 -04:00
# ifdef HAL_GPIO_PIN_GPIO_CAN1_TERM
// @Param: CAN_TERMINATE
// @DisplayName: Enable CAN software temination in this node
// @Description: Enable CAN software temination in this node
// @Values: 0:Disabled,1:Enabled
// @User: Advanced
// @RebootRequired: True
GARRAY ( can_terminate , 0 , " CAN_TERMINATE " , 0 ) ,
# endif
2021-04-30 22:36:42 -03:00
# if HAL_NUM_CAN_IFACES >= 2
// @Param: CAN_PROTOCOL
// @DisplayName: Enable use of specific protocol to be used on this port
// @Description: Enabling this option starts selected protocol that will use this virtual driver. At least one CAN port must be UAVCAN or else CAN1 gets set to UAVCAN
2023-04-13 21:26:53 -03:00
// @Values: 0:Disabled,1:UAVCAN,4:PiccoloCAN,6:EFI_NWPMU,7:USD1,8:KDECAN
2021-04-30 22:36:42 -03:00
// @User: Advanced
// @RebootRequired: True
2023-04-18 06:44:06 -03:00
GARRAY ( can_protocol , 0 , " CAN_PROTOCOL " , float ( AP_CAN : : Protocol : : DroneCAN ) ) ,
2021-04-30 22:36:42 -03:00
// @Param: CAN2_BAUDRATE
2023-04-13 21:19:01 -03:00
// @CopyFieldsFrom: CAN_BAUDRATE
2021-04-30 22:36:42 -03:00
// @DisplayName: Bitrate of CAN2 interface
GARRAY ( can_baudrate , 1 , " CAN2_BAUDRATE " , 1000000 ) ,
// @Param: CAN2_PROTOCOL
2023-04-13 21:19:01 -03:00
// @CopyFieldsFrom: CAN_PROTOCOL
2023-04-18 06:44:06 -03:00
GARRAY ( can_protocol , 1 , " CAN2_PROTOCOL " , float ( AP_CAN : : Protocol : : DroneCAN ) ) ,
2023-11-22 09:45:41 -04:00
# ifdef HAL_GPIO_PIN_GPIO_CAN2_TERM
// @Param: CAN2_TERMINATE
// @CopyFieldsFrom: CAN_TERMINATE
GARRAY ( can_terminate , 1 , " CAN2_TERMINATE " , 0 ) ,
# endif
2021-04-30 22:36:42 -03:00
# endif
# if HAL_NUM_CAN_IFACES >= 3
// @Param: CAN3_BAUDRATE
// @DisplayName: Bitrate of CAN3 interface
2023-04-13 21:19:01 -03:00
// @CopyFieldsFrom: CAN_BAUDRATE
2021-04-30 22:36:42 -03:00
GARRAY ( can_baudrate , 2 , " CAN3_BAUDRATE " , 1000000 ) ,
// @Param: CAN3_PROTOCOL
2023-04-13 21:19:01 -03:00
// @CopyFieldsFrom: CAN_PROTOCOL
2023-04-18 06:44:06 -03:00
GARRAY ( can_protocol , 2 , " CAN3_PROTOCOL " , float ( AP_CAN : : Protocol : : DroneCAN ) ) ,
2023-11-22 09:45:41 -04:00
# ifdef HAL_GPIO_PIN_GPIO_CAN3_TERM
// @Param: CAN3_TERMINATE
// @CopyFieldsFrom: CAN_TERMINATE
GARRAY ( can_terminate , 2 , " CAN3_TERMINATE " , 0 ) ,
# endif
2021-04-30 22:36:42 -03:00
# endif
2019-10-23 04:57:27 -03:00
2022-02-23 04:21:20 -04:00
# if HAL_CANFD_SUPPORTED
// @Param: CAN_FDMODE
// @DisplayName: Enable CANFD mode
// @Description: Enabling this option sets the CAN bus to be in CANFD mode with BRS.
// @Values: 0:Disabled,1:Enabled
// @User: Advanced
// @RebootRequired: True
GSCALAR ( can_fdmode , " CAN_FDMODE " , 0 ) ,
// @Param: CAN_FDBAUDRATE
// @DisplayName: Set up bitrate for data section on CAN1
// @Description: This sets the bitrate for the data section of CAN1.
// @Values: 1:1M, 2:2M, 4:4M, 5:5M, 8:8M
// @User: Advanced
// @RebootRequired: True
GARRAY ( can_fdbaudrate , 0 , " CAN_FDBAUDRATE " , HAL_CANFD_SUPPORTED ) ,
# if HAL_NUM_CAN_IFACES >= 2
// @Param: CAN2_FDBAUDRATE
2023-04-13 21:19:01 -03:00
// @CopyFieldsFrom: CAN_FDBAUDRATE
2022-02-23 04:21:20 -04:00
// @DisplayName: Set up bitrate for data section on CAN2
// @Description: This sets the bitrate for the data section of CAN2.
GARRAY ( can_fdbaudrate , 1 , " CAN2_FDBAUDRATE " , HAL_CANFD_SUPPORTED ) ,
# endif
# endif
2019-10-23 04:57:27 -03:00
# if !defined(HAL_NO_FLASH_SUPPORT) && !defined(HAL_NO_ROMFS_SUPPORT)
2021-04-18 19:29:15 -03:00
// @Param: FLASH_BOOTLOADER
// @DisplayName: Trigger bootloader update
// @Description: DANGER! When enabled, the App will perform a bootloader update by copying the embedded bootloader over the existing bootloader. This may take a few seconds to perform and should only be done if you know what you're doing.
// @Range: 0 1
// @User: Advanced
2019-10-23 04:57:27 -03:00
GSCALAR ( flash_bootloader , " FLASH_BOOTLOADER " , 0 ) ,
# endif
2020-11-29 19:14:56 -04:00
2021-04-18 19:29:15 -03:00
// @Param: DEBUG
// @DisplayName: Debug
// @Description: Debug
2023-09-13 19:01:25 -03:00
// @Bitmask: 0:Show free stack space, 1:Auto Reboot after 15sec, 2:Enable sending stats
2021-04-18 19:29:15 -03:00
// @User: Advanced
2020-11-29 19:14:56 -04:00
GSCALAR ( debug , " DEBUG " , 0 ) ,
2022-03-08 04:51:27 -04:00
2021-04-18 19:29:15 -03:00
// @Param: BRD_SERIAL_NUM
// @DisplayName: Serial number of device
// @Description: Non-zero positive values will be shown on the CAN App Name string
// @Range: 0 2147483648
// @User: Advanced
2020-12-17 01:46:31 -04:00
GSCALAR ( serial_number , " BRD_SERIAL_NUM " , 0 ) ,
2020-12-29 01:06:44 -04:00
# ifdef HAL_PERIPH_ENABLE_BUZZER_WITHOUT_NOTIFY
2021-04-21 20:55:53 -03:00
// @Param: BUZZER_VOLUME
2021-04-18 19:29:15 -03:00
// @DisplayName: Buzzer volume
// @Description: Control the volume of the buzzer
// @Range: 0 100
// @Units: %
// @Increment: 1
// @User: Advanced
2019-08-31 04:20:53 -03:00
GSCALAR ( buzz_volume , " BUZZER_VOLUME " , 100 ) ,
# endif
2019-05-26 22:46:41 -03:00
# ifdef HAL_PERIPH_ENABLE_GPS
// GPS driver
2020-12-30 11:02:31 -04:00
// @Group: GPS
2021-04-10 21:01:27 -03:00
// @Path: ../libraries/AP_GPS/AP_GPS.cpp
2020-12-30 11:02:31 -04:00
GOBJECT ( gps , " GPS " , AP_GPS ) ,
2020-12-22 19:29:59 -04:00
// @Param: GPS_PORT
// @DisplayName: GPS Serial Port
// @Description: This is the serial port number where SERIALx_PROTOCOL will be set to GPS.
// @Range: 0 10
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
GSCALAR ( gps_port , " GPS_PORT " , HAL_PERIPH_GPS_PORT_DEFAULT ) ,
2021-07-16 13:16:24 -03:00
2022-03-08 01:25:53 -04:00
# if GPS_MOVING_BASELINE
2021-07-16 13:16:24 -03:00
// @Param: MB_CAN_PORT
// @DisplayName: Moving Baseline CAN Port option
// @Description: Autoselect dedicated CAN port on which moving baseline data will be transmitted.
// @Values: 0:Sends moving baseline data on all ports,1:auto select remaining port for transmitting Moving baseline Data
// @User: Advanced
// @RebootRequired: True
GSCALAR ( gps_mb_only_can_port , " GPS_MB_ONLY_PORT " , 0 ) ,
# endif
2019-05-26 22:46:41 -03:00
# endif
2020-11-21 01:29:10 -04:00
# ifdef HAL_PERIPH_ENABLE_BATTERY
// @Group: BATT
// @Path: ../libraries/AP_BattMonitor/AP_BattMonitor.cpp
2023-08-22 20:00:26 -03:00
GOBJECT ( battery_lib , " BATT " , AP_BattMonitor ) ,
2023-09-07 19:07:59 -03:00
// @Param: BATT_HIDE_MASK
// @DisplayName: Battery hide mask
2023-09-08 13:10:54 -03:00
// @Description: Instance mask of local battery index(es) to prevent transmitting their status over CAN. This is useful for hiding a "battery" instance that is used locally in the peripheral but don't want them to be treated as a battery source(s) to the autopilot. For example, an AP_Periph battery monitor with multiple batteries that monitors each locally for diagnostic or other purposes, but only reports as a single SUM battery monitor to the autopilot.
2023-09-07 19:07:59 -03:00
// @Bitmask: 0:BATT, 1:BATT2, 2:BATT3, 3:BATT4, 4:BATT5, 5:BATT6, 6:BATT7, 7:BATT8, 8:BATT9, 9:BATTA, 10:BATTB, 11:BATTC, 12:BATTD, 13:BATTE, 14:BATTF, 15:BATTG
// @User: Advanced
GSCALAR ( battery_hide_mask , " BATT_HIDE_MASK " , HAL_PERIPH_BATT_HIDE_MASK_DEFAULT ) ,
2020-11-21 01:29:10 -04:00
# endif
2019-05-26 22:46:41 -03:00
# ifdef HAL_PERIPH_ENABLE_MAG
2021-12-04 00:22:57 -04:00
// @Group: COMPASS_
2021-04-10 21:01:27 -03:00
// @Path: ../libraries/AP_Compass/AP_Compass.cpp
2021-12-04 00:22:57 -04:00
GOBJECT ( compass , " COMPASS_ " , Compass ) ,
2019-05-26 22:46:41 -03:00
# endif
# ifdef HAL_PERIPH_ENABLE_BARO
// Baro driver
2020-12-03 04:13:33 -04:00
// @Group: BARO
2021-04-10 21:01:27 -03:00
// @Path: ../libraries/AP_Baro/AP_Baro.cpp
2020-12-03 04:13:33 -04:00
GOBJECT ( baro , " BARO " , AP_Baro ) ,
2021-04-18 19:29:15 -03:00
// @Param: BARO_ENABLE
// @DisplayName: Barometer Enable
// @Description: Barometer Enable
// @Values: 0:Disabled, 1:Enabled
// @User: Standard
2022-01-27 23:53:35 -04:00
GSCALAR ( baro_enable , " BARO_ENABLE " , AP_PERIPH_BARO_ENABLE_DEFAULT ) ,
2019-05-26 22:46:41 -03:00
# endif
2019-08-31 04:20:53 -03:00
2020-12-29 01:06:44 -04:00
# ifdef AP_PERIPH_HAVE_LED_WITHOUT_NOTIFY
2021-04-18 19:29:15 -03:00
// @Param: LED_BRIGHTNESS
// @DisplayName: LED Brightness
// @Description: Select the RGB LED brightness level.
// @Range: 0 100
// @Units: %
// @Increment: 1
// @User: Standard
2020-12-26 15:18:08 -04:00
GSCALAR ( led_brightness , " LED_BRIGHTNESS " , HAL_PERIPH_LED_BRIGHT_DEFAULT ) ,
2019-10-10 00:18:59 -03:00
# endif
2019-10-03 08:02:56 -03:00
# ifdef HAL_PERIPH_ENABLE_AIRSPEED
// Airspeed driver
2022-12-30 15:42:39 -04:00
// @Group: ARSPD
2021-04-10 21:01:27 -03:00
// @Path: ../libraries/AP_Airspeed/AP_Airspeed.cpp
2022-12-30 15:42:39 -04:00
GOBJECT ( airspeed , " ARSPD " , AP_Airspeed ) ,
2019-10-03 08:02:56 -03:00
# endif
2019-10-19 01:36:14 -03:00
2019-10-27 21:31:29 -03:00
# ifdef HAL_PERIPH_ENABLE_RANGEFINDER
2021-04-18 19:29:15 -03:00
// @Param: RNGFND_BAUDRATE
// @DisplayName: Rangefinder serial baudrate
// @Description: Rangefinder serial baudrate.
// @Values: 1:1200,2:2400,4:4800,9:9600,19:19200,38:38400,57:57600,111:111100,115:115200,230:230400,256:256000,460:460800,500:500000,921:921600,1500:1500000
// @Increment: 1
// @User: Standard
// @RebootRequired: True
2020-12-26 15:18:08 -04:00
GSCALAR ( rangefinder_baud , " RNGFND_BAUDRATE " , HAL_PERIPH_RANGEFINDER_BAUDRATE_DEFAULT ) ,
2021-04-18 19:29:15 -03:00
// @Param: RNGFND_PORT
// @DisplayName: Rangefinder Serial Port
// @Description: This is the serial port number where SERIALx_PROTOCOL will be set to Rangefinder.
// @Range: 0 10
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
2022-01-27 23:55:01 -04:00
GSCALAR ( rangefinder_port , " RNGFND_PORT " , AP_PERIPH_RANGEFINDER_PORT_DEFAULT ) ,
2019-10-27 21:31:29 -03:00
2022-05-27 20:27:39 -03:00
// @Param: RNGFND_MAX_RATE
// @DisplayName: Rangefinder max rate
// @Description: This is the maximum rate we send rangefinder data in Hz. Zero means no limit
// @Units: Hz
// @Range: 0 200
// @Increment: 1
// @User: Advanced
GSCALAR ( rangefinder_max_rate , " RNGFND_MAX_RATE " , 50 ) ,
2019-10-19 01:36:14 -03:00
// Rangefinder driver
// @Group: RNGFND
2021-04-10 21:01:27 -03:00
// @Path: ../libraries/AP_RangeFinder/AP_RangeFinder.cpp
2019-10-19 01:36:14 -03:00
GOBJECT ( rangefinder , " RNGFND " , RangeFinder ) ,
# endif
2019-11-26 20:06:34 -04:00
# ifdef HAL_PERIPH_ENABLE_ADSB
2021-04-18 19:29:15 -03:00
// @Param: ADSB_BAUDRATE
// @DisplayName: ADSB serial baudrate
// @Description: ADSB serial baudrate.
// @Values: 1:1200,2:2400,4:4800,9:9600,19:19200,38:38400,57:57600,111:111100,115:115200,230:230400,256:256000,460:460800,500:500000,921:921600,1500:1500000
// @Increment: 1
// @User: Standard
// @RebootRequired: True
2020-01-24 19:59:01 -04:00
GSCALAR ( adsb_baudrate , " ADSB_BAUDRATE " , HAL_PERIPH_ADSB_BAUD_DEFAULT ) ,
2021-04-18 19:29:15 -03:00
// @Param: ADSB_PORT
// @DisplayName: ADSB Serial Port
// @Description: This is the serial port number where SERIALx_PROTOCOL will be set to ADSB.
// @Range: 0 10
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
2020-12-17 22:12:25 -04:00
GSCALAR ( adsb_port , " ADSB_PORT " , HAL_PERIPH_ADSB_PORT_DEFAULT ) ,
2019-11-26 20:06:34 -04:00
# endif
2019-12-19 02:21:25 -04:00
# ifdef HAL_PERIPH_ENABLE_PWM_HARDPOINT
2021-04-18 19:29:15 -03:00
// @Param: HARDPOINT_ID
// @DisplayName: Hardpoint ID
// @Description: Hardpoint ID
// @User: Advanced
2019-12-19 02:21:25 -04:00
GSCALAR ( hardpoint_id , " HARDPOINT_ID " , HAL_PWM_HARDPOINT_ID_DEFAULT ) ,
2021-04-18 19:29:15 -03:00
// @Param: HARDPOINT_RATE
// @DisplayName: Hardpoint PWM rate
// @Description: Hardpoint PWM rate
// @Range: 10 100
// @Units: Hz
// @Increment: 1
// @User: Advanced
2019-12-19 03:46:03 -04:00
GSCALAR ( hardpoint_rate , " HARDPOINT_RATE " , 100 ) ,
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)
2021-04-18 19:29:15 -03:00
// @Param: ESC_NUMBER
// @DisplayName: ESC number
// @Description: This is the ESC number to report as in UAVCAN ESC telemetry feedback packets.
// @Increment: 1
// @User: Advanced
2021-03-02 14:49:09 -04:00
GARRAY ( esc_number , 0 , " ESC_NUMBER " , 0 ) ,
2020-02-14 01:18:20 -04:00
# endif
2020-11-29 19:14:56 -04:00
2020-12-12 05:08:45 -04:00
# ifdef HAL_PERIPH_ENABLE_RC_OUT
// Servo driver
// @Group: OUT
// @Path: ../libraries/SRV_Channel/SRV_Channels.cpp
GOBJECT ( servo_channels , " OUT " , SRV_Channels ) ,
2021-03-13 18:56:43 -04:00
2021-04-18 19:29:15 -03:00
// @Param: ESC_PWM_TYPE
// @DisplayName: Output PWM type
// @Description: This selects the output PWM type, allowing for normal PWM continuous output, OneShot, brushed or DShot motor output
2021-12-05 21:05:42 -04:00
// @Values: 1:Normal,2:OneShot,3:OneShot125,4:Brushed,5:DShot150,6:DShot300,7:DShot600,8:DShot1200
2021-04-18 19:29:15 -03:00
// @User: Advanced
// @RebootRequired: True
2021-03-13 18:56:43 -04:00
GSCALAR ( esc_pwm_type , " ESC_PWM_TYPE " , 0 ) ,
2021-12-07 04:09:41 -04:00
2022-12-01 06:31:22 -04:00
// @Param: ESC_CMD_TIMO
// @DisplayName: ESC Command Timeout
// @Description: This is the duration (ms) with which to hold the last driven ESC command before timing out and zeroing the ESC outputs. To disable zeroing of outputs in event of CAN loss, use 0. Use values greater than the expected duration between two CAN frames to ensure Periph is not starved of ESC Raw Commands.
// @Range: 0 10000
// @Units: ms
// @User: Advanced
GSCALAR ( esc_command_timeout_ms , " ESC_CMD_TIMO " , 200 ) ,
2021-12-09 16:30:58 -04:00
# if HAL_WITH_ESC_TELEM && !HAL_GCS_ENABLED
2021-12-07 04:09:41 -04:00
// @Param: ESC_TELEM_PORT
// @DisplayName: ESC Telemetry Serial Port
// @Description: This is the serial port number where SERIALx_PROTOCOL will be set to ESC Telemetry
// @Range: 0 10
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
GSCALAR ( esc_telem_port , " ESC_TELEM_PORT " , AP_PERIPH_ESC_TELEM_PORT_DEFAULT ) ,
# endif
2022-09-05 14:07:19 -03:00
# if HAL_WITH_ESC_TELEM
// @Param: ESC_TELEM_RATE
// @DisplayName: ESC Telemetry update rate
// @Description: This is the rate at which ESC Telemetry will be sent across the CAN bus
// @Range: 0 1000
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
GSCALAR ( esc_telem_rate , " ESC_TELEM_RATE " , AP_PERIPH_ESC_TELEM_RATE_DEFAULT ) ,
# endif
2020-12-12 05:08:45 -04:00
# endif
2022-09-02 18:41:38 -03:00
# if AP_TEMPERATURE_SENSOR_ENABLED
// @Group: TEMP
// @Path: ../libraries/AP_TemperatureSensor/AP_TemperatureSensor.cpp
GOBJECT ( temperature_sensor , " TEMP " , AP_TemperatureSensor ) ,
# endif
2020-12-26 19:35:15 -04:00
# ifdef HAL_PERIPH_ENABLE_MSP
2021-04-18 19:29:15 -03:00
// @Param: MSP_PORT
// @DisplayName: MSP Serial Port
// @Description: This is the serial port number where SERIALx_PROTOCOL will be set to MSP
// @Range: 0 10
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
2020-12-26 19:35:15 -04:00
GSCALAR ( msp_port , " MSP_PORT " , AP_PERIPH_MSP_PORT_DEFAULT ) ,
# endif
2020-12-29 01:06:44 -04:00
# ifdef HAL_PERIPH_ENABLE_NOTIFY
// @Group: NTF_
// @Path: ../libraries/AP_Notify/AP_Notify.cpp
GOBJECT ( notify , " NTF_ " , AP_Notify ) ,
# endif
2021-05-19 23:34:15 -03:00
# if HAL_LOGGING_ENABLED
// @Group: LOG
// @Path: ../libraries/AP_Logger/AP_Logger.cpp
GOBJECT ( logger , " LOG " , AP_Logger ) ,
// @Param: LOG_BITMASK
// @DisplayName: Log bitmask
// @Description: 4 byte bitmap of log types to enable
// @Bitmask: 2:GPS
// @User: Standard
GSCALAR ( log_bitmask , " LOG_BITMASK " , 4 ) ,
# endif
2021-08-18 08:42:18 -03:00
# if HAL_GCS_ENABLED
2021-06-20 03:02:12 -03:00
// @Param: SYSID_THISMAV
// @DisplayName: MAVLink system ID of this vehicle
// @Description: Allows setting an individual system id for this vehicle to distinguish it from others on the same network
// @Range: 1 255
// @User: Advanced
GSCALAR ( sysid_this_mav , " SYSID_THISMAV " , MAV_SYSTEM_ID ) ,
2023-11-16 03:35:16 -04:00
# endif
2021-07-11 03:38:42 -03:00
2023-11-16 03:35:16 -04:00
# if HAL_GCS_ENABLED || defined(HAL_PERIPH_SHOW_SERIAL_MANAGER_PARAMS)
2021-07-11 03:38:42 -03:00
// @Group: SERIAL
// @Path: ../libraries/AP_SerialManager/AP_SerialManager.cpp
GOBJECT ( serial_manager , " SERIAL " , AP_SerialManager ) ,
2021-06-20 03:02:12 -03:00
# endif
2021-11-15 01:08:36 -04:00
# if AP_SCRIPTING_ENABLED
2021-09-17 11:33:17 -03:00
// @Group: SCR_
// @Path: ../libraries/AP_Scripting/AP_Scripting.cpp
GOBJECT ( scripting , " SCR_ " , AP_Scripting ) ,
# endif
2021-05-17 14:26:34 -03:00
2022-06-01 01:46:16 -03:00
# if AP_STATS_ENABLED
// @Group: Node
// @Path: ../libraries/AP_Stats/AP_Stats.cpp
GOBJECT ( node_stats , " STAT " , AP_Stats ) ,
# endif
2022-06-03 08:00:14 -03:00
# ifdef HAL_PERIPH_ENABLE_EFI
// @Param: EFI_BAUDRATE
// @DisplayName: EFI serial baudrate
// @Description: EFI serial baudrate.
// @Values: 1:1200,2:2400,4:4800,9:9600,19:19200,38:38400,57:57600,111:111100,115:115200,230:230400,256:256000,460:460800,500:500000,921:921600,1500:1500000
// @Increment: 1
// @User: Standard
// @RebootRequired: True
GSCALAR ( efi_baudrate , " EFI_BAUDRATE " , HAL_PERIPH_EFI_BAUDRATE_DEFAULT ) ,
// @Param: EFI_PORT
// @DisplayName: EFI Serial Port
// @Description: This is the serial port number where SERIALx_PROTOCOL will be set to EFI.
// @Range: 0 10
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
GSCALAR ( efi_port , " EFI_PORT " , AP_PERIPH_EFI_PORT_DEFAULT ) ,
// EFI driver
// @Group: EFI
// @Path: ../libraries/AP_EFI/AP_EFI.cpp
GOBJECT ( efi , " EFI " , AP_EFI ) ,
# endif
2023-08-26 06:53:59 -03:00
# ifdef HAL_PERIPH_ENABLE_PROXIMITY
2022-09-27 16:45:07 -03:00
// @Param: PRX_BAUDRATE
// @DisplayName: Proximity Sensor serial baudrate
// @Description: Proximity Sensor serial baudrate.
// @Values: 1:1200,2:2400,4:4800,9:9600,19:19200,38:38400,57:57600,111:111100,115:115200,230:230400,256:256000,460:460800,500:500000,921:921600,1500:1500000
// @Increment: 1
// @User: Standard
// @RebootRequired: True
GSCALAR ( proximity_baud , " PRX_BAUDRATE " , HAL_PERIPH_RANGEFINDER_BAUDRATE_DEFAULT ) ,
// @Param: PRX_PORT
// @DisplayName: Proximity Sensor Serial Port
// @Description: This is the serial port number where SERIALx_PROTOCOL will be set to Proximity Sensor.
// @Range: 0 10
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
GSCALAR ( proximity_port , " PRX_PORT " , AP_PERIPH_RANGEFINDER_PORT_DEFAULT ) ,
// @Param: PRX_MAX_RATE
// @DisplayName: Proximity Sensor max rate
// @Description: This is the maximum rate we send Proximity Sensor data in Hz. Zero means no limit
// @Units: Hz
// @Range: 0 200
// @Increment: 1
// @User: Advanced
GSCALAR ( proximity_max_rate , " PRX_MAX_RATE " , 50 ) ,
// Proximity driver
// @Group: PRX
2023-03-17 10:53:35 -03:00
// @Path: ../libraries/AP_Proximity/AP_Proximity.cpp
2022-09-27 16:45:07 -03:00
GOBJECT ( proximity , " PRX " , AP_Proximity ) ,
2023-08-26 06:53:59 -03:00
# endif // HAL_PERIPH_ENABLE_PROXIMITY
2022-09-27 16:45:07 -03:00
2023-01-31 19:16:14 -04:00
# if HAL_NMEA_OUTPUT_ENABLED
// @Group: NMEA_
// @Path: ../libraries/AP_NMEA_Output/AP_NMEA_Output.cpp
GOBJECT ( nmea , " NMEA_ " , AP_NMEA_Output ) ,
# endif
2023-03-16 21:25:56 -03:00
# if AP_KDECAN_ENABLED
// @Group: KDE_
// @Path: ../libraries/AP_KDECAN/AP_KDECAN.cpp
GOBJECT ( kdecan , " KDE_ " , AP_KDECAN ) ,
# endif
2021-03-02 14:49:09 -04:00
# if defined(HAL_PERIPH_ENABLE_ESC_APD)
GARRAY ( pole_count , 0 , " ESC_NUM_POLES " , 22 ) ,
# endif
# if defined(HAL_PERIPH_ENABLE_ESC_APD)
// @Param: ESC_APD_SERIAL_1
// @DisplayName: ESC APD Serial 1
// @Description: Which serial port to use for APD ESC data
// @Range: 0 6
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
GARRAY ( esc_serial_port , 0 , " ESC_APD_SERIAL_1 " , APD_ESC_SERIAL_0 ) ,
# if APD_ESC_INSTANCES > 1
GARRAY ( esc_number , 1 , " ESC_NUMBER2 " , 1 ) ,
GARRAY ( pole_count , 1 , " ESC_NUM_POLES2 " , 22 ) ,
// @Param: ESC_APD_SERIAL_2
// @DisplayName: ESC APD Serial 2
// @Description: Which serial port to use for APD ESC data
// @Range: 0 6
// @Increment: 1
// @User: Advanced
// @RebootRequired: True
GARRAY ( esc_serial_port , 1 , " ESC_APD_SERIAL_2 " , APD_ESC_SERIAL_1 ) ,
# endif
# endif
2023-08-02 21:50:27 -03:00
# ifdef HAL_PERIPH_ENABLE_NETWORKING
2023-07-06 14:46:05 -03:00
// @Group: NET_
2023-11-22 20:10:55 -04:00
// @Path: networking.cpp
GOBJECT ( networking_periph , " NET_ " , Networking_Periph ) ,
2023-07-06 14:46:05 -03:00
# endif
2023-08-02 18:34:40 -03:00
# ifdef HAL_PERIPH_ENABLE_RPM
// @Group: RPM
// @Path: ../libraries/AP_RPM/AP_RPM.cpp
GOBJECT ( rpm_sensor , " RPM " , AP_RPM ) ,
# endif
2023-05-18 05:20:22 -03:00
# ifdef HAL_PERIPH_ENABLE_RCIN
2023-08-15 19:13:02 -03:00
// @Group: RC
// @Path: rc_in.cpp
GOBJECT ( g_rcin , " RC " , Parameters_RCIN ) ,
# endif
2023-05-18 05:20:22 -03:00
2023-08-25 06:50:15 -03:00
# ifdef HAL_PERIPH_ENABLE_BATTERY_BALANCE
// @Group: BAL
// @Path: batt_balance.cpp
GOBJECT ( battery_balance , " BAL " , BattBalance ) ,
# endif
2023-12-19 16:40:30 -04:00
# ifdef HAL_PERIPH_ENABLE_SERIAL_OPTIONS
// @Group: UART
// @Path: serial_options.cpp
GOBJECT ( serial_options , " UART " , SerialOptions ) ,
# endif
2023-08-25 06:50:15 -03:00
// NOTE: sim parameters should go last
2023-08-17 17:27:55 -03:00
# if AP_SIM_ENABLED
// @Group: SIM_
// @Path: ../libraries/SITL/SITL.cpp
GOBJECT ( sitl , " SIM_ " , SITL : : SIM ) ,
# if AP_AHRS_ENABLED
// @Group: AHRS_
// @Path: ../libraries/AP_AHRS/AP_AHRS.cpp
GOBJECT ( ahrs , " AHRS_ " , AP_AHRS ) ,
# endif
# endif // AP_SIM_ENABLED
2023-08-25 06:50:15 -03:00
2023-05-09 19:52:15 -03:00
# if HAL_PERIPH_CAN_MIRROR
// @Param: CAN_MIRROR_PORTS
// @DisplayName: CAN ports to mirror traffic between
// @Description: Any set ports will participate in blindly mirroring traffic from one port to the other. It is the users responsibility to ensure that no loops exist that cause traffic to be infinitly repeated, and both ports must be running the same baud rates.
2023-09-18 21:20:30 -03:00
// @Bitmask: 0:CAN1, 1:CAN2, 2:CAN3
2023-05-09 19:52:15 -03:00
// @User: Advanced
GSCALAR ( can_mirror_ports , " CAN_MIRROR_PORTS " , 0 ) ,
# endif // HAL_PERIPH_CAN_MIRROR
2023-10-08 00:46:27 -03:00
# ifdef HAL_PERIPH_ENABLE_RTC
// @Group: RTC
// @Path: ../libraries/AP_RTC/AP_RTC.cpp
GOBJECT ( rtc , " RTC " , AP_RTC ) ,
# endif
2019-05-26 22:46:41 -03:00
AP_VAREND
} ;
void AP_Periph_FW : : load_parameters ( void )
{
AP_Param : : setup_sketch_defaults ( ) ;
2023-01-06 01:12:25 -04:00
AP_Param : : check_var_info ( ) ;
2019-05-26 22:46:41 -03:00
if ( ! g . format_version . load ( ) | |
g . format_version ! = Parameters : : k_format_version ) {
// erase all parameters
StorageManager : : erase ( ) ;
AP_Param : : erase_all ( ) ;
// save the current format version
g . format_version . set_and_save ( Parameters : : k_format_version ) ;
}
2022-07-04 22:58:18 -03:00
g . format_version . set_default ( Parameters : : k_format_version ) ;
2019-05-26 22:46:41 -03:00
// Load all auto-loaded EEPROM variables
AP_Param : : load_all ( ) ;
}