Skip to content

sx126x: add libgpiod v2 support via version-agnostic GPIO HAL#3

Open
exepirit wants to merge 5 commits intostrijar:mainfrom
exepirit:main
Open

sx126x: add libgpiod v2 support via version-agnostic GPIO HAL#3
exepirit wants to merge 5 commits intostrijar:mainfrom
exepirit:main

Conversation

@exepirit
Copy link

Migrates sx126x driver to libgpiod v2 API while maintaining backward compatibility with v1 through an abstraction layer.

Resolves #2

@strijar
Copy link
Owner

strijar commented Mar 17, 2026

Why did you rename and change the port type? It will always be /dev/gpiochipN, so knowing the N from config file, you can easily generate the required text string. In your case, it's easier to make a mistake in a text parameter than in a single numerical parameter.

@exepirit
Copy link
Author

exepirit commented Mar 17, 2026

Since libgpiod v2 moved from chip index to device path. I think that in long term, using device path will eliminate the need to convert N to path (if libgpiod v1 eventually deprecated in RNode).

In your case, it's easier to make a mistake in a text parameter than in a single numerical parameter.

Descriptive error messages can help the user to find a mistakes.

There is no problem to use chip index or support both variants. What do you think about this?

@strijar
Copy link
Owner

strijar commented Mar 18, 2026

There is no problem to use chip index or support both variants. What do you think about this?

Yes, I think using an index is more logical. Will you do it this way?

@exepirit
Copy link
Author

No problem. I made the changes to use chip/port index. Now in config.h and sx1262.c files are unchanged compare to upstream.

@strijar
Copy link
Owner

strijar commented Mar 19, 2026

Thanks! I'll check it out in a few days and merge the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pull gpiod refactoring from fork

2 participants