-
Notifications
You must be signed in to change notification settings - Fork 2k
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
WIP: Native GPIO #1737
WIP: Native GPIO #1737
Conversation
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> | ||
*/ | ||
|
||
#ifdef MODULE_NATIVE_GPIO_DUMMY |
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.
#if defined(MODULE_NATIVE_GPIO_DUMMY) || defined(MODULE_NATIVE_GPIO_SYSFS)
?
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.
I was thinking of making this configurable from the outside because the host might not have as many GPIOs.. I wasn't sure how to solve the _EN
setting and just ignored it - adding to TODO
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.
-DNATIVE_GPIO_NUMOF=42
#ifdef NATIVE_GPIO_NUMOF
# if NATIVE_GPIO_NUMOF > 16
# define GPIO_NUMOF 16
# else
# define GPIO_NUMOF NATIVE_GPIO_NUMOF
# endif
#else
# define GPIO_NUMOF 0
#endif
#if GPIO_NUMOF > 0
# define GPIO_0_EN 1
#endif
#if GPIO_NUMOF > 1
# define GPIO_1_EN 1
#endif
…
#if GPIO_NUMOF > 15
# define GPIO_15_EN 1
#endif
?
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.
seems to work, TA!
_NATIVE_GPIO_CONF_OUT, | ||
_NATIVE_GPIO_CONF_BOTH, | ||
_NATIVE_GPIO_CONF_INT, | ||
_NATIVE_GPIO_CONF_INT_OUT, |
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.
what is INT_OUT? I don't think there is something as an output interrupt for gpios...
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.
brainfart
rename "dummy" to "virtual" --> +1 |
Found to work on Raspberry PI =)
|
I like :-) |
084f4bd
to
a7e0baa
Compare
rebased on master |
@LudwigOrtmann PR needs rebase |
4865094
to
4792bea
Compare
Again... |
4792bea
to
4b3dee2
Compare
4b3dee2
to
e2e7a6b
Compare
rebased on #1838 |
d4bd239
to
138ed1c
Compare
rebased on master |
138ed1c
to
50053ee
Compare
rebased |
#endif | ||
#if GPIO_NUMOF > 15 | ||
# define GPIO_15_EN (1) | ||
#endif |
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.
hm, above you define, that there can be up to 32 GPIOs, but here you stop at 15...
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.
Hoppla.
I've been thinking to have the virtual interface do more or less the same as the sysfs does, namely write to / read from files in some directory structure. Any opinions? |
Not really, sounds sensible to me. |
I too think that this idea has it's merits. Do you have some kind of documentation on how to use it? Ideally for both the rpi and the virtual implementation. |
2953cc0
to
63229dc
Compare
9f184dd
to
45554bf
Compare
Any progress? |
still waiting for native file descriptor infrastructure pr |
Shall we close as memo? |
TODO:
- [ ] enable pullup/pulldown on sysfs (if possible)not posssible- [ ] enable mapping of host GPIO numbers to native GPIO numbersExternal GPIO/sysfs documentation:
http://pi.gadgetoid.com/pinout
http://wiki.openwrt.org/doc/hardware/port.gpio
Based on #1838