Skip to content

Conversation

@pgrawehr
Copy link
Contributor

@pgrawehr pgrawehr commented Oct 22, 2025

Microsoft Reviewers: Open in CodeFlow

@dotnet-policy-service dotnet-policy-service bot added the area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio label Oct 22, 2025
@joperezr joperezr requested a review from Copilot October 23, 2025 15:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new VirtualGpioControllerWithDefault class to support physical-to-logical pin mapping for GPIO controllers, specifically addressing the need for Raspberry Pi physical pin numbering. The implementation allows dynamic pin mapping through a default controller and a mapping function, replacing previous approaches that lacked this capability.

  • Adds VirtualGpioControllerWithDefault class extending VirtualGpioController with default controller support
  • Implements physical-to-logical pin mapping for Raspberry Pi boards via ConvertPinNumberFromPhysicalToLogical
  • Updates VirtualGpioController.OpenPinCore documentation to guide users toward the new alternative

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/devices/Board/VirtualGpioControllerWithDefault.cs New class providing virtual GPIO controller with default controller and pin mapping function
src/devices/Board/VirtualGpioController.cs Updated documentation for OpenPinCore to reference new alternative implementation
src/devices/Board/RaspberryPiBoard.cs Added methods to create physical pin mapping and conversion logic from physical to logical numbering

pgrawehr and others added 5 commits October 26, 2025 16:40
Should check the weird numbering of the OrangePi devices.
Neither the "logical" nor the "physical" mapping match with the
pin count, and the translation is unconditional.
Since these were only used when PinNumberingScheme == Physical, it was now unreachable
@pgrawehr pgrawehr marked this pull request as ready for review October 30, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant