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

core.matrix style impl selection #5

Open
zeroem opened this issue Dec 1, 2014 · 1 comment
Open

core.matrix style impl selection #5

zeroem opened this issue Dec 1, 2014 · 1 comment
Labels

Comments

@zeroem
Copy link
Contributor

zeroem commented Dec 1, 2014

This is mainly to get my thoughts out about the core.matrix style implementation selection and to centralize the discussion of it.

  • I don't think the effort of building a pluggable back end is worth it for the fairly constrained number of possible gpio implemenations (sysfs for linux, maybe a jna one, something for windows? other?)
  • Unlike a matrix library in which you would need to know about the impl in many places, applications using gpio code are likely to allocate all of the pins up front. It does not seem likely that you would have dozens of files all needing to know about how to allocate pins in the same exact way
    • This is why I believe there should be a separation between the GPIOPin protocol and the reserve/release protocol. In my mind, only one point in the code would care about how to allocate pins, everything else simply acts on a pin it has been given.
  • Due to the previous two points, should someone really need to propagate the ability to allocate pins throughout their code base, I would use something like https://github.com/stuartsierra/component to manage it.
@zeroem zeroem added the question label Dec 1, 2014
@zeroem
Copy link
Contributor Author

zeroem commented Dec 3, 2014

Should the pluggable impl be pursued, we could use https://github.com/ztellman/potemkin so that the code can be logically separated, but still have all of the impls behave as if they were defined in the gpio namespace

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

No branches or pull requests

1 participant