-
Notifications
You must be signed in to change notification settings - Fork 605
Create replacement for now lacking physical-to-logical pin mapping #2435
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
VirtualGpioControllerWithDefaultclass extendingVirtualGpioControllerwith default controller support - Implements physical-to-logical pin mapping for Raspberry Pi boards via
ConvertPinNumberFromPhysicalToLogical - Updates
VirtualGpioController.OpenPinCoredocumentation 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 |
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
Microsoft Reviewers: Open in CodeFlow