You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the GpioDContext in pi4j-library-gpiod does not provide a way to explicitly specify the GPIO chip to use. It defaults to the first chip with a label containing "pinctrl" which might implicitly be /dev/gpiochip0 in many cases. However, this behavior is not guaranteed and may not be suitable for all use cases, especially when dealing with systems that have multiple GPIO chips or require using a specific chip other than the default.
Expected Behavior
It should be possible to explicitly specify the GPIO chip to be used by GpioDContext, either by its name (e.g., "gpiochip2") or by its number (e.g., 2). If no chip is specified, GpioDContext should fall back to a default behavior, such as selecting the first chip with "pinctrl" in its label (the current behavior).
Motivation
This enhancement would improve the flexibility and usability of GpioDContext in the following ways:
Support for Multiple GPIO Chips: Users working with systems having multiple GPIO chips can explicitly choose the desired chip.
Proposed Solution
Introduce a setChip() method to GpioDContext that allows users to specify the desired GPIO chip. This method should accept either the chip name (String) or the chip number (int).
Current Behavior
Currently, the GpioDContext in pi4j-library-gpiod does not provide a way to explicitly specify the GPIO chip to use. It defaults to the first chip with a label containing "pinctrl" which might implicitly be /dev/gpiochip0 in many cases. However, this behavior is not guaranteed and may not be suitable for all use cases, especially when dealing with systems that have multiple GPIO chips or require using a specific chip other than the default.
Expected Behavior
It should be possible to explicitly specify the GPIO chip to be used by GpioDContext, either by its name (e.g., "gpiochip2") or by its number (e.g., 2). If no chip is specified, GpioDContext should fall back to a default behavior, such as selecting the first chip with "pinctrl" in its label (the current behavior).
Motivation
This enhancement would improve the flexibility and usability of GpioDContext in the following ways:
Support for Multiple GPIO Chips: Users working with systems having multiple GPIO chips can explicitly choose the desired chip.
Proposed Solution
Introduce a setChip() method to GpioDContext that allows users to specify the desired GPIO chip. This method should accept either the chip name (String) or the chip number (int).
Proposed Method Signatures:
Proposed Changes to initialize():
The initialize() method should be modified to:
The text was updated successfully, but these errors were encountered: