From b3dc8b4efd00059d3de5a0ce63ee7c486c472058 Mon Sep 17 00:00:00 2001 From: Pradeep Date: Wed, 5 Jun 2024 12:37:40 +1000 Subject: [PATCH] LUA : added bindings for extended ESC telem --- libraries/AP_Scripting/docs/docs.lua | 18 ++++++++++++++++++ .../generator/description/bindings.desc | 3 +++ 2 files changed, 21 insertions(+) diff --git a/libraries/AP_Scripting/docs/docs.lua b/libraries/AP_Scripting/docs/docs.lua index 93d3fcaca6..25d7517af3 100644 --- a/libraries/AP_Scripting/docs/docs.lua +++ b/libraries/AP_Scripting/docs/docs.lua @@ -1249,6 +1249,24 @@ function esc_telem:set_rpm_scale(esc_index, scale_factor) end ---@return uint32_t_ud function esc_telem:get_last_telem_data_ms(esc_index) end +-- get the input_duty of last telemetry data for an ESC +---@param esc_index integer +---@param input_duty integer +---@return boolean +function esc_telem:get_input_duty(esc_index, input_duty) end + +-- get the output_duty of last telemetry data for an ESC +---@param esc_index integer +---@param output_duty integer +---@return boolean +function esc_telem:get_output_duty(esc_index, output_duty) end + +-- get the status flags of the last telemetry data for an ESC +---@param esc_index integer +---@param flags integer +---@return boolean +function esc_telem:get_flags(esc_index, flags) end + -- desc ---@class optical_flow optical_flow = {} diff --git a/libraries/AP_Scripting/generator/description/bindings.desc b/libraries/AP_Scripting/generator/description/bindings.desc index b63d4b734d..1b87700ede 100644 --- a/libraries/AP_Scripting/generator/description/bindings.desc +++ b/libraries/AP_Scripting/generator/description/bindings.desc @@ -315,6 +315,9 @@ singleton AP_ESC_Telem method get_usage_seconds boolean uint8_t 0 NUM_SERVO_CHAN singleton AP_ESC_Telem method update_rpm void uint8_t 0 NUM_SERVO_CHANNELS uint16_t'skip_check float'skip_check singleton AP_ESC_Telem method set_rpm_scale void uint8_t 0 NUM_SERVO_CHANNELS float'skip_check singleton AP_ESC_Telem method get_last_telem_data_ms uint32_t uint8_t 0 NUM_SERVO_CHANNELS +singleton AP_ESC_Telem method get_input_duty boolean uint8_t 0 NUM_SERVO_CHANNELS uint8_t'Null +singleton AP_ESC_Telem method get_output_duty boolean uint8_t 0 NUM_SERVO_CHANNELS uint8_t'Null +singleton AP_ESC_Telem method get_flags boolean uint8_t 0 NUM_SERVO_CHANNELS uint32_t'Null include AP_Param/AP_Param.h singleton AP_Param rename param