Closed jakogut closed 7 years ago
@vsergeev I don't know if this fits within the scope of periphery, but using the fixed GPIO polling, I made a pure Python module to interface with RFID readers using the Wiegand 26-bit interface. Here's a paste of it: https://gist.github.com/jakogut/495e33dcee9f90efb79e6c6f2ced3583
@jakogut that's a good question. I think it'd be prudent to limit python-periphery's scope to just Linux API's for I/O (e.g. various dev and sysfs interfaces) to reduce churn and ensure stability. But I wonder if there could be something like a python-periphery-drivers for drivers like yours built on these abstractions. It'd be pretty compelling to collect a set of drivers for various SPI, I2C, etc. widgets over time that are pure Python, hardware agnostic, with consistent APIs, and tested. People have written so many one-offs of varying quality for the same stuff. But some groups already have a bunch of drivers (Adafruit, ControlEverythingCommunity, etc.). All of the ad-hoc repos seem like they're difficult to maintain, but I can imagine one big repo might also be annoying outside of prototyping. What do you think?
I think you've summed up the situation pretty well. I do think a separate project would better suit drivers built on top of the sysfs interface.
When I tried the edge polling code based on select.poll(), it seemed to always return True, and never block. I tried how RPi.GPIO did it with select.epoll(), and it seems to work better.