Skip to content

Commit

Permalink
AP_Scripting: add bindings get/set full mode for GPIO
Browse files Browse the repository at this point in the history
allows setting alternate pin modes pin drive strengths etc.
  • Loading branch information
bugobliterator committed Sep 20, 2024
1 parent a9ea760 commit b218400
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,26 @@ function gpio:write(pin_number, value) end
---@return boolean -- pin state
function gpio:read(pin_number) end

-- desc
---@param pin_number integer
---@param mode uint32_t_ud|integer|number
function gpio:set_mode(param1, param2) end

-- desc
---@param pin_number integer
---@return uint32_t_ud|nil -- full pin mode ioline_t in chibios
function gpio:get_mode(param1) end

-- desc
---@param pin_number integer
---@param mode uint32_t_ud|integer|number
function gpio:setPinFullMode(pin_number, mode) end

-- desc
---@param pin_number integer
---@return uint32_t_ud|nil -- full pin mode ioline_t in chibios
function gpio:getPinFullMode(pin_number) end


-- desc
Motors_6DoF = {}
Expand Down
4 changes: 4 additions & 0 deletions libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,10 @@ singleton hal.gpio method read boolean uint8_t'skip_check
singleton hal.gpio method write void uint8_t'skip_check uint8_t 0 1
singleton hal.gpio method toggle void uint8_t'skip_check
singleton hal.gpio method pinMode void uint8_t'skip_check uint8_t 0 1
singleton hal.gpio method get_mode boolean uint8_t'skip_check uint32_t'Null
singleton hal.gpio method get_mode alias getPinFullMode
singleton hal.gpio method set_mode void uint8_t'skip_check uint32_t'skip_check
singleton hal.gpio method set_mode alias setPinFullMode

singleton hal.analogin depends !defined(HAL_DISABLE_ADC_DRIVER)
singleton hal.analogin rename analog
Expand Down

0 comments on commit b218400

Please sign in to comment.