-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Easygpio: module for reading bits from sensors #1017
Conversation
Here's my 2 cents:
|
My immediate reaction is that this is really the equivalent of gpio.serout, but for input. It makes sense to combine these two sets into one module. See #428 for some of the difficulties here. As these are a niche use, I suspect that these would be better in a separate module -- but not "easy"gpio. However, we are in the middle of tidying up / reworking the gpio implementation, so do you mind if we keep this on hold for a few weeks? |
Thank you for suggestions, I'll split the PR into two parts - I belive the cmodule.md tutorial is uncontroversial (and for beginners, it would be great to have it); I'll make a separate PR for it. @TerryE I also thought it better to keep the functionality in a separate module (maybe also serout could be extracted?). Can I somehow help with the gpio module itself? [ie: I'd like to avoid having to track several repositories for my project which depend on the bit-banging] |
I've changed the PR as indicated above. If you would like me to do something else or help with the gpio, please let me know. Thank you. |
|
||
platform_gpio_write(pin_clk, initial_clk_write); | ||
|
||
while (platform_gpio_read(pin_data) != ready_state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can hang forever if the device doesn't respond (well, the watchdog will kill it eventually).
@romanchyla pls address Philip's comment, rebase on current |
ok, will do - give me few days... |
- use bit-banging to read sensors - added documentation
ok, updated - it is trying 1000 times before giving up (not sure that is the right solution, but can't think of anything else&simple: is that bad/low/too arbitrary?) |
I looked at the code, and I don't see any assignment to PIN_CLK (the global variable). It also isn't clear that the info() method provides much value.... |
`gpioser.read(pin_clk, pin_out, num_bits, after_ticks, delay_us, initial_val, ready_state)` | ||
|
||
#### Parameters | ||
`pin_clk` pin number of the sensor (the CLOCK channel), type is number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the parameters are missing the list markers ('- ').
Thanks Roman for the update.
So,
I have to agree. |
I vaguely remember looking at the gpio.serout (seems more flexible), the For my edification: any idea how long the gpio_read() takes? And if it's |
What a pity this has been stuck in the PR queue for so long. Terry/Philip would it be unfair argue it should be closed as no one seems to have come forward in the mean time stating they really missed what this PR would provide? |
It is also pretty out of date and would need work to make it compatible with current builds. Time to let it die a natural death. |
I've taken the opportunity to provide a short tutorial. I remember how hard it was when I tried to write my first module few months back (at that time, one had to edit 4 files). And for beginners it is really a very steep hill to climb.
Please consider it as suggestion, the easygpio module doesn't have to be enabled by default. But I'm hoping it could be useful.