From 176a4aa51a3700a8c84d6fc9cba8b99c5a69825a Mon Sep 17 00:00:00 2001 From: Henry Wurzburg Date: Thu, 16 Nov 2023 16:04:20 -0600 Subject: [PATCH] AP_BoardConfig: add arm/disarm controlled GPIO for module power control --- libraries/AP_BoardConfig/AP_BoardConfig.cpp | 2 +- libraries/AP_BoardConfig/AP_BoardConfig.h | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.cpp b/libraries/AP_BoardConfig/AP_BoardConfig.cpp index cbd3292236..7367d34306 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.cpp +++ b/libraries/AP_BoardConfig/AP_BoardConfig.cpp @@ -289,7 +289,7 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = { // @Param: OPTIONS // @DisplayName: Board options // @Description: Board specific option flags - // @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp, 2:Enable set of internal parameters, 3:Enable Debug Pins, 4:Unlock flash on reboot, 5:Write protect firmware flash on reboot, 6:Write protect bootloader flash on reboot, 7:Skip board validation + // @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp, 2:Enable set of internal parameters, 3:Enable Debug Pins, 4:Unlock flash on reboot, 5:Write protect firmware flash on reboot, 6:Write protect bootloader flash on reboot, 7:Skip board validation, 8:Disable board arming gpio output change on arm/disarm // @User: Advanced AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT), diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.h b/libraries/AP_BoardConfig/AP_BoardConfig.h index f1321c93ec..18e6a007e9 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.h +++ b/libraries/AP_BoardConfig/AP_BoardConfig.h @@ -155,9 +155,19 @@ public: UNLOCK_FLASH = (1<<4), WRITE_PROTECT_FLASH = (1<<5), WRITE_PROTECT_BOOTLOADER = (1<<6), - SKIP_BOARD_VALIDATION = (1<<7) + SKIP_BOARD_VALIDATION = (1<<7), + DISABLE_ARMING_GPIO = (1<<8) }; + //return true if arming gpio output is disabled + static bool arming_gpio_disabled(void) { + return _singleton?(_singleton->_options & DISABLE_ARMING_GPIO)!=0:1; + } + +#ifndef HAL_ARM_GPIO_POL_INVERT +#define HAL_ARM_GPIO_POL_INVERT 0 +#endif + // return true if ftp is disabled static bool ftp_disabled(void) { return _singleton?(_singleton->_options & DISABLE_FTP)!=0:1;