Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds a new API to the
DebugProbe
abstract class to enable reading and writing of pins provided by the debug probe. Presence of this API is indicated by the probe having theDebugProbe.Capability.PIN_ACCESS
capability.This pins API is quite simple and rather limited in some ways. For protocol-type pins, it's fine. But for GPIO you'd probably want more explicit control.
Support is included for the CMSIS-DAP and Segger JLink probe drivers.
New API methods:
DebugProbe.get_accessible_pins(group: PinGroup) -> None
Returns the readable and writable for a given pin group.
DebugProbe.read_pins(group: PinGroup, mask: int) -> int
Read a selection of pins from one group.
DebugProbe.write_pins(group: PinGroup, mask: int, value: int) -> None
Write a selection of pins from one group.
There are currently two pin groups defined:
DebugProbe.PinGroup.PROTOCOL_PINS
— the usual SWD/JTAG/reset pinsDebugProbe.PinGroup.GPIO_PINS
— reserved for future access of GPIO pins provided by a debug probe, not implemented by any debug probe driver yet (it's possible for JLink, but I don't have a JLink with GPIO so couldn't test)Other changes:
accessible-pins
andpins
values to use withset
andshow
commands.