This repository was archived by the owner on Nov 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Version 0.5.0
2323* Fixed a bug where get compatible pins wasn't verifying requirements.
2424* Removed get gpio config as this functionality is no longer applicable in
2525 the new UOS design.
26+ * Updated the get_gpio_input interface to allow for enabling pull-up.
2627
2728Version 0.4.0
2829-------------
Original file line number Diff line number Diff line change @@ -143,19 +143,22 @@ def set_gpio_output(
143143 )
144144
145145 def get_gpio_input (
146- self , pin : int , level : int , volatility : Persistence = Persistence .NONE
146+ self ,
147+ pin : int ,
148+ pull_up : bool = False ,
149+ volatility : Persistence = Persistence .NONE ,
147150 ) -> ComResult :
148151 """Read a GPIO pins level from device and returns the value.
149152
150153 :param pin: The numeric number of the pin as defined in the dictionary for that device.
151- :param level: Not used currently, future will define pull-up state .
154+ :param pull_up: Enable the internal pull-up resistor. Default is false .
152155 :param volatility: How volatile should the command be, use constants from uoshardware.
153156 :return: ComResult object.
154157 """
155158 return self .__execute_instruction (
156159 UOSFunctions .get_gpio_input ,
157160 InstructionArguments (
158- payload = (pin , level ),
161+ payload = (pin , 0 if pull_up else 1 ),
159162 expected_rx_packets = 2 ,
160163 check_pin = pin ,
161164 volatility = volatility ,
You can’t perform that action at this time.
0 commit comments