Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Scripting: add bindings get/set full mode for GPIO #28140

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(pin_number, mode) end

-- desc
---@param pin_number integer
---@return uint32_t_ud|nil -- full pin mode ioline_t in chibios
function gpio:get_mode(pin_number) 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
Loading