diff --git a/libraries/AP_IOMCU/AP_IOMCU.cpp b/libraries/AP_IOMCU/AP_IOMCU.cpp index 235de5784b..fa73650c20 100644 --- a/libraries/AP_IOMCU/AP_IOMCU.cpp +++ b/libraries/AP_IOMCU/AP_IOMCU.cpp @@ -784,6 +784,20 @@ void AP_IOMCU::shutdown(void) } } +/* + request bind on a DSM radio + */ +void AP_IOMCU::bind_dsm(uint8_t mode) +{ + if (config.protocol_version != IOMCU_PROTOCOL_VERSION || + hal.util->get_soft_armed()) { + // only with ChibiOS IO firmware, and disarmed + return; + } + uint16_t reg = mode; + write_registers(PAGE_SETUP, PAGE_REG_SETUP_DSM_BIND, ®); +} + /* setup for mixing. This allows fixed wing aircraft to fly in manual mode if the FMU dies diff --git a/libraries/AP_IOMCU/AP_IOMCU.h b/libraries/AP_IOMCU/AP_IOMCU.h index a06dc011a7..806a14c674 100644 --- a/libraries/AP_IOMCU/AP_IOMCU.h +++ b/libraries/AP_IOMCU/AP_IOMCU.h @@ -65,6 +65,9 @@ public: */ bool check_rcinput(uint32_t &last_frame_us, uint8_t &num_channels, uint16_t *channels, uint8_t max_channels); + // Do DSM receiver binding + void bind_dsm(uint8_t mode); + /* get servo rail voltage */