Skip to content
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

gpio: Create gpio.Group interface #43

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

gsexton
Copy link
Contributor

@gsexton gsexton commented Jan 18, 2025

Fixes #30

The idea behind this interface is to give users a way to atomically modify multiple GPIO pins in one transaction.

This is essentially the interface for the LineSet I created for the IOCTL based GPIO. I'll have another PR coming to make the gpioioctl LineSet implement this interface.

I'll be adding this interface to the MCP23008, and implementing it in a future driver for a CP-2112, and MCP2201, etc. Using this Group() will make writing GPIO Backpacks for things like LCDs trivial. We can have one HD44780 GPIOBackpack that takes a Group, along with a reset and Enable pin.

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.7%. Comparing base (e01555d) to head (ab96a60).

Additional details and impacted files
@@          Coverage Diff          @@
##            main     #43   +/-   ##
=====================================
  Coverage   93.7%   93.7%           
=====================================
  Files         34      34           
  Lines       3930    3930           
=====================================
  Hits        3681    3681           
  Misses       244     244           
  Partials       5       5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@maruel maruel left a comment

Choose a reason for hiding this comment

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

Sounds good, thanks! I wanted to design that for years (literally) for the case of ft232h but never got around it. This looks good.

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

Successfully merging this pull request may close these issues.

gpio: add Group interface, to act on multiple GPIO as a single transaction
2 participants