GPIO in the kernel: future directions
GPIO in the kernel: future directions
Posted Jan 24, 2013 19:50 UTC (Thu) by dlang (guest, #313)In reply to: GPIO in the kernel: future directions by jimparis
Parent article: GPIO in the kernel: future directions
There is also the chance that changing multiple bits at once is much easier than changing one bit at a time.
If you were to use a parallel printer port as a GPIO (it has 8 outputs and 3 inputs IIRC), it's much easier to change all 8 bits at once than to change one bit at a time.
The only thing I find questionable with the concept is that it allows grouping GPIO lines that do not have any underlying connection, but that doesn't make things any worse than they are now (other than possibly fooling the programmer into thinking they are better than they are now), and the improvements in the code of things using GPIO lines can be significant.
one place this would make a huge amount of sense from a software point of view is if you are connected to a small LCD display through a parallel interface (very common for 16 character x 2 line displays for example).
with this interface, you can do
nibble = *c & 0x0F;
output(nibble);
toggle(clock);
nibble = *c++ <<4 & 0x0F;
output(nibble);
toggle(clock);
it would be much more work if you had to set each line independently.